Skip to content

Instantly share code, notes, and snippets.

@Torxed
Last active August 29, 2015 13:56
Show Gist options
  • Save Torxed/9208781 to your computer and use it in GitHub Desktop.
Save Torxed/9208781 to your computer and use it in GitHub Desktop.
Temp
from threadimg import *
class worker(Thread):
def __init__(self, filehandle, password, crackflag):
Thread.__init__(self)
self.fh = filehandle
self.pwd = password
self.cracked = crackflag
self.start()
def run(self):
if not self.cracked:
zfh = zipfile.ZipFile(self.fh)
try:
zfh.extractall(pwd=self.pwd)
print('Extracted:',self.pwd)
cracked = self.pwd
exctept:
pass
cracked = False
zipcontent = StringIO.StringIO()
with open('crackme.zip', 'rb') as fh:
zipcontent.write(fh.read())
for password in ('notworking', 'aanl0', '12345'):
worker(zipcontent, password, cracked)
while len(enumerate()) > 1:
pass #waiting for threads to finish
print(cracked)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment