Starting with nmap to determine what ports are open and what services are running.
Full command and result of scanning:
Foothold
On port 80 we have a web page. We automatically logged in as user Nathan. There is some network monitoring functionality. One of the interesting pages is the dashboard with access to stored .pcap files.
As we can see on the screenshot above, there is the numerical parameter, which we can enumerate and try to access other .pcap files. To do that we resend the request to Burp Suite Intruder and mark out as payload position this parameter and as payload type use numbers.
There is the page with id equals 0. After accessing it via browser, we can download the .pcap file. During the examination of this file in Wireshark credentials for ftp were found.
Let’s try to log into ftp. Here we can see the user.txt file, so maybe we have read access to the home directory of Nathan.
User shell
As we have ssh running on port 22, we can try to reuse ftp credentials. Try was successful, and we receive ssh user shell.
Privilege escalation
During the usual post-enumeration routine, we check what capabilities binaries have, using the command getcap -r /, where -r flag tells getcap to search recursively, / to indicate that we want to search the whole system.
Here, python has the capability CAP_SETUID, which allows changing of the UID (set UID of root in your process).