Broken Vulnhub Walkthrough

Today we’re going to solve another boot2root challenge called Broken. This CTF Machine was available at VulnHub for penetration testing practice. and difficulty for this CTF intermediate Level. you can download it from Vulnhub.

Network Scanning

Let’s start with network Scanning finding our target Machine IP address using the netdiscover tool. you can use also Nmap to find target machine IP.

Broken Vulnhub Walkthrough

As we can see from the target machine IP address in the netdiscover output result, let’s run the nmap Aggressive scan for finding target machine Open ports and running services.

Broken Vulnhub Walkthrough

Now our network scanning is done nmap output gave us target machine 2 open ports, 22/SSH and 80/HTTP running apache httpd server.

Enumeration

I put the machine IP address in the browser and we get an html static web-page. I also check the page source code and robots.txt entries and try to open some common directory but no luck i didn’t found anything useful here.

Broken Vulnhub Walkthrough

After trying some basic enumeration tricks I can’t get anything useful, then I move to the next step I run the dirb ( directory brute-forcing tool ).

Broken Vulnhub Walkthrough

Our dirb scanning is completed and we discover lot’s for server directories let’s try to open by one and finding some useful stuff.

First, I open the/cms directory and this web page gives a Flag1 Defacement message. there is nothing useful.

Broken Vulnhub Walkthrough

i open the next URL /cms/cc/ and this page asking to us please specify the IP address and port, I started my localhost python Server on port 45 and fill my local machine IP in the first field and second field port number and then click the Hack button.

Broken Vulnhub Walkthrough

After click the hack button target machine getting a .sh file using the get method.

After trying some command injection tricks on the target server, but I didn’t make it, then I move to the next step trying something different, I create a python reverse shell and save it with the name of ( 99cb48b59e59d65fe4d1b2a625caecfa.sh ). and again start my python Server on port 45.

Before click on hack button i also start my net-cat listener on port 4545.

Now our netcat listener is ready to receive a remote reverse connection, again i move the browser where I open the target web page and here i write again my local machine IP address and port number and final click on Hack button.

And i get reverse shell connection target machine.

Broken Vulnhub Walkthrough

I ran the ls command for listing all directories and files, and here we can see all server files, I open the shell.sh file with help for cat command, and this is our python reverse shellcode previous I created for getting target machine reverse connection.

I start enumeration against the machine, and i found our first flag by moving on system directories.

After reading the author note.txt file, I move the script directory and here i found a log.py python file, and our current user have full permission of the script directory.

Again I move my local machine and created a python reverse shell payload and I download the reverse shell file on script directory with name log.py.

Now again I open my netcat listener on port 5555, and After 10 Seconds I get Alice user reverse connection. we can identify our current with help of the id command.

So now I have Alice’s user shell and I have permission of the Alice user every file and directory, I move the backup directory and here I found my third flag.

And again I get note.txt files, After reading the note I create a path.txt file and I enter /root directory location in this path.txt file.

According to the note, we need to wait until the bot did our work, After a moment I run the ls command and we can see a root directory, let’s move the root directory and read our final root flag.

If you want to root access this machine you need to move root/.ssh directory and copy the id_rsa key, and you can use the id_rsa key for login root ssh session.

y0usef Vulnhub Walkthrough