Setup
mkdir -p HackTheBox/permx/scans; cd HackTheBox/permx
IP Address: 10.10.11.23
echo "10.10.11.23 permx.htb" | sudo tee -a /etc/hosts
10.10.11.23 permx.htb
Enumeration
nmap -sC -sV -Pn -p- permx.htb -oN scans/nmap -vv
nmap -sC -sV -p- -T5 --min-rate 2500 -oN scans/nmap_2 permx.htb
# nmap findings
Scanning permx.htb (10.10.11.23) [65535 ports]
Discovered open port 22/tcp on 10.10.11.23
Discovered open port 80/tcp on 10.10.11.23
gobuster dir --no-error -e -x php,html,txt -u http://permx.htb -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -t 100 --output scans/gobuster
# gobuster findings
http://permx.htb/.html (Status: 403) [Size: 274]
http://permx.htb/index.html (Status: 200) [Size: 36182]
http://permx.htb/.php (Status: 403) [Size: 274]
http://permx.htb/about.html (Status: 200) [Size: 20542]
http://permx.htb/contact.html (Status: 200) [Size: 14753]
http://permx.htb/img (Status: 301) [Size: 304] [--> http://permx.htb/img/]
http://permx.htb/css (Status: 301) [Size: 304] [--> http://permx.htb/css/]
http://permx.htb/courses.html (Status: 200) [Size: 22993]
http://permx.htb/team.html (Status: 200) [Size: 14806]
http://permx.htb/lib (Status: 301) [Size: 304] [--> http://permx.htb/lib/]
http://permx.htb/js (Status: 301) [Size: 303] [--> http://permx.htb/js/]
http://permx.htb/404.html (Status: 200) [Size: 10428]
http://permx.htb/LICENSE.txt (Status: 200) [Size: 1422]
http://permx.htb/testimonial.html (Status: 200) [Size: 13018]
ffuf -r -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-110000.txt:ff -u http://permx.htb/ -H 'Host: ff.permx.htb' -o scans/ffuf_subdomains
#FFUF subdomain search findings
lms [Status: 200, Size: 19347, Words: 4910, Lines: 353, Duration: 326ms]
Got Shell
/var/www/chamilo/app/config/configuration.php
$_configuration['db_host'] = 'localhost';
$_configuration['db_port'] = '3306';
$_configuration['main_database'] = 'chamilo';
$_configuration['db_user'] = 'chamilo';
$_configuration['db_password'] = '03F6lY3uXAP2bkW8';
user flag
Location: /home/mtz | Flag: ************************
Privilege Escalation
in this change NOPASSWD for mtz user to all and do sudo su
root flag
Location: /root/root.txt | Flag:************************