Python Write zip Cracker

Source: Internet
Author: User
Tags dname

Browse the desktop is still calm,!!! Wait a minute.. Why is there a compression package?

Open a look!!! 156.txt??? waht the fuck?

The slot and the code!!!!!!.

But I don't know what ╮(╯▽╰)╭ should do!

Very simple, Python writes a zip dictionary cracker

First, we need to use the ZipFile module.

---------------Simple hack program is as follows------------------------

#-*-coding:utf-8-*-ImportZipFiledefTest (): Zipfi=zipfile. ZipFile ('Xxxxx.zip') Passfile=open ('password dictionary. txt','R')   forLineinchpassfile.readlines (): Password=line.strip ('\ n')  Try: Zipfile.extractall (pwd=password)Print'Found zip Password:'+word+'\ n' except:   Pass
Test ()

You will not find the program run dictionary very slow!

So we're going to make a makeover.

Add a bit here, because someone might not have a dictionary, we can build one with Python!

------------Dictionary builder-------------

F=open ('Zidian.txt','W') DiC='123456'BS=[b+d+c+g forBinchDic forDinchDic forGinchDiC] forLineinchBS:PrintLine F.write ( line+'\ n')

Next we add multi-threading to the zip cracker and can let the user choose the dictionary and zip function!

------The modified code-------

ImportZipFileImportoptarges fromThreadingImportThreaddefExtractfile (Zfile,password):Try: Zfile.extractall (pwd=password)Print '[*]found Password:'+password+'\ n'  except:    PassdefMain (): Parse=optparges. Optionsparse ('This procedure is provided by the less than the% use method'+ '-f<zipfile>-d<xxx.txt>') parser.add_options (dest='Zname', type='string', Help='Specify ZIP file') parser.add_option ('- D', dest='dname', type='string', Help='Specify dictionary file') ) (Options,args)=Parser.parse_args ()if(options.zname=none|options.dname=None)Print. Usage exit (0) Znme=options.zname dname=Options.dnamezfile=ZipFile. ZipFile (znme) passfile=Open (dname) forLineinchpassfile.readlines (): Password=line.strip ('\ n') T=thread (target=extractfile,args=(Zfile,password)) T.start () if__name__='__main__': Main ()

Successfully run out of ZIP code, mom yes ... Inside is Yellow Book in url!!!!!

Python Write zip Cracker

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.