Team
Last updated
Last updated
Before starting add team.thm into /etc/hosts.
For FTP on port 21 anonymous login is not allowed.
Moving onto port 80 the root page reveals the following:
After further enumeration we are unable to identify anything too interesting. /Robots.txt contains the entry 'dale' which I tried against Hydra for SSH and FTP with no luck.
Fuzzing for subdomains with wfuzz revelas the 'dev' sub domain.
This was added to the hosts files in /etc/hosts:
Browsing to the subdomain reveals the following:
Progressing with the placeholder link takes us to the following URL:http://dev.team.thm/script.php?page=teamshare.php.
Testing for LFI proves successfulon /etc/passwd. I used wfuzz to further enumerate LFI.
Checking the following below reveals a SSH key for the user Dale.
Copy the key to the attacking machine and use chmod
to set the correct permissions.
Ensure a space is present underneath the line '-----END OPENSSH PRIVATE KEY-----' otherwise the key will be marked as invalid when connecting to SSH.
Checking sudo -l
we are able to run /home/gyles/admin_checks
as the user gyles without a password.
Reading the file with cat
shows that the script will prompt us for input for the name of ther person backing up the data and the date.
When running the script I was able to escape it by entering '/bin/bash
'. As per below we now have shell as gyles.
Upgrade our shell to something nice to use:
From here with some manual enumeraiton we find a file called script.sh in the /opt/ directory.
As per the comments in the script this has been set to run by cron every minute. I was able to delete the file which means we can replace it with a reverse shell.
The following commands was then run to echo in a reverse shell.
I then started a netcat
listener on my attacking machine and soon enough gained a shell as root.