Sitemap
Jawher Mastour

Jawher Mastour

Senior SOC Analyst | CEH | BTL 1 | EJPT | RHCSA | CCNA | AWS CCP | 6x MTA

Kioptrix: Level 1 [Vulnhub] Walkthrough

3 min readApr 9, 2022

--

Hello,Kioptrix are a series of easy machines in vulnhub, from kioptrix1 to kioptrix5. In this writeup i’ll demonstrate to you how to get root on kioptrix1.

Methodology

  • Network Scanning
  • Enumeration
  • Exploitation
  • Gaining root access

Tools:

  • nmap
  • enum4linux
  • nikto
  • searchsploit

So after deploying the vm, in vmware or vbox.., lets make an arp discover, cuz we need to know its IP.

Press enter or click to view image in full size
IP = 192.168.254.137

can’t see the IP? or have any problems related to the VM(not being able to put it in nat)?, see the link below.

Okay, now we have the IP, lets make an nmap scan

nmap -sV -sC -v -T4 $IP -oN nmap.results

Press enter or click to view image in full size
Press enter or click to view image in full size

The scan shows up some open ports [22,80,111,139,443,1024]

We see that we have the smb port opened, let’s run enum4linux

enum4linux -a $IP

Press enter or click to view image in full size

But nothing helpful honestly.

So let’s visit the webpage(port 80)

Press enter or click to view image in full size

Looks like a default apache webpage.

Get Jawher Mastour’s stories in your inbox

Join Medium for free to get updates from this writer.

Let’s run nikto(which is a web vulnerability scanner)

Press enter or click to view image in full size

The output tells us that the web server has a vulnerability in mod_ssl/2.8.4 AKA “openfuck”

So let’s use searchsploit:

Press enter or click to view image in full size

And here we find some exploits for this version.

so let’s move the exploit to our cwd.

Press enter or click to view image in full size

Then we need to compile the .c file:(i’ll name it exploit)

gcc -o exploit 47080.c -lcrypto

but before running it, we need to specify some parameters:(you can open the exploit’s file to know the code for your target, for us its 0x6b,0x6a will not work)

Press enter or click to view image in full size

And we got our shell !

Privilege escalation:

let’s see what is the kernel version:

uname -a

Press enter or click to view image in full size

2.4.7–10

After searching for a vulnerability for that kernel version, i foud this in exploitdb: https://www.exploit-db.com/exploits/3

Press enter or click to view image in full size

after downloading this exploit, we need to transfer it to our “victim” machine, for this i used python http server,

Attacker:

Press enter or click to view image in full size

Victim:

Press enter or click to view image in full size

Then we need to compile it ,and execute it

Press enter or click to view image in full size

And we’re root !

https://superuser.com/questions/1559882/vmware-player-doesnt-start-with-nat

--

--

Written by Jawher Mastour

Senior SOC Analyst | CEH | BTL 1 | EJPT | RHCSA | CCNA | AWS CCP | 6x MTA