Skip to content

Instantly share code, notes, and snippets.

@chopmann
Created June 18, 2014 12:19
Show Gist options
  • Save chopmann/34402d1851bc9d8830f2 to your computer and use it in GitHub Desktop.
Save chopmann/34402d1851bc9d8830f2 to your computer and use it in GitHub Desktop.
Keygen for a University Exercise
__author__ = 'sirmonkey'
import httplib
import re
addr = "m.andapp.de"
doc = "/br/ha4.php?mat="
conn = httplib.HTTPConnection(addr)
pattern = 'Antwort:(.+?)<'
for i in range(70349800, 70349819):
conn.request("GET", doc + str(i))
response = conn.getresponse()
result = re.search(pattern, response.read()).group(1)
test = (i - 7) % 73
print "mat = {} : Antwort = {} -> Test {}".format(i, result, test)
conn.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment