Created
March 15, 2016 14:49
-
-
Save jossef/690a1cb7d23a640e9222 to your computer and use it in GitHub Desktop.
sears challenge http://hackthestack.io/unlock cracker
This file contains hidden or 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 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