Sign in to follow this  
Followers 0
theshruber

Brute force passwd cracking, am i doing it right?

2 posts in this topic

Hey, so i just created this brute force script in Python that tries to figure out a password (in this example, the password is a constant string)

 

It creates a list() starting with one int(), it then counts in base-n untill it figures out the password (when it has to do a carry, it just expands the list)

Basicly, i was just wondering wether this is the way it's "usually" done.

 

chars = list('qwertyuiopasdfghjklzxcvbnmm')passwd = []chars_length = len(chars) - 1test_passwd = 'abcde'passwd = [0]def getPass(attempt):    global chars    ret = ''    for char in attempt:        ret += chars[char]    return retwhile True:    passwd[0] += 1    i = 0    for char in passwd:        if char == chars_length:            passwd[i] = -1            try:                passwd[i+1] += 1            except IndexError:                passwd.append(0)                passwd[i+1] += 1                print(str( len(passwd) )+'\n'+getPass(passwd)+'\n===================')        i += 1    if getPass(passwd) == test_passwd:        print('\nFOUND IT!!!\ngetPass( passwd ) == "{}"\n\t=> True'.format(test_passwd))        break


I attatched the script as a *.txt

passFigure.txt

Edited by TheShrubber
1

Share this post


Link to post
Share on other sites

Looks about right to me. If my Python skills are still intact (they're definitely not) it looks to me as if you try every combination of your character set list for a given length then move to a new length. That's basically all bruteforcing is. Now figure out how to write that so it uses Cuda or OpenCL and you'll have yourself an extremely high-speed bruteforecing program you can call your own.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0