Excel密码忘记:破解Excel密码

2016-02-20 09:06 16 1 收藏

下面是个Excel密码忘记:破解Excel密码教程,撑握了其技术要点,学起来就简单多了。赶紧跟着图老师小编一起来看看吧!

【 tulaoshi.com - Excel教程 】

Excel保护密码是用来防止别人修改Excel文档用的,但有时连自己都忘了,那该怎么办呢?

破解方法:

打开需要破解的excel文档,然后按Alt+F11打开VBA编辑器,点击插入-模块,在模块中将以下代码COPY进去,无需保存,直接按F5运行,等待运行完毕。大约等待2分钟左右,密码被计算出来,并且显示出原密码,文档也变成未设密码状态。

(注:复制代码时按下面代码区域右上角的第二个按钮。)

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com)
Public Sub AllInternalPasswords()" Breaks worksheet and workbook structure passwords. Bob McCormick" probably originator of base code algorithm modified for coverage" of workbook structure / windows passwords and for multiple passwords"" Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1)" Modified 2003-Apr-04 by JEM: All msgs to constants, and" eliminate one Exit Sub (Version 1.1.1)" Reveals hashed passwords NOT original passwordsConst DBLSPACE As String = vbNewLine & vbNewLineConst AUTHORS As String = DBLSPACE & vbNewLine & _"Adapted from Bob McCormick base code by" & _"Norman Harker and JE McGimpsey"Const HEADER As String = "AllInternalPasswords User Message"Const VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04"Const REPBACK As String = DBLSPACE & "Please report failure " & _"to the microsoft.public.excel.programming newsgroup."Const ALLCLEAR As String = DBLSPACE & "The workbook should " & _"now be free of all password protection, so make sure you:" & _DBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _DBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _DBLSPACE & "Also, remember that the password was " & _"put there for a reason. Don"t stuff up crucial formulas " & _"or data." & DBLSPACE & "Access and use of some data " & _"may be an offense. If in doubt, don"t."Const MSGNOPWORDS1 As String = "There were no passwords on " & _"sheets, or workbook structure or windows." & AUTHORS & VERSIONConst MSGNOPWORDS2 As String = "There was no protection to " & _"workbook structure or windows." & DBLSPACE & _"Proceeding to unprotect sheets." & AUTHORS & VERSIONConst MSGTAKETIME As String = "After pressing OK button this " & _"will take some time." & DBLSPACE & "Amount of time " & _"depends on how many different passwords, the " & _"passwords, and your computer"s specification." & DBLSPACE & _"Just be patient! Make me a coffee!" & AUTHORS & VERSIONConst MSGPWORDFOUND1 As String = "You had a Worksheet " & _"Structure or Windows Password set." & DBLSPACE & _"The password found was: " & DBLSPACE & "$$" & DBLSPACE & _"Note it down for potential future use in other workbooks by " & _"the same person who set this password." & DBLSPACE & _"Now to check and clear other passwords." & AUTHORS & VERSIONConst MSGPWORDFOUND2 As String = "You had a Worksheet " & _"password set." & DBLSPACE & "The password found was: " & _DBLSPACE & "$$" & DBLSPACE & "Note it down for potential " & _"future use in other workbooks by same person who " & _"set this password." & DBLSPACE & "Now to check and clear " & _"other passwords." & AUTHORS & VERSIONConst MSGONLYONE As String = "Only structure / windows " & _"protected with the password that was just found." & _ALLCLEAR & AUTHORS & VERSION & REPBACKDim w1 As Worksheet, w2 As WorksheetDim i As Integer, j As Integer, k As Integer, l As IntegerDim m As Integer, n As Integer, i1 As Integer, i2 As IntegerDim i3 As Integer, i4 As Integer, i5 As Integer, i6 As IntegerDim PWord1 As StringDim ShTag As Boolean, WinTag As BooleanApplication.ScreenUpdating = FalseWith ActiveWorkbookWinTag = .ProtectStructure Or .ProtectWindowsEnd WithShTag = FalseFor Each w1 In WorksheetsShTag = ShTag Or w1.ProtectContentsNext w1If Not ShTag And Not WinTag ThenMsgBox MSGNOPWORDS1, vbInformation, HEADERExit SubEnd IfMsgBox MSGTAKETIME, vbInformation, HEADERIf Not WinTag ThenMsgBox MSGNOPWORDS2, vbInformation, HEADERElseOn Error Resume NextDo "dummy do loopFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126With 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 ThenPWord1 = 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, HEADERExit Do "Bypass all for...nextsEnd IfEnd WithNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfIf WinTag And Not ShTag ThenMsgBox MSGONLYONE, vbInformation, HEADERExit SubEnd IfOn Error Resume NextFor Each w1 In Worksheets"Attempt clearance with PWord1w1.Unprotect PWord1Next w1On Error GoTo 0ShTag = FalseFor Each w1 In Worksheets"Checks for all clear ShTag triggered to 1 if not.ShTag = ShTag Or w1.ProtectContentsNext w1If ShTag ThenFor Each w1 In WorksheetsWith w1If .ProtectContents ThenOn Error Resume NextDo "Dummy do loopFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66For l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66For i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66For 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 ThenPWord1 = 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 sheetsFor Each w2 In Worksheetsw2.Unprotect PWord1Next w2Exit Do "Bypass all for...nextsEnd IfNext: Next: Next: Next: Next: NextNext: Next: Next: Next: Next: NextLoop Until TrueOn Error GoTo 0End IfEnd WithNext w1End IfMsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADEREnd Sub

