Agent Sudo

Date: 15, June, 2021

Author: Dhilip Sanjay S


Click Herearrow-up-right to go to the TryHackMe room.

Enumerate

How many open ports?

  • Answer: 3

  • Steps to Reproduce:

    • Run nmap scan:

$ nmap -sC -sV -p- -oN nmap.out 10.10.124.244
Nmap scan report for 10.10.124.244
Host is up (0.20s latency).
Not shown: 65532 closed ports
PORT   STATE SERVICE VERSION
21/tcp open  ftp     vsftpd 3.0.3
22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   2048 ef:1f:5d:04:d4:77:95:06:60:72:ec:f0:58:f2:cc:07 (RSA)
|   256 5e:02:d1:9a:c4:e7:43:06:62:c1:9e:25:84:8a:e7:ea (ECDSA)
|_  256 2d:00:5c:b9:fd:a8:c8:d8:80:e3:92:4f:8b:4f:18:e2 (ED25519)
80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))
|_http-server-header: Apache/2.4.29 (Ubuntu)
|_http-title: Annoucement
Service Info: OSs: Unix, Linux; CPE: cpe:/o:linux:linux_kernel

Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
# Nmap done at Tue Jun 15 14:21:00 2021 -- 1 IP address (1 host up) scanned in 432.82 seconds

How you redirect yourself to a secret page?

  • Answer: user-agent

Agent Sudo

What is the agent name?

  • Answer: chris

  • Steps to Reproduce:

    • Use curl with the following options

      • A - User agent (The value of user agent must be C as mentioned in the Hint)

      • L - Follow redirects


Hash cracking and brute-force

FTP password

  • Answer: crystal

  • Steps to Reproduce:

  • Use nmap or hydra:

  • Download all the files accessible via FTP:

  • Contents of Text file:

Zip file password

  • Answer: alien

  • Steps to Reproduce:

  • Using stegoveritas on cutie.png:

  • Crack the password using john:

steg password

  • Answer: Area51

  • Steps to Reproduce:

  • Extract the zip file using the cracked password:

  • Contents of To_agentR.txt:

  • Base64 Decoding to get the password:

Who is the other agent (in full name)?

  • Answer: James

  • Steps to Reproduce:

    • Use the passphrase to extract the contents from cute-alient.jpg using steg-hide:

SSH password

  • Answer: hackerrules!


Capture the user flag

What is the user flag?

  • Login using ssh to find the user flag:

What is the incident of the photo called?


Privilege escalation

CVE number for the escalation

  • Google this (ALL, !root) /bin/bash

  • Confirm that the sudo version is exploitable: (Sudo version before 1.8.28)

What is the root flag?

  • Exploit the sudo vulnerability using sudo -u#-1 /bin/bash or sudo -u#4294967295 /bin/bash

Who is Agent R?

  • Answer: DesKel


References

Last updated