教你5秒破解密碼,從此,沒有你打不開的excel
Excel忘記密碼怎麼?
前面我們分享了Excel工作表和工作簿的保護方法,然後有人問了……
像自習君這麼健忘的人,自己把自己設置的excel保護密碼忘記是常有的事,腫么辦呢?百度下載N多軟體破解也不行,還附帶了許多流氓軟體……
今天自習君就傳授大家3招破解大法,效果如何,皆看施主的修行……
1、用AOPR軟體破解——親測有效
AOPR是ADVANCED OFFICEPASSWORD RECOVERY的縮寫。這是一款市面上主流的office密碼破解工具,可對95-2016版本的任何Office文檔進行解密。
但AOPR的致命缺點是——要收費,當然,還有免費版本的,又不過呢,免費的只能破解4個字元以內的密碼。這對很多人來說已經夠了。
下面,我們一起來試一試吧。這個軟體下載和安裝都非常方便
軟體獲取辦法:
微信公眾號(excel自習室)後台回復:破解
AOPR官方網下載:http://www.passwordrecovery.cn/QQ群共享文件:657967533
如果英文不好的,還可以選擇中文顯示
下面是破解的結果,一切密碼都暴露無遺呀(不騙你,真的只用了5秒)
這也說明了office excel 加密的安全級別並不高
(如果軟體運行不了,把殺毒軟體關了再試試吧)
2、用VBA代碼破解
要輸入VBA,首先必須打開工作簿才行,所以該法不適合「打開工作簿需要密碼」的情況。
很多人覺得VBA太難,不懂操作。其實,你不需要懂VBA,只需要懂複製黏貼就可以了。
具體操作如下:
打開需要破解的工作簿——調出VB編輯器(Alt+F11)——粘貼下面這段代碼——運行代碼(F5)
代碼1如下(適合office2007-2016)
Sub PJ()n Dim sht AsWorksheetn For Each sht InWorksheetsn sht.Protect AllowFiltering:=Truen sht.Unprotectn NextnEnd Subn
代碼2如下(適合office97-2003)
Public Sub AllInternalPasswords() n Breaks worksheet and workbook structure passwords. Bob McCormick n probably originator of base code algorithm modified for coverage n of workbook structure / windows passwords and for multiple passwords n n Norman Harker and JE McGimpsey 27-Dec-2002 (Version 1.1) n Modified 2003-Apr-04 by JEM: All msgs to constants, and n eliminate one Exit Sub (Version 1.1.1) n Reveals hashed passwords NOT original passwords nConst DBLSPACE As String = vbNewLine & vbNewLine nConst AUTHORS As String = DBLSPACE & vbNewLine & _ n"Adapted from Bob McCormick base code by" & _ n"Norman Harker and JE McGimpsey" nConst HEADER As String = "AllInternalPasswords User Message" nConst VERSION As String = DBLSPACE & "Version 1.1.1 2003-Apr-04" nConst REPBACK As String = DBLSPACE & "Please report failure " & _ n"to the microsoft.public.excel.programming newsgroup." nConst ALLCLEAR As String = DBLSPACE & "The workbook should " & _ n"now be free of all password protection, so make sure you:" & _ nDBLSPACE & "SAVE IT NOW!" & DBLSPACE & "and also" & _ nDBLSPACE & "BACKUP!, BACKUP!!, BACKUP!!!" & _ nDBLSPACE & "Also, remember that the password was " & _ n"put there for a reason. Dont stuff up crucial formulas " & _ n"or data." & DBLSPACE & "Access and use of some data " & _ n"may be an offense. If in doubt, dont." nConst MSGNOPWORDS1 As String = "There were no passwords on " & _ n"sheets, or workbook structure or windows." & AUTHORS & VERSION nConst MSGNOPWORDS2 As String = "There was no protection to " & _ n"workbook structure or windows." & DBLSPACE & _ n"Proceeding to unprotect sheets." & AUTHORS & VERSION nConst MSGTAKETIME As String = "After pressing OK button this " & _ n"will take some time." & DBLSPACE & "Amount of time " & _ n"depends on how many different passwords, the " & _ n"passwords, and your computers specification." & DBLSPACE & _ n"Just be patient! Make me a coffee!" & AUTHORS & VERSION nConst MSGPWORDFOUND1 As String = "You had a Worksheet " & _ n"Structure or Windows Password set." & DBLSPACE & _ n"The password found was: " & DBLSPACE & "$$" & DBLSPACE & _ n"Note it down for potential future use in other workbooks by " & _ n"the same person who set this password." & DBLSPACE & _ n"Now to check and clear other passwords." & AUTHORS & VERSION nConst MSGPWORDFOUND2 As String = "You had a Worksheet " & _ n"password set." & DBLSPACE & "The password found was: " & _ nDBLSPACE & "$$" & DBLSPACE & "Note it down for potential " & _ n"future use in other workbooks by same person who " & _ n"set this password." & DBLSPACE & "Now to check and clear " & _ n"other passwords." & AUTHORS & VERSION nConst MSGONLYONE As String = "Only structure / windows " & _ n"protected with the password that was just found." & _ nALLCLEAR & AUTHORS & VERSION & REPBACK nDim w1 As Worksheet, w2 As Worksheet nDim i As Integer, j As Integer, k As Integer, l As Integer nDim m As Integer, n As Integer, i1 As Integer, i2 As Integer nDim i3 As Integer, i4 As Integer, i5 As Integer, i6 As Integer nDim PWord1 As String nDim ShTag As Boolean, WinTag As Boolean nApplication.ScreenUpdating = False nWith ActiveWorkbook nWinTag = .ProtectStructure Or .ProtectWindows nEnd With nShTag = False nFor Each w1 In Worksheets nShTag = ShTag Or w1.ProtectContents nNext w1 nIf Not ShTag And Not WinTag Then nMsgBox MSGNOPWORDS1, vbInformation, HEADER nExit Sub nEnd If nMsgBox MSGTAKETIME, vbInformation, HEADER nIf Not WinTag Then nMsgBox MSGNOPWORDS2, vbInformation, HEADER nElse nOn Error Resume Next nDo dummy do loop nFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66 nFor l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 nFor i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 nFor i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 nWith ActiveWorkbook n.Unprotect Chr(i) & Chr(j) & Chr(k) & _ nChr(l) & Chr(m) & Chr(i1) & Chr(i2) & _ nChr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n) nIf .ProtectStructure = False And _ n.ProtectWindows = False Then nPWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _ nChr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ nChr(i4) & Chr(i5) & Chr(i6) & Chr(n) nMsgBox Application.Substitute(MSGPWORDFOUND1, _ n"$$", PWord1), vbInformation, HEADER nExit Do Bypass all for...nexts nEnd If nEnd With nNext: Next: Next: Next: Next: Next nNext: Next: Next: Next: Next: Next nLoop Until True nOn Error GoTo 0 nEnd If nIf WinTag And Not ShTag Then nMsgBox MSGONLYONE, vbInformation, HEADER nExit Sub nEnd If nOn Error Resume Next nFor Each w1 In Worksheets nAttempt clearance with PWord1 nw1.Unprotect PWord1 nNext w1 nOn Error GoTo 0 nShTag = False nFor Each w1 In Worksheets nChecks for all clear ShTag triggered to 1 if not. nShTag = ShTag Or w1.ProtectContents nNext w1 nIf ShTag Then nFor Each w1 In Worksheets nWith w1 nIf .ProtectContents Then nOn Error Resume Next nDo Dummy do loop nFor i = 65 To 66: For j = 65 To 66: For k = 65 To 66 nFor l = 65 To 66: For m = 65 To 66: For i1 = 65 To 66 nFor i2 = 65 To 66: For i3 = 65 To 66: For i4 = 65 To 66 nFor i5 = 65 To 66: For i6 = 65 To 66: For n = 32 To 126 n.Unprotect Chr(i) & Chr(j) & Chr(k) & _ nChr(l) & Chr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ nChr(i4) & Chr(i5) & Chr(i6) & Chr(n) nIf Not .ProtectContents Then nPWord1 = Chr(i) & Chr(j) & Chr(k) & Chr(l) & _ nChr(m) & Chr(i1) & Chr(i2) & Chr(i3) & _ nChr(i4) & Chr(i5) & Chr(i6) & Chr(n) nMsgBox Application.Substitute(MSGPWORDFOUND2, _ n"$$", PWord1), vbInformation, HEADER nleverage finding Pword by trying on other sheets nFor Each w2 In Worksheets nw2.Unprotect PWord1 nNext w2 nExit Do Bypass all for...nexts nEnd If nNext: Next: Next: Next: Next: Next nNext: Next: Next: Next: Next: Next nLoop Until True nOn Error GoTo 0 nEnd If nEnd With nNext w1 nEnd If nMsgBox ALLCLEAR & AUTHORS & VERSION & REPBACK, vbInformation, HEADER nEnd Subn
3、通過修改源代碼破解
大家發現沒有,office2007開始,文件的後綴名發生了改變,比如xls變為xlsx。
而xlsx格式本質上就是壓縮包,我們可以通過修改後綴名直接獲取excel的源文件。
① 修改Excel後綴名為.rar(期間會提出警告,但不用理它,點「是」即可)
② 找到需要破解的工作表,具體路徑為:
壓縮包.rarxlworksheets
③ 將sheet2.xlm文件(此處根據自己需要選擇文件)複製到桌面;用記事本打開,查找到加密代碼,刪掉;再將文件複製回壓縮包替換掉老文件即可。
加密代碼通常可以從後往前找,含有「protectedRange algorithmName」的整個<>裡面內容都是加密代碼,都要刪掉,包括<>本身。
④ 最後一步,將壓縮包的後綴名改回.xlsx,大功告成。此時工作表的密碼已經被移除了。
以上步驟看起來很複雜,理順一下思路,原理非常簡單,我們只是把源代碼的加密代碼部分刪掉了而已。
最後,如果只是工作表加密了,我們要修改其中的數據,完全不必大費周章,只需把數據複製到了一個工作表即可。
這也提醒我們,要想別人不輕易盜取你的數據,在設置保護工作表的時候記得去掉「選定單元格」選項前面的√。
...更多回答請看Excel自習室的主頁
...更多文章請到Excel自習室(專欄) - 知乎專欄
推薦閱讀:
※Excel VBA 基礎(01.3)
※Excel中如何製作雙層餅圖
※如何解決Power BI在線版和本地版的時區差異問題
※百分比堆積柱形圖
※不為人知的Excel轉壓縮包逆天功能
TAG:MicrosoftExcel | Excel使用 | Excel技巧 |