Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from requests.auth import HTTPBasicAuth
- import requests
- webAddress = raw_input('Enter address to send auth to: ')
- print 'Enter username and password in the following format: \"username:password\"'
- while True:
- rawUserPass = raw_input('> ')
- splitUserPass = rawUserPass.split(':')
- username = splitUserPass[0]
- password = splitUserPass[1]
- r = requests.get(webAddress, auth=HTTPBasicAuth(username, password))
- if r.status_code == 401:
- print 'Username and Password rejected'
- elif r.status_code == 200:
- print 'HOLY FUCKING SHIT YOU GOT IT!!!'
- else:
- print 'Unknown error, look up HTTP status code ' + str(r.status_code) + ' for information on what happened...'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement