So, I have a quick question about a small password cracking program that I wrote. The syntax seems to be fine, but when run at the command terminal (I'm on a mac), the program doesn't really DO anything. I'll click "run in terminal" or I'll already have the terminal window open and just input "python crack.py" and it wont do anything, it just returns another new fresh command line prompt. Ideas?
#!/usr/bin/python
import crypt
def testPass(cryptPass):
salt = cryptPass[0:2]
dictFile = open('/Users/some_user/Desktop/dictionary.txt', 'r')
for word in dictFile.readlines():
word = word.strip('\n')
cryptWord = crypt.crypt(word,salt)
if (cryptWord == cryptPass):
print("[+] Found Password: " + word + "\n")
return
print("[-] Password Not Found. \n")
return
def main():
passFile = open('/Users/some_user/Desktop/passwords.txt')
for line in passFile.readline():
if ":" in line:
user = line.split(":")[0]
cryptPass = line.split(':')[1].strip(' ')
print("[*] Cracking Password for: " + user)
testPass(cryptPass)
if __name__ == "__main__":
main()