infosecfamily
← Back to catalog
TryHackMe  /  Hard

Uranium

Tested by: Testing performed by Nikolay Kravtsov, a novice information security specialist at 22:55 *(Awesome room, I advise everyone to go!)*.

Files used:

  • application - file for receiving reverse shell
  • hakanbeynetworklog.pcap - the file in which we received the password for chat with kral4
  • linpeas.sh - a Linux privilege escalation script.
  • nano - copied binary to kral4 home directory
  • index.html - modified file for social engineering of root
  • /etc/passwd - the file that we abused to obtain root rights.

    Procedure:

1) Editing /etc/resolv.conf for Internet access, creating a room folder, enabling win kex for convenience, enabling VPN for accessing rooms

1) sudo nano /etc/resolv.conf; clear; mkdir uran; cd uran; clear; kex --win; clear; sudo openvpn ../Kolya080808.ovpn 2) clear; sudo ./thm-troubleshoot; nmap -sCV 10.10.203.196; gobuster dir -w directory-list-2.3-medium.txt -b 404 -u http://uranium.thm

2) Scanning ports using nmap.

  • Results:
PORT   STATE SERVICE VERSION
22/tcp open  ssh     OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
|   2048 a1:3c:d7:e9:d0:85:40:33:d5:07:16:32:08:63:31:05 (RSA)
|   256 24:81:0c:3a:91:55:a0:65:9e:36:58:71:51:13:6c:34 (ECDSA)
|_  256 c2:94:2b:0d:8e:a9:53:f6:ef:34:db:f1:43:6c:c1:7e (ED25519)
25/tcp open  smtp    Postfix smtpd
|_smtp-commands: uranium, PIPELINING, SIZE 10240000, VRFY, ETRN, STARTTLS, ENHANCEDSTATUSCODES, 8BITMIME, DSN, SMTPUTF8
| ssl-date:
|_  ERROR: Unable to obtain data from the target
80/tcp open  http    Apache httpd 2.4.29 ((Ubuntu))
|_http-title: Uranium Coin
Service Info: Host:  uranium; OS: Linux; CPE: cpe:/o:linux:linux_kernel
Final times for host: srtt: 584243 rttvar: 4176  to: 600947

3) Launch Gobuster to search for directories.

  • Results:
===============================================================
Gobuster v3.6
by OJ Reeves (@TheColonial) & Christian Mehlmauer (@firefart)
===============================================================
[+] Url:                     http://uranium.thm
[+] Method:                  GET
[+] Threads:                 10
[+] Wordlist:                directory-list-2.3-medium.txt
[+] Negative Status codes:   404
[+] User Agent:              gobuster/3.6
[+] Timeout:                 10s
===============================================================
Starting gobuster in directory enumeration mode
===============================================================
/images               (Status: 301) [Size: 311] [--> http://uranium.thm/images/]
/assets               (Status: 301) [Size: 311] [--> http://uranium.thm/assets/]
Progress: 2197 / 220561 (1.00%)^C
[!] Keyboard interrupt detected, terminating.
Progress: 2197 / 220561 (1.00%)
===============================================================
Finished
===============================================================

4) First I looked at the web page and, unfortunately, I didn't find anything:

  • Result:

    5) So I tried to get a reverse shell using an email that I found on a Twitter page, because the description said something about phishing, and I got the first flag:

  • Result:

    6) Then I started searching for privilege escalation, and found the file in /var/log .pcap:

  • Result:

    7) Having found the password, I went to watch the chat with kral4:

  • Result:

    8) Having received the password, I logged into ssh and found an interesting thing. Then I changed the user and started looking for ways to get the web_flag (we don't have access to it) and the root flag:

  • Result: After analyzing the results, I found this.

    9) Using this thing we can read and change files. So after reading web_flag, I tried to read /etc/sudoers, but it didn't work:

  • Result:

    10) Then I continued the search, and found this:

  • Result:

    11) I changed the index.html file and copied the nano binary to myself so that root would give us root rights to execute it:

  • Result:

    12) Having received rights to execute ./nano from root, I decided to get full access to the machine, and changed /etc/passwd, and then changed the user to root and read /root/root.txt:

  • Result: hooray!

    Note

Note: Awesome room for training social engineering and phishing skills. I advise everyone to go! Many thanks to TryHackMe for the room!

Video walkthrough