Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use python to crack zip package Program

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces "how to use python to crack the zip package program". In the daily operation, I believe many people have doubts about how to use python to crack the zip package program. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful for everyone to answer the question of "how to use python to crack the zip package program". Next, please follow the editor to study!

Detailed

Project file structure

Code implementation process

Demonstration effect

Project file structure

There are three files in the current directory:

3-zipCrack.py: zip cracking program

Dictionary.txt: password dictionary

Evil.zip: zip compressed package program

Code implementation process

ZIP, is a file compression algorithm, ZIP usually uses the suffix ".zip", its MIME format is application/zip.

At present, ZIP format is one of several mainstream compression formats, and its competitors include RAR format and open source 7-Zip format. In terms of performance, RAR format has a higher compression ratio than ZIP format, but its compression time is much higher than that of Zip.

The principle of cracking is to traverse the password of the password dictionary and try to decode it one by one. If the password complex dictionary leads to a decline in cracking efficiency, the following multi-thread cracking can be improved.

Import zipfileimport optparsefrom threading import Threaddef extractFile (zFile, password): # crack zip password program zFile.extractall (pwd=password) print'[+] Found password'+ password +'\ n'def main (): parser = optparse.OptionParser ("usage% prog" +\ "- f-d") # parse command line #. ZFile = zipfile.ZipFile (zname) passFile = open (dname) for line in passFile.readlines (): # realize multithreading cracking t = Thread (target=extractFile, args= (zFile, password)) t.start () if _ _ name__ = ='_ main__': main ()

PS: if you need Python learning materials, you can add the group below to go to the free administrator to get it.

Demonstration effect

There are three files in the current directory:

3-zipCrack.py: zip cracking program

Dictionary.txt: password dictionary

Evil.zip: zip compressed package program

Enter the python 3-zipCrack.py prompt for usage for the first time:

Usage% prog-f-d

Then enter the command correctly according to the usage:

Python 3-zipCrack.py-f evil.zip-d dictionary.txt

This successfully cracked the evil.zip package and showed that the zip decoding password was secret.

At this point, the study on "how to use python to crack the zip package program" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report