Skip to content

Instantly share code, notes, and snippets.

@growlnx
Last active August 4, 2018 20:28
Show Gist options
  • Save growlnx/eb0f3ce57528b9fad6a086a8d3228ee5 to your computer and use it in GitHub Desktop.
Save growlnx/eb0f3ce57528b9fad6a086a8d3228ee5 to your computer and use it in GitHub Desktop.
testador de password
import sys, os, subprocess as sub
arg = sys.argv
if len(arg) < 3:
print('bf.py <FILE>.cpt <DICT>.txt')
exit(1)
if not os.path.exists(arg[1]):
print('arquivo inválido')
exit(2)
wordlist = open(arg[2],'r')
tentativa = 0
for word in wordlist:
cmd = ['ccrypt', '-d', arg[1], '-K', word]
ccrypt = sub.Popen(cmd, stdout=sub.DEVNULL, stderr=sub.DEVNULL)
tentativa += 1
if not ccrypt.wait():
print('password: {}\ntentativas: {}'.format(word, tentativa))
exit(0)
print('password nao encontrada')
exit(3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment