HackTheBox - Example Machine Writeup
โข1 min read
#htb#web#sql-injection
๐Challenge Info
HackTheBox - Example Machine ๐
This is a sample CTF writeup demonstrating the content structure for CTF challenges.
Machine Info ๐
- Platform: HackTheBox
- Difficulty: Medium
- Points: 30
- Category: Web
Enumeration ๐
First, let's start with a basic nmap scan:
nmap -sV -sC -oA example 10.10.10.100
Results show:
- Port 22 (SSH)
- Port 80 (HTTP)
- Port 3306 (MySQL)
Initial Foothold ๐
The web application has a login form vulnerable to SQL injection:
' OR '1'='1' --
Privilege Escalation ๐
After gaining initial access, we find a misconfigured sudo permission:
sudo -l
# User can run /usr/bin/vim as root
Flag ๐
The root flag was found at /root/root.txt.
Lessons Learned ๐
- Always sanitize user input
- Principle of least privilege for sudo permissions
- Regular security audits are essential