Serv Mon
Serv Mon
Status Completed
Nmap Scan
ServMon 1
49669/tcp open unknown
49670/tcp open unknown
As we can see that there’s port 80 open possibly having a webpage which we will
check out first
ServMon 2
Seems to be a login portal of some sort, Default credentials like admin:admin didn’t
work, nothing much to do here
Next we can check for shares
Not able to get any shares, since there’s a website we can try directory brute-
forcing
ServMon 3
[~/HTB/ServMon] - hak101> dirsearch -u http://10.10.10.184 -x 404
We were able to anonymously login to ftp, and we can see a file named
confidential.txt in the Nadine folder, so we can download it
ServMon 4
Looking in the other user directory we can see a file named 'Notes to do.txt’ in the
use Nathan
Next let’s look at the burp response for the login request
We can see that it gives a customized error code, we could probably search for
exploits as the software is nvms-1000 shown in page tab itself
ServMon 5
There’s two results for software, and both are directory traversal, which leads us
to the next path for exploiting
We can confirm the attack by modifying the header with directory traversal
payloads like:
We can also check out the other webserver running in port 8443
https://10.10.10.184:8443
Visiting the website doesn’t give us much, but we get to know the software its
running NSClient
ServMon 6
Note: This website is quite messed up and annoying
searchsploit NSClient
Searching online for exploits we can see that those are mostly privilege exploits
and we need to find some credentials for the privilege escalation
We have to do more directory traversal for , and we also have a clue from the text
file we got earlier in the ftp login, that Password.txt was left in the desktop folder
this message was sent by Nadine and there’s only 2 users, so we need to check
Nathans Desktop directory
/../../../../../../../../../../../../users/nathan/desktop/passwords.txt
We get a bunch of passwords, we can save them to the list and check we can get
a possible authentication
ServMon 7
Once saved we can use netexec to password spray to check for authentication
Nadine:L1k3B1gBut7s@W0rk
We get access
ServMon 8
User Flag
Now that we got the initials access we can do Priv esc with the exploit that we
found earlier, searching the box up a little more we can see more credentials for
the web page in the C:\Program Files\NSClient++ directory
ew2x6SsGTxjRwXOT
But to access the web server we need to access from the internal network of the
box, to do that we will connect using a tool called sshpass
ServMon 9
And this time we are able to access the web page by going to https://127.0.0.1:8443/
And it worked!
ServMon 10
Now we need to have 2 files for the privilege escalation exploit, 1. is the nc64.exe
which can be downloaded, 2. Also we need to create a shell.bat file to execute the
nc64.exe
shell.bat:
On the server
Once executed we can see that the files have been uploaded successfully
Then we can head to Settings > external scripts > scripts, and then “+Add new” in
the web page
ServMon 11
We can add a command then specify the path to our script, we will use df for
default, then for key we will mention command and then in value the path to out
bat script
ServMon 12
Once we click on add we can see that its been added, next we can create a
schedule for this script by going in the scheduler > schedules and do the following
configurations
Now lets click on add, then with the edit functions we can change some this like
seen before
ServMon 13
Add again then go to the Control tab and reload, before u do this set up the
reverse shell listener
It just keeps loading for a long time with no output, we have to try a different
approach, we can try to use some exploit from github like
https://github.com/xtizi/NSClient-0.5.2.35---Privilege-Escalation
Netcat listener:
ServMon 14
[~/HTB/ServMon] - hak101> nc -nvlp 443
listening on [any] 443 ...
Root Flag
C:\Users\Administrator\Desktop>type root.txt
type root.txt
0d5661e73bb694415f4b991e94a7****
ServMon 15