Kioptrix 1.1

by David Odza — on

cover-image

This is a walk-through of CTF challenge Kioptrix 1.1. I downloaded the target VM image from vulhub and booted it in VMware. My source machine is a Kali Linux image, also running on VMware.

All my engagements start with netdiscover, which is why I scripted a smarter version I call netDiscoverVM. This shows the IP address of our target machine (192.168.226.134).

The next step is to do some scanning. Sparta has a nice interface for nmap and nikto scans (when applicable).

This is SPARTA

The webpage on port 80 has a login screen. Often during an engagement, I find myself trying to SQL inject my way through a login screen. I wrote a SQLi script to automate this process.

SQLiLogin.PNG

My script is successful, when Username && Password == admin’ # -> We are granted access.

ping.PNG

First I try getting a reverse shell with netcat. I use both methods below to account for ingress and egress filtering. Neither work.

shovel.PNG

reverse and shovel.PNG

reverse.PNG

From here I check out the Reverse Shell Cheat Sheet, I begin from the top with the BASH revere shell.

BASH SHELL.PNG

Now that I have a limited shell, I do some investigation. Let’s get some system information:

uname.PNG

Lets see what we can execute as root:

exec.PNG

I decide to search for Linux 2.6.9 exploits and come accross one in Exploit-DB https://www.exploit-db.com/exploits/9542/. I find it on github, change the URL to raw content, and download it on our target.

wget.PNG

Compiling and running this exploit grants root!

root.PNG

Comments