Virtual Labs

Computer Science and Engineering > Computer Networks Lab > Experiments

Brute Force Attack on Login Page


Theory

1. What is a Brute Force Attack?

A brute force attack is a trial-and-error method used to decode login credentials, encryption keys, or hidden web pages. The attacker systematically tries all possible combinations of usernames and passwords until the correct one is found. Unlike more sophisticated attacks that exploit specific vulnerabilities, brute force relies on sheer computational power and persistence.

In the context of web applications, an attacker sends repeated login requests to the server, each time with a different set of credentials from a wordlist. By analyzing the server's HTTP response — specifically the status codes and response body — the attacker can determine whether a given username or password is valid.

2. HTTP Response Status Codes

HTTP status codes are three-digit numbers returned by the server in response to a client's request. They indicate whether the request was successful, redirected, or resulted in an error. In a vulnerable application, different status codes may be returned for different authentication outcomes:

The variation in status codes across different inputs is what makes the application vulnerable to enumeration. An attacker can determine whether a username exists simply by observing which requests return a different status code.

3. Burp Suite and the Intruder Tool

Burp Suite is a widely used web application security testing platform. It acts as a proxy between the browser and the target server, allowing the tester to intercept, inspect, and modify HTTP requests and responses. The key components used in this experiment are:

4. Attack Methodology

The brute force attack on a login page typically follows these phases:

5. Prevention Techniques

To protect web applications against brute force attacks, the following countermeasures should be implemented: