cyber enthusiast

SecTalks: BNE0x03 – Simple

Simple CTF

Simple CTF is a boot2root that focuses on the basics of web based hacking. Once you load the VM, treat it as a machine you can see on the network, i.e. you don’t have physical access to this machine. Therefore, tricks like editing the VM’s BIOS or Grub configuration are not allowed. Only remote attacks are permitted. /root/flag.txt is your ultimate goal.

I suggest you use VirtualBox or VMWare Player with a Host Only adapter. The VM will assign itself an IP address through DHCP.

Hints
Get a user shell by uploading a reverse shell and executing it.
A proxy may help you to upload the file you want, rather than the file that the server expects.
There are 3 known privesc exploits that work. Some people have had trouble executing one of them unless it was over a reverse shell using a netcat listener.

Contact @RobertWinkel for more hints.

Let’s get started.

Enumeration

nmap -p- -sV 192.168.2.15

It seems there is a web server running on port 80.
Let’s check it out.

So the site is running on CuteNews 2.0.3. Would there be a security issue with this piece of software? Yes there is. Looks like there is a possibility for a ‘Arbitrary File Upload’.

First step is to register an account and log in.
Then to change the personal settings and change the avatar with……..a shell.php!
Courtesy of pentestmonkey.
Third step is to start a terminal and start listening on the port you configured in the reverse shell code.

nc -lvnp 31337

Fourth and final step is to find the uploaded file and click on it. It can be found on ‘/uploads/’.

We got a limited shell. Let’s try to break out of this box.
First let’s get a proper shell.

python -c ‘import pty;pty.spawn(“/bin/bash”)’

root

To get root, I first need to know what is running.

lsb_release -a

So it’s running on Ubuntu 14.04. That’s nice. So let’s get the kernel version.