Skip to content

Instantly share code, notes, and snippets.

@wildonion
Created October 28, 2020 20:04
Show Gist options
  • Select an option

  • Save wildonion/b32d4afccb62ac645392a8d3f2bffcde to your computer and use it in GitHub Desktop.

Select an option

Save wildonion/b32d4afccb62ac645392a8d3f2bffcde to your computer and use it in GitHub Desktop.
a simple password cracker script
#!/usr/bin/python
import crypt
def testPass(cryptPass):
salt = cryptPass[0:2]
dictFile = open('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('password.txt')
for line in passFile.readLines():
if ":" in line:
user = line.split(':')[0]
cryptPass = line.split(':')[1].strip(' ')
print("[*] Cracking Password For: "+user)
testPass(cryptPass)
if __name__=="__main__":
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment