Python破解excel进入密码的过程详解
作者:用余生去守护 发布时间:2021-06-14 03:06:25
标签:Python,破解,excel,密码
一、excel进入密码
加密算法cipher Algorithm=“AES”
AES加密算法的详细介绍与实现
二、密码解除思路
通过排列组合的方式进行查找
注意:此方法比较考验对密码字典的选取,且耗费时间较长,仅供参考学习!!
文件夹如图所示:
将待破解的文件放到excel文件夹中。
三、python
1.conf.ini
将准备好的密码字典添加到conf.ini中password后面,用","分隔开!!!
部分字典如下(示例):
[Conf]
path=./excel/
password=12345678,1234,qwerty,12345,dragon,pussy,baseball,football,letmein,monkey,696969,abc123,mustang,michael,shadow,master,jennifer,111111,2000,jordan,superman,harley,1234567,fuckme,hunter,fuckyou,trustno1,ranger,buster,thomas,tigger,robert,soccer,fuck,batman,test,pass,killer,hockey,george,charlie,andrew,michelle,love,sunshine,jessica,asshole,6969,pepper,daniel,access,123456789,654321,joshua,maggie,starwars,silver,william,dallas,yankees,123123,ashley,666666,hello,amanda,orange,biteme,freedom,computer,sexy,thunder,nicole,ginger,heather,hammer,summer,corvette,taylor,fucker,austin,1111,merlin,matthew,121212,golfer,cheese,princess,martin,chelsea,patrick,richard,diamond,yellow,bigdog,secret,asdfgh,sparky,cowboy,camaro,anthony,matrix,falcon,iloveyou,bailey,guitar,jackson,purple,scooter,phoenix,aaaaaa,morgan,tigers,porsche,mickey,maverick,cookie,nascar,peanut,justin,131313,money,horny,samantha,panties,steelers,joseph,snoopy,boomer,whatever,iceman,smokey,gateway,dakota,cowboys,eagles,chicken,dick,black,zxcvbn,please,andrea,ferrari,knight,hardcore,melissa,compa
2.crack.py
代码如下(示例):
#!/usr/bin/env python3
import configparser
import os
import win32com.client
import turtle
import time
import math
import shutil
import threading
import sched
#创建文件夹
def mkdir(path):
path = path.strip()
path = path.rstrip("\\")
isExists = os.path.exists(path)
if not isExists:
os.makedirs(path)
print (path + ' 创建成功')
return True
else:
print (path + ' 目录已存在')
return False
def delpwdtry(xcl,filename,pw_str):
try:
wb = xcl.Workbooks.Open(filename, False, False, None, pw_str)
xcl.DisplayAlerts = False
# # 保存时可设置访问密码.
wb.SaveAs(filename, None, '', '')
# 保存文件
wb.Save()
# 文件保存并关闭
wb.Close(SaveChanges=True)
xcl.Quit()
return True
except:
xcl.Quit()
return False
def makefile(path, content):
if os.path.exists(path):
return
else:
f = open(path, 'w+')
f.write(content)
f.seek(0)
read = f.readline()
f.close()
print('excel文件放加密excel config配置密码 okdir是成功文件夹')
os.system('pause')
exit(0)
def aaaa(starttime,filename,num,pwds,i,file,xcl):
haoshi = round(time.time() - starttime, 2)
print((str(i) + "/" + str(num)), haoshi, '秒', file)
pwdok = 0
i2 = 0
for pwd in pwds:
i2 = i2 + 1
print ((str(i) + "/" + str(num)), '第', i2, "次尝试", pwd)
pwd_end = ''
boo = delpwdtry(xcl, filename, pwd)
if boo:
pwdok = 1
pwd_end = pwd
break
if pwdok:
print ((str(i) + "/" + str(num)), 'ok')
# print ('10秒后移动文件')
s = threading.Timer(10, movee, (filename,))
s.start()
else:
print ('失败')
xcl.Quit()
def movee(filename):
shutil.move(filename, './okdir')
def delpwd(okdir,starttime):
conf = configparser.ConfigParser()
# 指定配置文件路径和编码
conf.read('conf1.ini', 'utf-8') # 文件路径
# 读取配置信息
path = conf.get("Conf", "path")
password = conf.get("Conf", "password")
pwds = password.split(',')
xcl = win32com.client.Dispatch("Excel.Application")
# pw_str为打开密码, 若无 访问密码, 则设为 ''
xcl.Visible = False
filelist = os.listdir(path)
num = len(filelist)
i = 0
for file in filelist:
i = i + 1
filename = os.path.abspath(os.path.join(path, file))
aaaa(starttime,filename,num,pwds,i,file,xcl)
starttime = time.time()
endtime = time.time()
okdir = './okdir'
mkdir('./excel')
mkdir(okdir)
makefile('./conf.ini', "[Conf]\npath=./excel/\npassword=mima1,mima2,3...")
delpwd(okdir,starttime)
haoshi = round(time.time()-starttime,2)
print("执行完成 耗时",haoshi , "秒")
os.system('pause')
来源:https://blog.csdn.net/qq_45365214/article/details/123236357
0
投稿
猜你喜欢
- 调用数据库存储过程见下:<%Set Dataconn = Server.CreateObject(&qu
- 4款JavaScript放大镜特效脚本。准确的说,Anythingzoomer和Bezoom才是正宗的放大镜特效,当鼠标悬浮在图片上时,能放
- 配置环境: 1、数 据 库:Oracle 8i R2 (8.1.7) for NT 企业版 2、安装路径:C:ORACLE 实现方法: 1.
- 维护脚本一例,写得有点乱,只是作为一个实例,演示如何快速利用工具快速达到目的:应用到:shell与python数据交互、数据抓取,编码转换#
- 发现错误利用Python库xlrd中的xlrd.open_workbook()函数读取自定义xlsx表格文件时出错如下:Traceback
- 代理模式的优点代理模式可以保护原对象,控制对原对象的访问;代理模式可以增强原对象的功能,通过代理对象来添加一些额外的功能;代理模式可以提高系
- 24小时内记录(即86400秒)$sql="Select video_id,count(id)as n FROM `rec_dow
- bbssend.asp'寻呼台页面,向在线网友发送寻呼信息<%@ Language=VBScript %&
- APScheduler (advanceded python scheduler)是一款Python开发的定时任务工具。文档地址
- 本文实例讲述了Python实现获取邮箱内容并解析的方法。分享给大家供大家参考,具体如下:# -*- coding: utf-8 -*-fro
- 在制作网页以及编程的时候,适当的进行注释,不仅使自己的思路清晰,极大地减轻了维护的难度,而且方便项目组其他人了解你的代码,方便对代码的理解以
- 前言你可能不需要经常处理分数,但当你需要时,Python的Fraction类会给你很大的帮助。本文将给大家详细介绍关于利用标准库fracti
- 本文实例讲述了Python面向对象之静态属性、类方法与静态方法。分享给大家供大家参考,具体如下:1. 静态属性:在函数前加@property
- 在进制学习时候,细心的小伙伴不免都发现unicher函数的存在,没错能够经常看到的,也就是关于进制的转化,那肯定有小伙伴要开心起来了,因为进
- IIS上设置301 跳转相信大家都会,只要在网站-属性-主目录里 选择重定向URL就行了,这样整站就跳转到目标站点了,但是有个问
- 测试平台 Ubuntu 13.04 X86_64 Python 2.7.4花了将近两个小时, 问题主要刚开始没有想到传一个文件对象到线程里面
- MySQL Order By keyword是用来给记录中的数据进行分类的。MySQL Order By Keyword根据关键词分类ORD
- phpMyAdmin可以管理整个MySQL服务器(需要超级用户),也可以管理单个数据库。为了实现后一种,你将需要合理设置MySQL用户,他只
- 1. 规范简介本规范主要规定ASP源程序在书写过程中所应遵循的规则及注意事项。编写该规范的目的是使项目开发人员的源代码书写习惯保持一致。这样
- 一、特效预览处理前处理后细节放大后二、程序原理1.输入你想隐藏的文字2.然后写到另一张跟照片同等大小的空白纸张上3.将相同位置的文字的颜色用