Skip to content

Instantly share code, notes, and snippets.

@azuax
Created February 29, 2016 12:42
Show Gist options
  • Save azuax/603f2c6f988e5550d708 to your computer and use it in GitHub Desktop.
Save azuax/603f2c6f988e5550d708 to your computer and use it in GitHub Desktop.
Script simple para crackear un zip protegido con contraseña utilizando un diccionario de datos
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import zipfile
parser = argparse.ArgumentParser(prog='Dictionary Zip Cracker')
parser.add_argument('-f', '--file', help='Ruta del archivo diccionario', required=True)
parser.add_argument('-z', '--zipfile', help='Ruta del archivo comprimido', required=True)
values = parser.parse_args()
zip_file = zipfile.ZipFile(values.zipfile, 'r')
with open(values.file, 'r') as f:
for line in f:
try:
password = line.strip()
zip_file.extractall(pwd=password)
print u'La contraseña es: %s' % password
exit(0)
except Exception as e:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment