Skip to content

Instantly share code, notes, and snippets.

@jossef
Created March 15, 2016 14:49
Show Gist options
  • Select an option

  • Save jossef/690a1cb7d23a640e9222 to your computer and use it in GitHub Desktop.

Select an option

Save jossef/690a1cb7d23a640e9222 to your computer and use it in GitHub Desktop.
sears challenge http://hackthestack.io/unlock cracker
import requests
import sys
start = int(sys.argv[1])
end = int(sys.argv[2])
def get_combinations():
for n in range(start, end):
yield list(str(n).zfill(5))
def main():
for combination in get_combinations():
finished = False
while not finished:
try:
r = requests.post('http://hackthestack.io/unlock', json=combination)
r.raise_for_status()
print combination
if r.content:
print "SUCCESS!", combination
return
finished = True
except:
print "ERROR", combination
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment