Sitemap
Pradithareddy

Pradithareddy

TwoMillion — Easy Level Linux based Machine Writeup

5 min readNov 21, 2025

This write-up covers my full exploitation of the 2million HTB machine, starting from basic enumeration and digging through obfuscated JavaScript, to exploiting a flawed API with Burp Suite for admin access. From there, I move into command injection, credential discovery via .env, SSH access, and finally rooting the box using an OverlayFS vulnerability. It’s a quick but detailed walkthrough of the exact steps and thinking that led to the compromise.

Press enter or click to view image in full size

Tools Used:

· Nmap

· BurpSuite

I started with a NMAP Scan to detect any open ports:

Press enter or click to view image in full size

The page wouldn’t load. A quick DNS resolution solved it:

echo”10.10.11.221 2million.htb” | sudo tee -a /etc/hosts

Once the page opened, I examined the site and found a suspicious link.

Press enter or click to view image in full size

2million.htb/invite:

Press enter or click to view image in full size

Checking the source code, something interesting popped up inside a JavaScript file:

Press enter or click to view image in full size

The script looked obfuscated, one giant unreadable line. So I grabbed it from js/inviteapi.min.js.I copied the code into ChatGPT and asked for a deobfuscated version, which thankfully came back clean enough to understand.

Press enter or click to view image in full size

I executed a curl command to get this into my machine:

Press enter or click to view image in full size

Then, I decrypted the code using base64 command:

echo ‘UzhKVzAtOEpYWk0tQzlER1QtS1VXUEw=’ | base64 -d

Press enter or click to view image in full size

I pasted the decoded part into the invite page, logged in using fake credentials, and landed on the home page. After exploring the site, I eventually found an “Access” page where VPN keys were generated.

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

Time to bring in Burp Suite!

I intercepted the request responsible for generating the VPN, and after poking around with repeater, I noticed something big:

Press enter or click to view image in full size

So, I modified the address to v1 (version 1):

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

I just need to change “is_admin”: 1 and I can enter as admin.

Get Pradithareddy’s stories in your inbox

Join Medium for free to get updates from this writer.

I’ll try getting in as an admin using the PUT method I got:

Press enter or click to view image in full size

“Invalid content type”. Alright, so the issue was not the field but the format.

Before modifying the request, I needed to figure out the correct Content-Type header it expected. In Burp Suite, I right-clicked on the request and selected “Change request method.” Doing this twice switched it over to a POST request, which conveniently revealed the Content-Type header that wasn’t visible earlier.

Now, since the response shows the Content-Type as application/json, I need to match that on the request side as well. After updating the header, switch the request method back to PUT, because the server won’t accept the admin change when using POST.

Press enter or click to view image in full size

“missing parameter: email”, So I’ll add the parameter and the ‘is_admin:’ 1 too:

Press enter or click to view image in full size

Got the admin id! Now that I had admin privileges, I intercepted another VPN-related request, sent it to repeater, and verified the authentication:

Press enter or click to view image in full size

Authenticated as admin! Now let’s check other methods of admin. The one left is generate vpn. Let’s try this:

Press enter or click to view image in full size

Let’s change that:

Press enter or click to view image in full size

Didn’t return anything useful. So, let’s try command injection. Since we already had an ID parameter, I replaced it with something like:

Press enter or click to view image in full size

Yup it worked!

I now had command execution on the machine.

ls shows the list of files here.

Ls -la contained .env file so let’s check that out:

Press enter or click to view image in full size

I found a credential sitting there in plain text.

Now we can do ssh and get into the machine as admin:

Ssh admin@2million.htb or ssh admin@10.10.11.221

Password: SuperDuperPass123

LET’S GOOO!!!

I tried running linpeas, but the machine didn’t support it. So let’s try another way:

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

According to the mail, it got something to do with overlay-cve. A quick search brought me to a GitHub PoC:

https://github.com/DataDog/security-labs-pocs/blob/main/proof-of-concept-exploits/overlayfs-cve-2023-0386/poc.c

copied that and saved it as poc.c

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

So this was 2million! Thanks for reading.

--

--