Cap
Last updated
Was this helpful?
Last updated
Was this helpful?
OS: Linux
Difficulty: Easy
Now we know that this site is used for network monitoring and that there is a user named Nathan.
Checking out "Security Snapshot"
This option redirects us to /data/1 where no traffic is logged. I changed it to /data/0 and here we see that there is some recorded traffic.
I clicked to download and got a file called 0.pcap so I opened it with wireshark.
In this file, we can see a lot of important information. We see that the user made http requests to the site. We see some TCP requests. But the main thing is that we see some FTP requests, where we can get Nathan's username and password on the FTP server.
Sorting the requests by protocol and navigating to the end of the file we find this information.
user: nathan
password: Buck3tH4TF0RM3!
We can download the user flag running
get user.txt
We can also use these credentials to log in in ssh.
ssh nathan@<box_ip>
password: Buck3tH4TF0RM3!
After some simple enumerations, I saw that the file /var/www/html/app.py had a line written "os.setuid(1000)". That led me to enumerate the binaries with capabilities to change their own uid to 0 (from root)
getcap -r / 2>/dev/null
We see that python3 is allowed to change its own uid. We can make a program that changes its uid and run a shell as root.
python3 -c 'import os;os.setuid(0);os.system("bash")'