Demo entry 6651588

ssss

   

Submitted by anonymous on Oct 24, 2017 at 10:43
Language: Python. Code size: 935 Bytes.

import crypt

def testpass(password):
    salt = password[0:2]    #This is assuming you know how the password was salted,
                            #UNIX uses crypt() which adds the same 2 char salt to every password
    dictionaryfile = open('dictionary.txt', 'r')
    for word in dictionaryfile.readlines():
        word = word.strip('\n')
        cryptword = crypt.crypt(word,salt)
        if cryptword == password:
            print
            'found password:' + word + "\n"
            return
        print
        'password not found'
        return
def main():
    passwordfile = open('passwords.txt')
    for line in passwordfile.readlines():
        if ":" in line:
            username = line.split(':')[0]
            password = line.split(':')[1].strip(' ')
            print
            'cracking password for' + username
            testpass(password)

if __name__ == '__main__':
    main()

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).