I needed to test how Hydra works, so I tried to attack my own wifi router. I set the user name as "user" and created a txt file containing 100 passwords including the "real" password.

I am unable to read the log in of the http request that contains the ^USER^ and ^PASS^ because it uses a hashing method and passes the request as an encoded string.

Here, is what I found:


Here is a screenshot; enter image description here

And I inspected main.js file of that website, and realized that there are some hashing methods used;

if(g_password_type == '4') {
psd = base64encode(SHA256(name + base64encode(SHA256($('#password').val())) + g_requestVerificationToken[0]));
} else {
psd = base64encode($('#password').val());

In such a case, how can we bruteforce the username and password?

Is there a way in hydra to point out "this" is the password field and "this" is the username text and test when "this" log in button is pressed?


As the code clearly indicates, the name, password, and verification token are hashed together before being sent over the network. So, no, you cannot figure out which is which just from the network data alone.

Hydra is not the tool that is going to work for you here. You need to come up with a way of sending psd with all that data formatted in the expected way (combined, hashed, and encoded).

| improve this answer | |
  • If hydra not works here, how should I start? – Tharindu Sathischandra Jun 11 '18 at 12:44
  • You will need to create a script that does hydra's work for you and send the data in the way that the server expects. – schroeder Jun 11 '18 at 12:46
  • Actually I don't have any understanding about how should I create such a script. What field I should learn to accomplish my task. Can you suggest me how should I start? – Tharindu Sathischandra Jun 11 '18 at 12:48
  • The javascript code tells you exactly what to do - you just need to replicate that in your script and feed it a list of usernames and passwords. – schroeder Jun 11 '18 at 12:49
  • Can I use my own code and send the website data as we sends in normal GUI. – Tharindu Sathischandra Jun 11 '18 at 12:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.