Excel工作表保护的密码破解与清除...假装自己破解密码系列?

news/2024/11/27 23:30:13/

网上下载来的Excel经常会有工作表保护,也就是无法修改,妄图做任何修改的时候你就会看见这句话:

您试图更改的单元格或图表位于受保护的工作表中。若要进行更改,请取消工作表保护。您可能需要输入密码。

 

那么这篇文章可以简单的帮你解决这个问题...因为Excel中内置了Visual Basic,所以我们写个宏暴力破解密码就可以了。。。

1. 当然是先打开有保护密码的Excel文件

2. 新建一个宏(不同版本的office宏所在的位置不一样,一般都在"菜单—视图" 中)

然后我们点击"录制宏",名字随便写,然后再次点击,会发现录制宏的位置已经变成了“停止录制”,点击“停止录制”

3.在停止录制后我们点击“查看宏”,找到我们刚才新建的宏,比如我新建的名为“asd”,选中后点击"编辑"

 

4. 然后在弹出的框中我们可以看到我们新建的空宏"asd"

5. 把这个框内的所有内容全部删除,将下面的所有代码复制进去

6. 关闭Visual Basic,回到我们的Excel,当然这里不需要保存,直接右上角叉掉即可

7. 然后我们回到最初的位置,点击“查看宏”,就会发现刚才我们新建的空宏已经不见了,取而代之的是一个名为"Password_cracking"的宏

8. 选中这个宏,点击执行,就可以破解当前这份Excel中的工作保护密码了

当然在执行完这个宏之后,当前打开的Excel中的密码已经被清除,你可以选择直接保存这份Excel,这样的话你的Excel就不再有密码了,也可以选择记下破解出来的密码,然后关闭这个Excel重新打开一次,输入密码解除保护

Public Sub Password_cracking()
Const DBLSPACE As String = vbNewLine & vbNewLine
Const AUTHORS As String = DBLSPACE & vbNewLine & _
"                      Author - jnxxhzz "
Const HEADER As String = "Password_cracking"
Const VERSION As String = DBLSPACE & "                      Version 1.0"
Const REPBACK As String = DBLSPACE & ""
Const ZHENGLI As String = DBLSPACE & ""
Const ALLCLEAR As String = DBLSPACE & "All password is clear" & DBLSPACE & "Please remember to save" 
Const MSGNOPWORDS1 As String = "No password!"
Const MSGNOPWORDS2 As String = "No password!"
Const MSGTAKETIME As String = "This will take some time , please wait for a while" & DBLSPACE & "Press next to start"
Const MSGPWORDFOUND1 As String = "Password is : " & DBLSPACE & "$$" & DBLSPACE & _
"If the file worksheet has a different password, it will search for the next set of passwords and release"
Const MSGPWORDFOUND2 As String = "Password is : " & DBLSPACE & "$$" & DBLSPACE & _
"If the file worksheet has a different password, it will search for the next set of passwords and release"
Const MSGONLYONE As String = ""
Dim w1 As Worksheet, w2 As Worksheet
Dim i As Integer, j As Integer, k As Integer, l As Integer
Dim m As Integer, n As Integer, i1 As Integer, i2 As Integer
Dim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer
Dim PWord1 As String
Dim ShTag As Boolean, WinTag As Boolean
Application.ScreenUpdating = False
With ActiveWorkbook
WinTag = .ProtectStructure Or .ProtectWindows
End With
ShTag = False
For Each w1 In Worksheets
ShTag = ShTag Or w1.ProtectContents
Next w1
If Not ShTag And Not WinTag Then
MsgBox MSGNOPWORDS1, vbInformation, HEADER
Exit Sub
End If
MsgBox MSGTAKETIME, vbInformation, HEADER
If Not WinTag Then
Else
On Error Resume Next
Do 'dummy do loop
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
With ActiveWorkbook
.Unprotect Chr(i) & Chr(j) & Chr(k) & _
Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & _
Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
If .ProtectStructure = False And _
.ProtectWindows = False Then
PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
MsgBox Application.Substitute(MSGPWORDFOUND1, _
"$$", PWord1), vbInformation, HEADER
Exit Do 'Bypass all for...nexts
End If
End With
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
End If
If WinTag And Not ShTag Then
MsgBox MSGONLYONE, vbInformation, HEADER
Exit Sub
End If
On Error Resume Next
For Each w1 In Worksheets
'Attempt clearance with PWord1
w1.Unprotect PWord1
Next w1
On Error GoTo 0
ShTag = False
For Each w1 In Worksheets
'Checks for all clear ShTag triggered to 1 if not.
ShTag = ShTag Or w1.ProtectContents
Next w1
If ShTag Then
For Each w1 In Worksheets
With w1
If .ProtectContents Then
On Error Resume Next
Do 'Dummy do loop
For i = 65 To 66: For j = 65 To 66: For k = 65 To 66
For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66
For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66
For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126
.Unprotect Chr(i) & Chr(j) & Chr(k) & _
Chr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
If Not .ProtectContents Then
PWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _
Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _
Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
MsgBox Application.Substitute(MSGPWORDFOUND2, _
"$$", PWord1), vbInformation, HEADER
'leverage finding Pword by trying on other sheets
For Each w2 In Worksheets
w2.Unprotect PWord1
Next w2
Exit Do 'Bypass all for...nexts
End If
Next: Next: Next: Next: Next: Next
Next: Next: Next: Next: Next: Next
Loop Until True
On Error GoTo 0
End If
End With
Next w1
End If
MsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK & ZHENGLI, vbInformation, HEADER
End Sub

