GamingServer
https://tryhackme.com/room/gamingserver
Task 1 Boot2Root
What is the user flag?
Let's begin by performing an nmap scan against the target.
$ nmap -sC -sV 10.10.223.2
Starting Nmap 7.92 ( https://nmap.org ) at 2023-12-16 09:38 IST
Nmap scan report for 10.10.223.2
Host is up (0.15s latency).
Not shown: 998 closed tcp ports (conn-refused)
PORT STATE SERVICE VERSION
22/tcp open ssh OpenSSH 7.6p1 Ubuntu 4ubuntu0.3 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey:
| 2048 34:0e:fe:06:12:67:3e:a4:eb:ab:7a:c4:81:6d:fe:a9 (RSA)
| 256 49:61:1e:f4:52:6e:7b:29:98:db:30:2d:16:ed:f4:8b (ECDSA)
|_ 256 b8:60:c4:5b:b7:b2:d0:23:a0:c7:56:59:5c:63:1e:c4 (ED25519)
80/tcp open http Apache httpd 2.4.29 ((Ubuntu))
|_http-title: House of danak
|_http-server-header: Apache/2.4.29 (Ubuntu)
Service Info: OS: Linux; CPE: cpe:/o:linux:linux_kernel
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 25.40 secondsThere are two open ports:
22
ssh
80
http
Let's visit the website through the browser.

Using CTRL+U we can view the source page.

So there is a user called john.
We can use gobuster to find other web pages that might be useful.
The /secret page seems interesting, let's go there.

Let's get the secretKey.

It seems to be the private key of the john user we saw before.
We can use ssh2john to create a hash file.
Now we can use john to crack the hashes.
Let's change the permissions of the secretKey.
Now we are all set to login through SSH as the john user.
We can now read the user flag.
Answer
What is the root flag?
Let's check what groups john is a part of.
On searching for a while we can find the following article that explains how to escalate the root privilege by exploiting the features of LXD.
Commands to be run on the attacker machine:
Commands to be run on the target machine:
We can now locate the root.txt file using the find command.
Let's get the root flag.
Answer
Last updated
Was this helpful?