Created
April 15, 2018 08:23
-
-
Save CreateRemoteThread/f2eb2ac31ffac7c20c3f4253ad4f429c to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/python | |
import hashlib | |
import requests | |
import random | |
import string | |
import json | |
import sys | |
# f = open(sys.argv[1]) | |
# data = [l.rstrip() for l in f.readlines()] | |
# f.close() | |
# currentSuffix = "rd" | |
def cpwpow(i): | |
while True: | |
rndstr = ''.join(random.choice("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890") for _ in range(10)) | |
h = hashlib.sha256(i + rndstr).hexdigest() | |
if h.endswith("66666"): | |
return (rndstr,h) | |
def checkForSuffix(inchar): | |
(d,h) = cpwpow(inchar) | |
r = requests.get("http://web.midnightsunctf.se:8000/login/" + inchar + "/" + d) | |
print r.text | |
if "suffix" in r.text: | |
return r.text | |
print checkForSuffix(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment