We have multiple ports open , and it seems port 80 is running with an admin panel for a printer, we also got SMB opened , and we have an LDAP port opened , this is a really interesting box
First thing I do now is visit the port 80:
I visited the Settings which was in http://return.htb/settings.php
and found a subdomain : http://printer.return.local
so I now add that to my /etc/hosts
file
So we also got svc-printer
as username!
But basically these printer's configuration page allow a user to set a way of grabbing the queries of user list and passwords from the LDAP or AD port so , what if I made a listener of port 389 which is LDAP , and then I change the server address on the settings and see what will happen…:
So I got the password 1edFg43012!!
, And now I just use my sweet evil-winrm
to try gain an instance of shell from the creds I got:
Not much but useful, decided to check the group I was in, i hope I was in Administrators but it twisted wrong
So svc-printer
is part of Server Operators : https://docs.microsoft.com/en-us/windows/security/identity-protection/access-control/active-directory-security-groups#bkmk-serveroperators
So I now understood that it was easy for me to get a quick revshell as NT Authority/system
, I first set a reverse shell listener on port 1234, since members of this group are able to start and stop services now after firing up the listener , I will exploit the vss service running with sc.exe which is alternative of systemctl
in linux , but first things first , Upload NETCAT :
And now the good part is to misconfigure the service! that is about to run :
We start stop the service , if it's running with the command sc.exe stop vss
and then we start our service which will execute our netcat revshell:
And now we have access to Administrator account!
The user.txt
flag can be found in Desktop for svc-printer
and for root.txt
inside Desktop for Administrator