โฌ‡๏ธDownload - HTB

https://app.hackthebox.com/machines/Download

Path Traversal

by just using encoded ../ to url ,you will be able to bypass the filter and get Path Traversal ,but its restrectid to only webapp root directory which is 'app' in this case as is the running on express node.js web application.

../../../app .. this respond means path exist
../../../../mount ,this respond tell you mount dir doesnt exist
download app.js

get the secret key ,and start forging your tokens

as we can see we have two cookies ,token and its signature

we use the same token header to forge our own modified token

forged my token for user id=1

We can see that it was uploaded by Wesley, who has the user ID 1. Now we have two options: we can attempt to brute-force Wesley's SSH password using Hydra, or we can extract the MD5 hash of the user password through a NoSQL attack by targeting the password field.

#AFK-PATH

using rockyou wordlist but thats gonna take somuch time

#Hardcore PATH

we can modify our token using contains to confirm if the md5 hash password contain "f" char

if you are able to see the user uploaded file ,that's mean its positive and the hash contains f char within it.

Now we try the "x" char which is not exist in the hash and lets check the respond

Now we are able to use 'startsWith' statment to dumb the full hash from beginning to end ,MD5 hash contains 32 char ,so we need to bruteforce 32 char ,this is too much work and scripting this is a must ,so i made a simple bash script inspired from this glue wrapper code

i have spent much time writing and testing the code ,and improving it and finally got this

Last updated