DEV Community

Cover image for Bruteforcing Preview With Hydra
Ziad Alezzi
Ziad Alezzi

Posted on

Bruteforcing Preview With Hydra

What is Hydra?

Hydra is a quick system login password cracking tool.

Hydra can run through a list and "brute force" these authentications. Imagine manually testing a 1,000 common password list, it'd take alotta time. Hydra automates that for us.

What information do we need to collect for Hydra to work?

As a test, we start by turning on a proxy for Burp suite using FoxyProxy and adding Burp's Hostname and port.

foxy settings

We can see it turned on here

foxyproxy

Then, turning on Intercept in the Proxy tab on the Burp suite

burp

And after adding a random user & password, and submiting the form, we can tell that nothing happens on the login page. No failure, no success. And thats because our HTTP POST request got intercepted by Burp.

intercept

This is important to us since we need to understand what is the parameter names set by the site for the username and password, which we can see in the HTTP Request

Http

The username's parameter is "username", and the password's is "password".

This is important for hydra to know, as it needs to know how to formulate its POST Requests. But there's one more thing it needs to know, that is it's sign of failure.

So we will forward our bogus login request

forward

And turn intercept off so we can recieve the error from the login page.

error

"Your username or password is incorrect."
^
Hydra will look for this to verify each password it tests out.

Now we write our command

Opening up the terminal, here's the short command with all the info we gathered:

command

And shortly after running we get a match with the password of "sunshine"

match

Plugging it into the site, and we get our flag!

success

What about other authentication types?

Hydra isnt just for login pages. We used http-post-form in our previous command, but we can also use ssh for ssh brute forcing.

ssh

Using the username and password we captured, we can successfully ssh to that ip and successfully gain access.

ssh

And we found the flag!

flag

This Was Hydra

lucirie (Ziad Alezzi) ยท GitHub

lucirie has 35 repositories available. Follow their code on GitHub.

favicon github.com

Top comments (0)