OLinux
  • Home
  • Linux
  • Security
  • Network
  • Android
  • Web
OLinux
  • Home
  • Linux
  • Security
  • Network
  • Android
  • Web
OLinux
  • Home
  • Linux
  • Security
  • Network
  • Android
  • Web
Linux • Security

How to brute force login page – Brute force attack tutorial

4,014 Views
4 Min Read
Ajay Verma
Add Comment
4,014 Views
    Share This!
    FacebookTwitterPinterestLinkedIn

User authentication is essential for security of any web application. All the security parameters like captcha and limiting the login attempts should be set while constructing a user authentication system. If these parameters are not defined properly, the attacker can perform brute force attack on a login form and steal credentials. This guide will walk you through the process of brute forcing the login form step by step. So Fire up your Kali Linux and follow these steps to brute force login page.

Brute force login page

Getting the web form post parameters

In order to attack the web form first we need to get the web form’s login field post parameters and find out how login page responds to failed logins. Key parameters that we need to obtain are

  • IP Address of the website
  • URL
  • type of form
  • field containing the username
  • field containing the password
  • failure message

We can get these parameters by using Burp suite or Temper Data. You can open burpsuite by going to Applications -> Kali Linux -> Web Applications -> Web Application Proxies -> burpsuite.

For sake of this tutorial we will be attempting to crack the password on the Damn Vulnerable Web Application (DVWA). You can run it from the Metasploitable operating system and then connect to its web page.

Next we will attempt to get all these POST parameters from the login page form. We need to enable the Proxy and Intercept on the Burp Suite like shown below in the image.

Now we need to configure our browser to use the proxy settings. go to Edit -> Preferences -> Advanced -> Network -> Settings(in Firefox)

https://img.wonderhowto.com/img/95/31/63561584136862/0/hack-like-pro-crack-online-web-form-passwords-with-thc-hydra-burp-suite.w1456.jpg

Configure your browser to use localhost(127.0.0.1) as a proxy and use 8080 as a port.

 

Get the Bad Login Response

Now try to login with wrong username and password on a login page. Now the burpsuite will show us the key fields that we need to use in hydra to crack the password.

After obtaining the necessary info, forward the request from Burp Suite by hitting the “Forward” button on the far left . The DVWA returns a message that the “Login failed.”

Using hydra to brute force login page

Now we are going to use this collected information in hydra and try to crack the password. basic syntax structure for hydra is given below.

#hydra -L <username list> -p <password list> <IP Address> <form parameters><failed login message>

So based on the information that we got from burp suit analysis our command should look like this:

#hydra -L <wordlist> -P<password list> 192.168.1.101 http-post-form "/dvwa/login.php:username=^USER^&password=^PASS^&Login=Login:Login failed"

Wordlist

Last thing that we need is a wordlist to crack the password. You can scour the internet for wordlists, you will find wordlists that may be upto 100 GB. But Kali Linux also has inbuilt wordlists. You need to issue the following command in terminal to find  all of them.

#locate wordlist

For the sake of simplicity we will use the following wordlist.

/usr/share/dirb/wordlists/short.txt

Now, let’s build our Final command with all of these elements, as seen below.

#hydra -l admin -P /usr/share/dirb/wordlists/small.txt 192.168.1.101 http-post-form "/dvwa/login.php:username=^USER^&password=^PASS^&Login=Login:Login failed" -V

Since we used the –V switch, THC-Hydra will show us every attempt.  Next step is to get back and grab a cup of coffee while password is being cracked.

Also check out our list of hacking tools

Here is a list of some important Command Line argument used in hydra

  • -l indicates a single username (use -L for a username list)
  • -P indicates use the following password list
  • http-post-form indicates the type of form
  • /dvwa/login-php is the login page URL
  • username is the form field where the username is entered
  • ^USER^ tells Hydra to use the username or list in the field
  • password is the form field where the password is entered (it may be passwd, pass, etc.)
  • ^PASS^ tells Hydra to use the password list supplied
  • Login indicates to Hydra the login failed message
  • Login failed is the login failure message that the form returned
  • -V is for verbose output showing every attempt

If you have any doubts please let us know in the comments section.

TagsBrute Force attack Brute Force login form Computer Security cyber security Kali Linux pentesting apps pentesting tools

You may also like

Termux Hacking Tools

9 Must-Have Termux Hacking Tools for Ethical Hackers

4,363 Views
Disable SELinux on Centos

How to Disable SELinux on Centos 8

147 Views

Android Hacking Tools Megapack [18 Advance Suites]

1,113 Views
ubuntu games

Looking for Ubuntu games?

160 Views

Mastering Kali Linux Commands: A Comprehensive Guide

361 Views
vlc dlna

How to Stream Your Media with VLC DLNA

741 Views

About the author

View All Posts

Ajay Verma

A Computer Science Graduate, who works extensively on open source projects. His Areas Of interest are: Network Security, Linux Administration, FOSS, Python, and C programming.

Add Comment

Click here to post a comment

Cancel reply

The Swords of Ditto will “absolutely” be available for Linux on release day
Install all the Kali Linux tools on Ubuntu and Debian based system
Comment
    Share This!
    FacebookTwitterPinterestLinkedIn

Latest News

Termux Hacking Tools
Android • Linux • Security

9 Must-Have Termux Hacking Tools for Ethical Hackers

Disable SELinux on Centos
Linux • Security

How to Disable SELinux on Centos 8

Android • Network • Security

Android Hacking Tools Megapack [18 Advance Suites]

ubuntu games
Linux • Steam

Looking for Ubuntu games?

Linux • Network • Security

Mastering Kali Linux Commands: A Comprehensive Guide

Powered by Olinux.
  • Contact us
  • Privacy & Terms
  • About Us