Task 1: Recon
How many ports are open with a port number under 1000?
Command: nmap <target ip>
What is this machine vulnerable to? (Answer in the form of: ms??-???, ex: ms08–067)
Command: nmap — script vuln -p445 <target ip>
Task 2: Gain Access
Find the exploitation code we will run against the machine. What is the full path of the code? (Ex: exploit/……..)
Let’s examine the weakness in front of us and find the appropriate exploit
We found a suitable exploit
Show options and set the one required value. What is the name of this value? (All caps for submission)
Task 3: Escalate
If you haven’t already, background the previously gained shell (CTRL + Z). Research online how to convert a shell to meterpreter shell in metasploit. What is the name of the post module we will use? (Exact path, similar to the exploit we previously selected)
Select this (use MODULE_PATH). Show options, what option are we required to change?
Stop the process (ctrl+z) after exploiting. Find the answers to the questions with the necessary command.
Command for the first question: search shell_to
Command for the second question: show options
Task 4: Cracking
Within our elevated meterpreter shell, run the command ‘hashdump’. This will dump all of the passwords on the machine as long as we have the correct privileges to do so. What is the name of the non-default user?
Copy this password hash to a file and research how to crack it. What is the cracked password?
First, let’s mark the hash of the password.
Then break the password with the John tool.
Command: john — format=NT — wordlist=/usr/share/wordlists/rockyou.txt <file.txt>
Task 5: Find flags!
Flag1? This flag can be found at the system root.
To locate a file.
Command: search -f <filename>
Flag2? This flag can be found at the location where passwords are stored within Windows.
- Errata: Windows really doesn’t like the location of this flag and can occasionally delete it. It may be necessary in some cases to terminate/restart the machine and rerun the exploit to find this flag. This relatively rare, however, it can happen.
flag3? This flag can be found in an excellent location to loot. After all, Administrators usually have pretty interesting things saved.
Find and send the flags and complete the lab.