2015年5月31日星期日

Excel_password


Tuesday, October 4, 2011

Excel VBA Brute Force Override v0.2a

Option Explicit
Option Private Module

Sub BruteForce_Override()
On Error GoTo ErrorHandler
  
    Dim i As Byte, j As Byte, k As Byte
    Dim l As Byte, m As Byte, n As Byte
    Dim o As Byte, p As Byte, q As Byte
    Dim r As Byte, s As Byte, t As Byte
    Dim x As Integer, PassWd_Try As String
  
    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 n = 65 To 66
    For o = 65 To 66: For p = 65 To 66: For q = 65 To 66
    For r = 65 To 66: For s = 65 To 66:
    Application.StatusBar = x & "/194,560 Possible"
    x = x + 94: For t = 1 To 126: DoEvents
  
    PassWd_Try = Chr(i) & Chr(j) & Chr(k) & _
       Chr(l) & Chr(m) & Chr(n) & Chr(o) & Chr(p) & _
       Chr(q) & Chr(r) & Chr(s) & Chr(t + 31)
                
    ActiveSheet.Unprotect Password:=PassWd_Try
    If ActiveSheet.ProtectContents = False Then
        MsgBox "Overide String Located:" & Chr(13) & _
             PassWd_Try & Chr(13) & Chr(13) & _
             "The Password has been overriden." & Chr(13) & _
        "Do not save this file (with the same name)" & _
        "or your breach may be detected.", _
            vbExclamation, "Password Overridden"
        Application.StatusBar = False
        Exit Sub
    End If
  
   Next: Next: Next: Next: Next: Next
   Next: Next: Next: Next: Next: Next

Application.StatusBar = False
Exit Sub

ErrorHandler:
    Select Case Err.Number
        Case 1004 'Password Incorrect
            Resume Next
        Case Else
            MsgBox Err.Source & Chr(13) & Err.Description, vbCritical, "Unknown Error #" & Err.Number
            Application.StatusBar = False
            On Error Goto 0
            Exit Sub
    End Select
 End Sub

没有评论:

发表评论