MoneyHeist:1 - Walkthrough [Vulnhub]

Here's my solution for MoneyHeist:1.
The machine can be downloaded from here.

Port Scanning
Using nmap to scan all TCP ports.
nmap -sC -sV -p- 192.168.1.104




We find 5 ports open.

Enumeration
Browsing the web.


We see we have an option to register.

After registering we login.

The page says- No flag and only the admins will get it. We can guess this can be related with user id, user role, cookies etc.

We start the Inspect Element and navigate to Storage Tab > Cookies.
Interesting, here we find the presence of JWT tokens in cookies. Lets decode it.



We browse the website JWT and decode the value.


We find the token uses HS256 algorithm.

Now we put the key into a file and run hashcat against it.
$ hashcat -m 16500 key.hash /usr/share/wordlists/rockyou.txt




We get the secret key as- professor.

We again browse the JWT website and try to create a forge token. We place the secret key in the Verify Signature section and alter the email's value to- admin.


 
Now we copy this forged token and replace it with the original one.



We refresh the page and we see the credentials.



Initial Access
Accessing SSH.
$ ssh berlin@192.168.1.104
Password: conversation_between_berlin_and_nairobi



Flag 1
We find the flag under berlin's home directory.



Privilege Escalation
From berlin > professor
We find a file- passwd.txt which contains the password for the user- professor



Switching to professor.
$ su professor
Password: st@y_tuned_for_@another_one



We check for SUDO rights.



Lets escalate to root.



Flag 2



Flag 3



Final flag



Other Walkthroughs

Comments

Popular posts from this blog

Sunset:Noontide - Walkthrough [Vulnhub]

CyberSploit:2 - Walkthrough [Vulnhub]

BBS(cute):1.0.1 - Walkthrough [Vulnhub]