BOUNTYHUNTER
Scanning
NMAP
➜ ~ nmap -T4 bountyhunter.htb
Starting Nmap 7.91 ( https://nmap.org ) at 2021-08-16 07:41 EDT
Nmap scan report for bountyhunter.htb (10.10.11.100)
Host is up (0.23s latency).
Not shown: 998 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
Nmap done: 1 IP address (1 host up) scanned in 22.44 secondsfast scan to know open ports we know from box name it will be web base box
Enumeration
gobuster
gobuster dir -u http://bountyhunter.htb/ -w /usr/share/wordlist/dirbuster/directory-list-lowercase-2.3-medium.txt -x php
. . .
/db.php
/resources
. . .port 80

home page
click portal ...


catch this form post request with Burpsuite

lets decode data parameter to understand what's going on

XML ... lets try XXE injection
Exploit
Payload
encode to Base64 then URL encoding

send payload

it works but wait ... will be back in second ...
after directory busting we found this directory

open README.txt

lets try to grab db.php file "gobuster output"
payload
encode to Base64 then URL encoding

send payload ...

try to SSH admin user but it not working ...
lets try another user

burp output when we trigger /etc/passwd
the user development look interesting user with UID 1000 is probably the first user ever created on that particular system
try too SSH development user with m19RoAU0hP41A1sTsq6K password
it works ! ....
Privilege Escalation
check sudo rights sudo -l

we can execute /opt/skytrain_inc/ticketValidator.py as root with no password
read to know what the script doing cat /opt/skytrain_inc/ticketValidator.py
we gonna build the payload based on these lines
Payload
file name root.md

Box creator include the Privilege Escalation payload in /tmp/test.md
Last updated