unnamed

OS Sun – TryHackMe Walkthrough – Private Room

Try Hack Me

Check connectivity, scan for open services, and access FTP to download a file. Crack the hash for credentials, log in via SSH, exploit a vulnerable service to escalate privileges, and retrieve the root flag.


https://tryhackme.com/jr/ossun

Step 1: Start the Machine

  • Start the target machine.
  • Ensure both your machine and the target machine are on the same network.
Screenshot 2025 01 15 20 28 40
Screenshot 2025 01 15 20 29 05

Step 2: Verify Network Connectivity

  1. Find the target machine’s IP address.
  2. Ping the target machine to check if it is live.
Screenshot 2025 01 15 20 31 22

Step 3: Perform an Nmap Scan

  • Scan the target machine to identify open services and their versions.
  • Note the open services. In this scenario, FTP (port 21) and SSH (port 22) are open.
Screenshot 2025 01 15 20 31 57

Step 4: Check FTP Anonymous Login

  1. Test if anonymous login is allowed on the FTP server.
  2. If successful, browse the FTP directory to find files of interest.
Screenshot 2025 01 15 20 32 08

Step 5: Download the File from FTP

  • Locate and download the file named backup.
  • Exit the FTP session once the file is downloaded.

Step 6: Open and Organize the File

  • Open the backup file and examine its content.
  • Organize the data as needed to prepare it for hash cracking.
Screenshot 2025 01 15 20 32 24

Step 7: Crack the Hash

  • Use a hash-cracking tool (e.g., John the Ripper) to crack the hash.
  • Retrieve the credentials:
    • Username: sunset
    • Password: cheer14
Screenshot 2025 01 15 20 32 29

Step 8: SSH into the Target Machine

  • Use the cracked credentials to log in to the target machine via SSH.
Screenshot 2025 01 15 20 32 39

Step 9: Explore the Machine

  • Check the directories and files to gather information or identify potential escalation paths.

Step 10: Check Sudo Privileges

  • Check what commands or services you can execute as root using sudo.
Screenshot 2025 01 15 20 32 48

Step 11: Privilege Escalation

  1. Identify a vulnerable service listed in the sudo permissions (e.g., ed).
  2. Use the GTFOBins website to find exploitation techniques for the identified service.
  3. Execute the commands to escalate privileges to root.
Screenshot 2025 01 15 20 32 53
Screenshot 2025 01 15 20 33 27
Screenshot 2025 01 15 20 33 35
Screenshot 2025 01 15 20 33 47

Step 12: Gain Root Access

  • Verify you have root privileges.
  • Navigate to the root directory to find and capture the root flag.
Screenshot 2025 01 15 20 33 53