Created
November 1, 2020 19:47
-
-
Save DragonDev1906/dfa3858565cd2f1213552c86dea90392 to your computer and use it in GitHub Desktop.
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 | |
| from hashlib import sha256 | |
| def find_between(start, end): | |
| params = { | |
| "secid[$gt]": start, | |
| "secid[$lt]": end, | |
| } | |
| res = requests.get("http://chal.cybersecurityrumble.de:37585/secret_share", params=params) | |
| if res.status_code == 404: | |
| return | |
| secret = res.content[2129:-154] | |
| if len(secret) == 0: | |
| # Prevent misfunction | |
| return | |
| print(start, end, secret) | |
| if b"csr" in secret.lower(): | |
| print("potential flag, waiting for user input") | |
| input() | |
| h = sha256(secret).hexdigest() | |
| if h < start or h > end: | |
| print("WARNING: Hash is not in tange:") | |
| print("Secret: ", secret) | |
| print("Hash: ", h) | |
| input() | |
| return | |
| find_between(start, h) | |
| find_between(h, end) | |
| find_between('0'*64, 'f'*64) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment