Kioptrix: Level 1.1 (#2)

Kioptrix VM image: https://www.vulnhub.com/entry/kioptrix-level-11-2,23/

Aim : To get to the root of the machine.

Difficulty Level : Easy

As always, we would start with the initial scan to see the open ports on the target machine. I have shifted from “nmap” to “rustscan” for this initial investigation.

rustscan -a 10.0.2.15 -u 5000
These ports are open on target machine.
Services running.

There is a web-server running on port 80. Also , we should do some vulnerability scan. This time I would use a new tool in my arsenal : “Owasp Zap” .

Owasp Zap is a wonderful tool !

In the alert section we can see:

Running an automated scan on the target ip , we see the machine is vulnerable to an SQL Injection attack. Going to the site in browser and trying the most basic form of SQL injection attack we get a successful login:

SQL Injection will be successful with above input

We get a box saying ping the machine, this turns out to be vulnerable to remote code execution/command injection .

So , my first aim here was to get a reverse shell on this machine, using pentest monkey reverse shell cheatsheet :

we will use port 4567 here , instead of 8080
We Got a reverse shell successfully, but with a low privilege

Our aim now is to escalate our privilege and get root. Let’s get some info about the system and OS version:

we got CentOS version and also Kernel version

We would now look for this exploit online. Luckily we got one with good reputation:

see the kernel and os version :))

So , our main aim here is to execute this piece of code on the target machine. I tried directly downloading this code on the victim machine through wget/curl, but it didn’t worked.

So we will spawn a server , and download on victim machine through that:

WE ARE ROOT. we have accomplished our mission here.

Topics/Command Covered:

i) wget/curl

ii)SQL Injection

iii) uname , cat /proc/version , cat /etc/*release

iv)file sharing with the help of python SimpleHTTPServer

v)Netcat

vi)privilege escalation

Design a site like this with WordPress.com
Get started