Skip to content

Instantly share code, notes, and snippets.

@DragonDev1906
Created November 1, 2020 19:47
Show Gist options
  • Select an option

  • Save DragonDev1906/dfa3858565cd2f1213552c86dea90392 to your computer and use it in GitHub Desktop.

Select an option

Save DragonDev1906/dfa3858565cd2f1213552c86dea90392 to your computer and use it in GitHub Desktop.
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