Road to Pentest – INE Lab – Black Box 3

Lab Intro

  • You have been engaged in a Black-box Penetration Test ( range). Your goal is to read the flag file on each machine. On some of them, you will be required to exploit a remote code execution vulnerability in order to read the flag.
  • Some machines are exploitable instantly but some might require exploiting other ones first. Enumerate every compromised machine to identify valuable information, that will help you proceed further into the environment.
  • If you are stuck on one of the machines, don't overthink and start pentesting another one.
  • When you read the flag file, you can be sure that the machine was successfully compromised. But keep your eyes open - apart from the flag, other useful information may be present on the system.


I'm on a network.

Weird... It is said to be a network.

Right, the routing handles that for me.

Scan for live hosts.

Tow hosts are alive.

Confirmed by nmap.



Found two ports opening.

Search exploits for proftp. All of them are local. Not helping.


The user is ftpuser. Search if proftpd has default password.

Proftp allows anonymous login. But I need an email address for the password.

Try ftpuser:ftpuser. I logged in.

There's the flag.

Download it.


Check the website.

Default apache page, nothing interesting in the source.


Gobuster it. Found this /xyz directory.

Browse to it. I got.

Another ifconfig result like the one from last target.

It reveals the same network,

Time to get our reverse shell. I should be able to upload php files to xyz dir and execute.

Execute it.

Got a shell.

Running ifconfig I can see the same result from the web site.

Upload to enumerate the system.

NOOO! The owner of file uploaded by ftpuser is root... Have to download using the shell.

Set up python host.

Change dir to /dev/shm and download

Run it. I'll take my time and read through the result.

Seems the target's port 631 is opened. Don't know what it's for yet.

Seems like our ftpuser is in fact root. It has uid of 0.

Try su ftpuser, password is ftpuser.


Move to the next target.



The site is empty.

But the source code contains some ifconfig result.

There is another network that this target is connecting to. Have to pivot to

Add a routing entry to that network.

sudo route add

Now, with the first target compromised. I know that the two machines are both in this network.

The IP address of this machine is

I run again as root on the last machine. Discovered that nmap is present.

Use nmap to scan this target. Port  80 and 22 are discovered instantly.

Now, because the target has no ssh server running, I cannot use ssh to proxy traffic to the network. And since the target has no internet connection, I have no option but to use meterpreter route, which also means the rest of the exploit can be done by metasploit.


Generate php reverse shell using msfvenom.


Set up handler.


Got meterpreter shell.

Add route.

The last part is brute force the ssh login.

Got it.

And the flag.