.zip爆破

Python的优化问题

Python在计算密集型任务方面没有明显的多线程优化,多线程更加适合用于处理I/O密集型任务(如网络请求)。爆破任务使用顺序执行即可。

编写Python脚本

一个简单的爆破脚本:

import zipfile
import traceback
import shutil
import os #加载字典
def read_dicts(filename):
dicts=[]
with open(filename,'r')as fp:
dicts=[pwd.strip() for pwd in fp.readlines()]
return dicts #解压缩功能
def blast(zip_file,pwd):
try:
zip_file.extractall('./temp',pwd=pwd.encode())
return pwd
except Exception as e:
if 'Bad password' in str(e):
return False
traceback.print_exc() if __name__=='__main__':
dict_file='./zip_dict.txt'
zip_file=zipfile.ZipFile('./test.zip')
for password in read_dicts(dict_file):
result=blast(zip_file,password)
if result:
print(f'[+] get pasword: {result}')
break
else:
print('[-] not found')
shutil.rmtree('./temp')
os.mkdir('./temp')

测试

提供了一份实验文件。

.zip爆破的更多相关文章

  1. optparser模块 与 ZIP爆破(Python)

    optparser模块: 为脚本传递命令参数. 初始化: 带 Usage 选项(-h 的显示内容 Usage:): >>> from optparse import OptionPa ...

  2. Go黑帽子

    使用go语言来实现python黑帽子和绝技的代码 1.unix密码破解器 package main import( "bufio" "flag" "i ...

  3. buuctf misc 刷题记录

    1.金三胖 将gif分离出来. 2.N种方法解决 一个exe文件,果然打不开,在kali里分析一下:file KEY.exe,ascii text,先txt再说,base64 图片. 3.大白 crc ...

  4. BUUCTF-Misc-No.1

    # BUUCTF-Misc # 签到 flag{buu_ctf} 金三胖 说实话直接看出来flag{he11ohongke} 二维码 直接binwalk扫一下,-e分离就出来一个带锁的zip爆破一下就 ...

  5. misc刷题

    前言:听说misc打得好,头发多不了 kali自带的字典: cd /usr/share/wordlists/ 字典网站:http://contest-2010.korelogic.com/wordli ...

  6. Super-Mario-Host(超级玛丽)靶机

    仅供个人娱乐 靶机百度云下载  链接:https://pan.baidu.com/s/13l1FUgJjXArfoTOfcmPsbA 提取码:a8ox 一.主机发现 arp-scan -l 二.漏洞扫 ...

  7. python zip文件密码爆破

    #!/usr/bin/env # coding=UTF-8 import zipfile import threading import os import sys class CrackZip: d ...

  8. 破解压缩包的几种方式(zip伪加密 爆破 CRC32碰撞 已知明文攻击)

    zip伪加密 zip文件是由3部分组成,详见文末 压缩源文件数据区+压缩源文件目录区+压缩源文件目录结束标志 在压缩源文件数据区有个2字节的 全局方式位标记 ,在压缩源文件目录区也有个2字节的 全局方 ...

  9. python爆破zip脚本

    最近在提高自己编程能力,拿一些实用的小工具练下.该脚本为python语言,主要涉及模块zipfile,threadings模块. 功能:暴力猜解zip解压密码 #coding: utf-8 impor ...

随机推荐

  1. Linux内核4.19.1编译

    linux内核编译 1.1 大致步骤 下载linux内核4.19.1 官网链接: https://www.kernel.org/ 官网下载经常速度太慢,无法下载,提供另一个链接: http://ftp ...

  2. git命令简写配置

    在使用git工具时,有些命令比较常用,为了加快输入速度,可以自定义一些简写配置,如下所示: git st # git status git ci # git commit git br # git b ...

  3. Leetcode(885)- 救生艇

    第 i 个人的体重为 people[i],每艘船可以承载的最大重量为 limit. 每艘船最多可同时载两人,但条件是这些人的重量之和最多为 limit. 返回载到每一个人所需的最小船数.(保证每个人都 ...

  4. filter_var 函数()绕过执行命令

    escape 过滤器来过滤link,而实际上这里的 escape 过滤器,是用PHP内置函数 htmlspecialchars 来实现的 htmlspecialchars 函数定义如下: htmlsp ...

  5. Vue computed props pass params

    Vue computed props pass params vue 计算属性传参数 // 计算 spreaderAlias spreaderAlias () { console.log('this. ...

  6. Apple Screen Recorder All In One

    Apple Screen Recorder All In One Apple macOS 自带录屏 QuickTime Player https://support.apple.com/zh-cn/g ...

  7. JS Object Deep Copy & 深拷贝

    JS Object Deep Copy & 深拷贝 针对深度拷贝,需要使用其他方法 JSON.parse(JSON.stringify(obj));,因为 Object.assign() 拷贝 ...

  8. AI & HR

    AI & HR 数字化人才画像 人力资本数字化管理 通过"AI+数据+专家"的手段,将"数字化人才画像"作为服务起点与信息入口,扩展提供全场景的数字化人 ...

  9. npm & config settings

    npm & config settings how to check npm config settings https://docs.npmjs.com/cli/config $ npm c ...

  10. 同城速递 & 同城跑腿 & 竞品分析

    同城速递 & 同城跑腿 & 竞品分析 toC / toB 闪送 https://www.ishansong.com/ https://www.tianyancha.com/compan ...