├── .gitignore ├── LICENSE ├── README.md ├── screenshot ├── 1.png └── 2.png └── zipcrack.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | 48 | # Translations 49 | *.mo 50 | *.pot 51 | 52 | # Django stuff: 53 | *.log 54 | local_settings.py 55 | 56 | # Flask stuff: 57 | instance/ 58 | .webassets-cache 59 | 60 | # Scrapy stuff: 61 | .scrapy 62 | 63 | # Sphinx documentation 64 | docs/_build/ 65 | 66 | # PyBuilder 67 | target/ 68 | 69 | # IPython Notebook 70 | .ipynb_checkpoints 71 | 72 | # pyenv 73 | .python-version 74 | 75 | # celery beat schedule file 76 | celerybeat-schedule 77 | 78 | # dotenv 79 | .env 80 | 81 | # virtualenv 82 | venv/ 83 | ENV/ 84 | 85 | # Spyder project settings 86 | .spyderproject 87 | 88 | # Rope project settings 89 | .ropeproject 90 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 教堂 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #ZipCrack 2 | 暴力破解zip压缩包,有两种模式可选择 `1.自定义生成字典` `2.使用现有字典` 3 | 4 | >加载现有字典 5 | 6 | ![](screenshot/1.png) 7 | 8 | >自定义生成字典 9 | 10 | ![](screenshot/2.png) 11 | 12 | -------------------------------------------------------------------------------- /screenshot/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/root2ch/ZipCrack/16e6ced8f931ecc8a20678d428bbebed38dbd849/screenshot/1.png -------------------------------------------------------------------------------- /screenshot/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/root2ch/ZipCrack/16e6ced8f931ecc8a20678d428bbebed38dbd849/screenshot/2.png -------------------------------------------------------------------------------- /zipcrack.py: -------------------------------------------------------------------------------- 1 | ''' 2 | +-----------------------------------+ 3 | | author : church | 4 | | Blog : evilchurch.cc | 5 | | Github : github.com/evilchurch | 6 | +-----------------------------------+ 7 | ''' 8 | 9 | 10 | 11 | #!/usr/bin/env python 12 | 13 | import zipfile 14 | import itertools, string 15 | 16 | def extract(zfile, passwd): 17 | try: 18 | zfile.extractall(pwd=passwd) 19 | print '[+] Passwd Found: { ' + passwd +' }' 20 | return True 21 | except: 22 | pass 23 | 24 | def createpassfile(min_len, max_len): 25 | passfile = open('passFile.txt', 'w') 26 | chars = string.printable.replace(' \t\n\r\x0b\x0c', '') 27 | print '[*] Creating passFile...' 28 | 29 | for x in xrange(int(min_len), int(max_len)+ 1): 30 | for i in itertools.product(chars, repeat=x): 31 | s = ''.join(i) 32 | passfile.write("%s\n" % s) 33 | passfile.close() 34 | 35 | def crack(zfile, passfile): 36 | zfile = zipfile.ZipFile(zfile) 37 | with open(passfile) as p: 38 | for line in p.readlines(): 39 | passwd = line.strip('\n') 40 | if extract(zfile, passwd): 41 | break 42 | 43 | def main(): 44 | print '[*] Please choose the options:\n 1. Get Password with passFile\n 2. Get Password with Brute Force.' 45 | option = raw_input('[*] Enter Option: ') 46 | if option == '1': 47 | zfile = raw_input('[*] Enter zip Filename: ') 48 | passfile = raw_input('[*] Enter *.txt passFile: ') 49 | print '[*] Getting Password...' 50 | crack(zfile, passfile) 51 | 52 | elif option == '2': 53 | passfile = 'passFile.txt' 54 | zfile = raw_input('[*] Enter zip Filename: ') 55 | min_len = raw_input('[*] Enter the Min-Length of Password: ') 56 | max_len = raw_input('[*] Enter the Max-Length of Password: ') 57 | if min_len > max_len: 58 | print '[-] Wrong.. Min-length must be smaller or same as Max-length.' 59 | exit() 60 | createpassfile(min_len, max_len) 61 | print '[*] Getting Password...' 62 | crack(zfile, passfile) 63 | 64 | if __name__ == '__main__': 65 | main() 66 | --------------------------------------------------------------------------------