Information
Room
- Name: The Cod Caper
- Profile: tryhackme.com
- Difficulty: Easy
- Description: A guided room taking you through infiltrating and exploiting a Linux system.
Write-up
Overview
Install tools used in this WU on BlackArch Linux:
Network Enumeration
Service discovery scan with nmap:
Web enumeration
There is the default page of Apache httpd, let's see is there is an app deployed
behind this.
Web exploitation
The login form seems SQL injectable:
We now have access to a page (/2591c98b70119fe624898b1e424b5e91.php
) with
a Run command form.
We can run cat /home/pingu/.ssh/id_rsa
to dump pingu private SSH key:
Let's add it to authorized keys so we can connect over SSH:
Let's prepare the key it and connect:
But the server is still asking for pingu's password.
Now we can connect over SSH.
EoP
Let's find a binary with SUID.
The source code of the binary is given:
Let's write a python script using pwntools to exploit the BoF and the backup
of the shadow file:
/etc/shadow
is dumped:
Let's find the hash format code for JtR with haiti
and then crack the hashes: