πŸ’»RootMe

A ctf for beginners, can you root me?

1. Reconnaissance

1.1 Nmap

Using nmap to scan for open ports and services

  • we find 2 open ports, 22 and 80 running ssh and web server respectively

2. Scanning

2.1 Gobuster

Using gobuster to brute-force directories in the web server.

  • We find two interesting directories /panel and /uploads

/panel

  • We find a page to upload files

/uploads

  • We can see and access the uploaded files here

3. Gaining Access

3.1 Reverse shell

Using the php reverse shell from pentest monkey (https://raw.githubusercontent.com/pentestmonkey/php-reverse-shell/master/php-reverse-shell.php)

  • We find that uploading any .php files gives us an error

  • Changing the extension of the script from .php to .php5 to bypass

  • Starting an nc listener on our attacking machine and executing the reverse shell by going to /uploads selecting our uploaded .php5 file

  • Stabilizing the shell and reading user.txt file

4. Privilege Escalation

4.1 SUID

  • Searching for exploitable processes with set SUID

  • We find that /usr/bin/python has SUID bit set.

  • Using the one liner from GTFOBins, we get root

  • Reading root.txt

Last updated