Sniper
Last updated
Last updated
Sniper is a medium difficulty windows box that has web based exploits
We start off scanning Snipers IP 10.10.10.151
with nmap
From Our Results we get the following services and ports
Here we find port 80 is open, which means it must be hosting a website, upon navigating to 10.10.10.151:80
we find exactly that
for the most part we find nothing exceptionally interesting except.. a particular url http://10.10.10.151/blog/?lang=blog-en.php
the ?lang=
indicates that it may be vulnerable to RFI
attacks but we have no way of getting a shell? Let's take a look at our nmap scan again, it seems SMB is also open, we can usue this to access a SMB Share of ours.
For the sake of anonymous access we'll have to make some changes to our SMB Config, we can find it at /etc/samba/smb.conf
at the end of the file we'll have to add
Also due note that the smb
folder has the correct permissions
For these changes to take effect we'll have to restart the smb service we can do this with service smbd restart
Windows doesn't natively come with netcat
due to this we'll have to download it and host it ourselves we can get it from here https://eternallybored.org/misc/netcat/ and place it in our smb share folder
once we have this, we should start a local netcat
listener this can be done with
perfect we are ready to connect back to our machine from the target, now to trigger our RFI
vulnerability
once our session is up and running we can go around looking for ways to escalate privileges to a user shell. Looking into C:/Users/
we find a user called Chris
since we have a site up we should check its host directory which in this case is C:/inetpub/wwwroot
under this we find a directory called user and under it db.php
in this we find a db connection with a password in clear text that being 36mEAhz/B8xQ~2VM
we can safely assume that this is the user credentials.
Now we have user Creds, its time to login as user
We can locally escalate user via the credentials we have and execute our payload to do this on powershell we'll
Huge thanks to @3r3bu5 for this tip
Now that we have Chris we can get our first flag
Now that we have user we can dig around for root.
exploring C:/
reveals a directory called Docs
opening it gives us 2 files
getting the output of note.txt
shows us
Yikes! looks like the CEO isn't to happy with us.
Let's continue Digging around. Checking the Downloads directory for Chris shows us a instructions.chm
looks interesting lets swipe it and have a look
we can use certutil
to encode the file in base64 and make it much easier to transfer for that we'll use
and to transfer it we'll use netcat yet again
now we can head over to windows to decode our instructions.chm
Yikes definetely a lot of bad blood here.
Fortunately it gives us a hint, going back to the CEO's note he noted that he was waiting for the documentation. Given Chris created this it stands to reason that the documentation was a .chm
Googling around we find that we can exploit chm!
Going back to windows we have to create CHM via html help workshop
Once we have the workshop setup we need to create a new project in it. Once we've done that we need to create a html file which will have our payload which is
And edit the .hhp
to include our malicious html
and compile, once you have your chm
we can transfer it over to our victim. To do this we'll use SimpleHTTPServer
Great but now how do we get root? Well the CEO did also say to "drop it here" so lets copy our malicious chm
to C:\Docs
and hope for the best
And voila after a minute we should be having our root flag in C:/Temp
or a session if you wanted it to be so.