TryHackMe: Blog Room Write-Up
Introduction
In this write-up, I will walk through the steps I took to solve the "Blog" room on TryHackMe. This challenge involved reconnaissance, WordPress enumeration, privilege escalation, and exploiting environment variables.
Machine Details
Enumeration
Nmap Scan
First, I performed an aggressive full port scan to discover open services:
nmap -Pn -p- -sVC -T4 10.10.180.14
Nmap Findings:
WordPress Enumeration
Using wpscan, I scanned the WordPress instance for vulnerabilities and user enumeration:
wpscan --url blog.thm -e
Findings:
To attempt brute-force login:
wpscan --url https://blog.thm/wp-login.php -U kwheel,bjoel -P /usr/share/wordlists/rockyou.txt
Successful credentials:
领英推荐
Initial Access
Using the discovered credentials, I logged into the WordPress admin panel and obtained access as www-data.
Privilege Escalation
To escalate privileges, I ran linpeas.sh, an automated enumeration tool, to identify potential privilege escalation vectors.
Exploiting checker
One interesting finding was the presence of a binary named checker. Running ltrace on it revealed that it checks for an admin environment variable.
Tools and Techniques Used:
Steps to Exploit:
which ltrace
ltrace checker
Output:
getenv("admin") = nil
puts("Not an Admin")
This output indicates that the program checks for an environment variable named admin. If it is set, the program might grant higher privileges. To manipulate this, we export the admin variable and rerun the binary:
export admin=1
checker
By doing this, we successfully elevate our privileges, leading to access to the following flags:
We can find our flag file by using this,
find / -name [file_name] 2>/dev/null
Conclusion
This room demonstrated key aspects of web application penetration testing, including: ? WordPress Enumeration ? Credential Brute Force ? Privilege Escalation via Environment Variables
eJPT Certified || RED Teamer || Penetration Tester || OSINT || ?? CTF Player || Tryhackme Top 2% Worldwide??
3 周Insightful
CEH Practical ?eJPT ?top 2% TryHackMe ?Red Teamer ?Cyber-Security Enthusiasts ?BugHunter(Part-Time)
3 周Insightful??
Very informative??