Sorcerer
Pg Practice Sorcerer writeup
Nmap
HTTP
We have HTTP running on ports 80,8080 and 7742. I set to work running feroxbuster
against all three ports before manually browsing to them.
Port 80 shows a page with only '404 not found' displayed. Port 8080 takes us to Apache Tomcat/7.04.
The link for the Manager App did not ask for authentication credentials like it normally does. It does provide us with a Access Denied page and also display the Tomcat default credentials of tomcat:s3cret
.
We can store these later and possibly run these credentials against nikto
or gobuster
to see if we can enumerate further directories if required.
Port 7742 takes us to the following logon page which contains no identifying information apart from the name 'SORCERER' in the browser tab.
Soon after feroxbuster
picks up the /zipfiles/ directory. On browsing to this we find the following files.
I downloaded the zip files which are not encrypted and browsed through each with the GUI. The max.zip folder contained the most interesting information.
The Tomcat files contains credentials for Tomcat.
We also have SSH
keys for Max.
I changed the permissions of the id_rsa file to 600 so we can use it for SSH.
Looking at the authorized keys files we can see that the file scp_wrapper.sh is being used as a force command when a user connecting to SSH
.
The contents of scp_wrapper.sh
This means when connect as the user max to SSH we can only execute commands that start with 'scp'. As SCP
runs over SSH
we can use use id_rsa file from Max to connect and overwrite the wrapper file with something more useful such as 'bash' instead of 'scp'.
I edited the scp_wrapper.sh file to include the command 'bash' and changed the error message for troubleshooting purposes.
I then moved Max's 'id_rsa' key into my SSH folder on /home/kali/.ssh/ in preperation for connecting to SCP.
Once completed connect by SCP and transfer over the wrapper file on our desktop.
We can then SSH in as max and will have a bash shell.
Upgrade the shell:
Straight away I uploaded linpeas.sh
after starting a Python SimpleHTTPServer
on my attacking machine and executed once downloaded.
Linpeas
soon picks up the SUID bit being set on /usr/sbin/start-stop-daemon.
A search on GTFObins shows we can spawn a root shell.
Exploit syntax:
Last updated