HTB | SwagShop

This is the Box on Hack The Box Linux Privilege Escalation 101 Track. Find the box here.

Skill Learned

  • Exploit modification

  • GTFObins

NMAP

IP: 10.10.10.140

nmap -sT -p- --min-rate 10000 10.10.10.140
nmap scan

Port 80

Let's visit port 80

port 80
dirsearch

while looking at the directories I found http://swagshop.htb/app/etc/local.xml

Which have root/admin credentials

/app/etc/local.xml

not able to find any login page so I started fuzzing again.

dirsearch

found /index.php/admin

/admin

Foothold/shell

let's try to login with the credential we got earlier, it was not working on googling I found this exploit.

In the script change target to http://swagshop.htb/index.php

and run the script

let's try forme:forme

and we are in

Magento admin panel

A simple Google search found me this.

In the script change username, password and install_date and run the script

change username, password and install_date
python 37811.py

now we can try for reverse shell

nc -nlvp 1234

found the user.txt

user.txt

Priv Esc

sudo -l

we can use /usr/bin/vi /var/www/html/* without password

and we can have root.txt

root.txt

Now let's try for shell

GTFObin tells me how to get shell

root

Last updated