---- 此项目开源仅仅是为了交流学习,大肆流传可能会对其他公司的商业产品造成损失,所以请自觉遵守法律以及道德规范,切勿将其挪作他用,更不可用其获取商业利益!


http://www.ppmy.cn/news/136002.html

相关文章

EXECL打开密码暴力破解

execl打开密码忘记了,可以通过以下方式破解。不过破解只能搞定6位以下的密码。过长的密码是没办法搞定的。 打开vba编辑器(artF11)。 粘贴如下代码。点击工具栏绿色△号。执行代码。 Sub openIt() Dim i As Long Dim FileName As String i 0 FileName Applicati…

EXCEL VBAProject密码破解 工作表密码破解

1. VABProject密码 a. 下载hex editor二进制编辑器,使用查找功能定位到DPB”…….上 b. 把DPB更改成DPx保存 c. 重新打开EXCEL会提示错误未找到关键字DPx是否继续加载工程,选择 是 d. AltF11打开VBA工程,右键顶节点,VBAProj…

Excel·VBA破解密码

上一篇文章《ExcelVBA数组排列函数》,实现了VBA排列功能,而排列重要应用就是破解密码 目录 Excel密码破解zip、rar密码破解 Excel密码破解 支持破解纯数字、数字字母混合、纯字母等形式的密码 因破解速度不快,支持排列分段破解 Sub excel破…

【WIN】超简单的Excel密码破解

新开一Excel,同时按AltF11,进入VBA界面,点菜单上的插入,模块,在新出来的窗口粘贴一下代码: Sub crack() Dim i As Long Dim FileName As String i 0 FileName Application.GetOpenFilename("Excel文…

Excel 各种密码的破解,各种大全值得收藏!(亲测有效)

本文介绍在 Excel 的多个文件版本中破解各类密码,包含文件的查看、只读密码,工作表、工作簿的保护密码,以及 VBA 工程密码。内容非常全面,建议你收藏。文件作者加密码是防止数据被查看,修改,所以&#xff0…

Excel 各种密码的破解,大全建议收藏!

本文介绍在 Excel 的多个文件版本中破解各类密码,包含文件的查看、只读密码,工作表、工作簿的保护密码,以及 VBA 工程密码。内容非常全面,建议你收藏。文件作者加密码是防止数据被查看,修改,所以&#xff0…

excel文件管理:如何进行密码保护和破解? 上篇

对于一个公司,或者个人来说,有时候我们的数据往往需要加密。比如公司的经营状况和缴纳的税收有关系,人事档案中有每位员工的个人信息和工资组成说明,这些都是不需要无关人员知道的。微软对于EXCEL的设计就比较人性化,考…

忘记文档密码,教你破解WORD/EXECL/PPT文件加密密码

“ 大家办公时,有设置密码习惯,并且容易忘记密码,今天给大家提供一款超好用得小工具,。不定时更新软件、高效率工具小福利!!!” 软件:Advanced OfficePassword Recovery 今天给大家…