Exploiting the HTB “Networked” Box: From Recon to Root

HTB - Networked Walkthrough

Category: Web Exploitation, Privilege Escalation Tags: #cybersecurity


🕵️ Initial Recon

  • Service found: SSH

  • Version: OpenSSH 7.4

  • Possible exploit: CVE-2016-10012

wfuzz -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt --hc 404 http://10.10.10.146/FUZZ
  • Found and extracted backup.tar archive.

  • Inside: upload.php code with weak validation.


📤 File Upload Vulnerability

  • The upload logic checks only:

    • MIME type

    • File extension

Request (Burp Suite)

🐚 Reverse Shell Access

  • Used nc on Parrot OS:

  • Burp request:


🧼 File Cleanup Script Vulnerability

  • In guly's home directory, a script was auto-deleting files not matching an IP regex.

  • This allows command injection.

  • made a reverse shell

  • gully can run the following

Reproduction


⚙️ Privilege Escalation via changename.sh

  • Vulnerability: passes user-controlled input to a script executed with root privileges.

Exploit:

When prompted:

Executes /tmp/payload as root.

  • as said in this Blog post if a space is given this is executed everything after the space as root

    • https://seclists.org/fulldisclosure/2019/Apr/24


🧠 Lessons

  • Never trust user input — always sanitize and validate properly.

  • File upload protections should go beyond MIME and extension.

  • Never directly pass input to shell commands without sanitization.


🔗 References

Last updated