# HashCat 恢复ExcelWordPPT密码 **Repository Path**: cooljoker/HashCat ## Basic Information - **Project Name**: HashCat 恢复ExcelWordPPT密码 - **Description**: 方便大家寻找offic密码 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2024-02-01 - **Last Updated**: 2024-02-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # HashCat 恢复Excel、Word、PPT密码 ## 一、流程 整体需要两个步骤 1. 先用`office2john.py`获取下文件的hash值 ``` python office2john.py 1.xlsx > hash ``` > 这个命令需要你电脑有python环境,然后在cmd命令窗口中执行此命令就行 > > 文件链接: > > 此项目中,下载的有这个文件,如果不能用的话,可以去源项目下载 2. 然后用HashCat 会根据hash值去解析密码 > HashCat链接: ## 二、具体操作 ### 1、环境准备 * pyhon下载地址:http://www.python.org/download/ ![1706779189308](assets/1706779189308.png) * office2john.py下载地址:https://github.com/magnumripper/JohnTheRipper/blob/bleeding-jumbo/run/office2john.py ![1706779259517](assets/1706779259517.png) * HashCat下载地址:https://hashcat.net/hashcat/,下载后是个压缩包,解压下就ok ![1706779297534](assets/1706779297534.png) ### 2、保姆教学 新建一个Excel,名字为:cc.xls,然后设置个简单的密码:1234 ![1706779587260](assets/1706779587260.png) 然后用office2john.py计算出该文件的hash值 快捷操作为:在该目录下的地址栏中,输入cmd,然后回车确定,就进入到cmd命令窗口中的 ![1706779684110](assets/1706779684110.png) 接着,在命令窗口中输入:`python office2john.py cc.xls > hash` ![1706779802011](assets/1706779802011.png) 然后,目录中会多个文件:hash ![1706779860831](assets/1706779860831.png) 用记事本打开这个文件,会发现里面有一大串数字,这个时候,把没用的东西去掉, 比如:源文件内容为`cc.xlsx:$office$*2013*100000*256*16*c2452356541d5c026b2040198fb74a6b*3511915654231c541760d4295329c351*6596f6c425d415cec340f5cd1426ed546aaa7872d2013aa1b6c858aaf2ae5947` 把cc.xls去掉,只保留$符号到后面的数字,最终内容为:`$office$*2013*100000*256*16*c2452356541d5c026b2040198fb74a6b*3511915654231c541760d4295329c351*6596f6c425d415cec340f5cd1426ed546aaa7872d2013aa1b6c858aaf2ae5947` ![1706780840292](assets/1706780840292.png) 然后,把HashCat解压到当前路径中, ![1706780166669](assets/1706780166669.png) 并把hash这个文件复制到,hashcat-6.2.6文件夹中 ![1706780256404](assets/1706780256404.png) 然后在在该目录下,打开cmd窗口,并执行**hashcat64 -m 9600 hash -a 3 ?d?d?d?d -w 3 –O**命令(具体需要什么参数,后面附带的有) ![1706780397557](assets/1706780397557.png) 等待程序执行完毕后是这样的 ![1706780944928](assets/1706780944928.png) 然后,等待程序运行完之后,肯定好奇,成功了没 这个时候,在刚才的命令基础上,加上--show ``` hashcat.exe -m 9600 hash -a 3 ?d?d?d?d -w 3 -O --show ``` ![1706780993964](assets/1706780993964.png) 密码就显示出来了,冒号后面的数字就是:1234 ![1706781069929](assets/1706781069929.png) ### 3、参数详情 这个时候,很多人不明白,参数都是啥意思,看看下面解释就清楚了 **破解 Office 加密 Offcie 版本对应哈希类型** - **Office97-03(MD5+RC4,oldoffice$0,oldoffice$1):-m 9700** - **Office97-03($0/$1, MD5 + RC4, collider #1):-m 9710** - **Office97-03($0/$1, MD5 + RC4, collider #2):-m 9720** - **Office97-03($3/$4, SHA1 + RC4):-m 9800** - **Office97-03($3, SHA1 + RC4, collider #1):-m9810** - **Office97-03($3, SHA1 + RC4, collider #2):-m9820** - **Office2007:-m 9400** - **Office2010:-m 9500** - **Office2013:-m 9600** 比如刚才我都hash值为 $office$*2013, ``` $office$*2013*100000*256*16*c2452356541d5c026b2040198fb74a6b*3511915654231c541760d4295329c351*6596f6c425d415cec340f5cd1426ed546aaa7872d2013aa1b6c858aaf2ae5947 ``` 那么我的命令就是 ``` hashcat.exe -m 9600 hash -a 3 ?d?d?d?d -w 3 -O --show ``` 如果你的是2010,那就把9600换成9500 > 更多类型的参数,可以在这个连接看:https://hashcat.net/wiki/doku.php?id=oclhashcat#options 然后,?d?d?d?d 是什么意思呢,Hashcat 中自定义破解含义值: - ?l = abcdefghijklmnopqrstuvwxyz,代表小写字母。 - ?u = ABCDEFGHIJKLMNOPQRSTUVWXYZ,代表大写字母。 - ?d = 0123456789,代表数字。 - ?s = !"#$%&'()*+,-./:;<=>?@[]^_`{|}~,代表特殊字符。 - ?a = ?l?u?d?s,大小写数字及特殊字符的组合。 - ?b = 0x00 - 0xff 下面有一些常用实例,大家可以参考下 **8 位数字破解** Hashcat64 -m 9700 hash -a 3 ?d?d?d?d?d?d?d?d -w 3 –O **1-8 位数字破解** Hashcat -m 9700 hash -a 3 --increment --increment-min 1--increment-max 8 ?d?d?d?d?d?d?d?d **1 到 8 位小写字母破解** Hashcat -m 9700 hash -a 3 --increment --increment-min 1--increment-max 8 ?l?l?l?l?l?l?l?l **8 位小写字母破解** Hashcat -m 9700 hash -a 3 ?l?l?l?l?l?l?l?l -w 3 –O **1-8 位大写字母破解** Hashcat -m 9700 hash -a 3 --increment --increment-min 1--increment-max 8 ?u?u?u?u?u?u?u?u **8 位大写字母破解** Hashcat -m 9700 hash -a 3 ?u?u?u?u?u?u?u?u -w 3 –O **5 位小写+大写+数字+特殊字符破解** Hashcat -m 9700 hash -a 3 ?b?b?b?b?b -w 3 > 破解时采取先易后难的原则,建议如下: > > - 使用 1-8 位数字进行破解。 > - 使用 1-8 位小写字母进行破解。 > - 使用 1-8 位大写字母进行破解。 > - 使用 1-8 位混合大小写+数字+特殊字符进行破解。 > - 利用收集的公开字典进行破解。 ## 三、结束语 好啦,看到这大家应该都明白了,如果还有不明白的话,可以评论或者私信 想图方便的可以去我仓库地址下载 github地址: 码云地址:https://gitee.com/cooljoker/HashCat 如果感觉有帮助的话,希望老板们打赏打赏哦!![1706782010514](assets/1706782010514.png)