破解如此简单。有了这个方法,那Excel文档保护功能就是形同虚设。

(本文来源于图老师网站,更多请访问http://www.tulaoshi.com)

来源:http://www.tulaoshi.com/n/20160220/1643254.html

延伸阅读
标签: excel
Excel2010怎么设置密码   有一些机密数据是很重视安全的,一不小心就会被盗走,因此给Excel2010加密也是很有必要的。安全,安全,还是安全!也许你平常都不太在乎这些繁琐的事情,也许你经常不会在乎公司的文件保密措施,但这样往往会造成一些不必要的损失。所有在这里建议大家要养成一个非常良好的工作习惯,在编辑完成一些文档或表格...
标签: 电脑入门
不管是你忘记了密码还是不怀好意,总之破解一个你不知道密码的Windows是一件很简单的事。这里有详细的教程,还包括如何在你自己的计算机上避免这类事情的发生。 这里有好几种方法破解一台电脑,各有长短。我们挑选了三种比较流行的方法,并列出他们的优缺点,这样你可以根据实际情况选择还有根据他们的缺点进行防护。 最懒的办法:用一张Linu...
标签: 电脑入门
①我们启动Excel2013,打开被保护的工作簿,提示有密码。 ②按下键盘上的Ctrl+F11键,打开VBA编辑界面。 ③单击插入--模块,将下面的代码程序复制进去。 ④按下F5键执行宏,即可打开被保护的文件了。
第一种方法: 第一步:在Excel里面找到文件,在下拉栏里找到另存为。   第二步:在显示的对话栏里找到工具,在下拉栏里找到常规选项,打开。   第三步:出现一个设置密码的对话框,这里就根据自己的需求来设置密码,设置好之后点击确定。   第二种方...
标签: 电脑入门
由于工作需要,有时候需要破解MAXDOS的密码。下列方法可供使用: 启动到MAXDOS后,按 C 键,进入编辑界面,然后输入 map --mem /MaxDOS/Maxgzs.gz (fd0) map --hook chainloader (fd0)+1 rootnoverify (fd0) 选择你所输入的内容保存, 再进入你自己输入的部分,MAXDOS就没的密码了 方法二: 用记事本打开C:MaxDOSMaxkl.gz找到里面的pas...

经验教程

543

收藏

23
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部