Skip to content

Instantly share code, notes, and snippets.

@panchicore
Created March 15, 2016 15:25
Show Gist options
  • Save panchicore/2a8ac280e3c3086333ca to your computer and use it in GitHub Desktop.
Save panchicore/2a8ac280e3c3086333ca to your computer and use it in GitHub Desktop.
import base64
import requests
url = "http://foo.bar"
users = ["", "admin", "root"]
for u in users:
for uu in users:
login = '{0}:{1}'.format(u, uu)
h = {"Authorization": "Basic {0}".format( base64.b64encode(login) )}
r = requests.get(url, headers=h)
print login, r.status_code, r.ok
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment