write at exceltoexplore@gmail.com : Report Automation|Dashboard in Excel| Provide Excel consulting through macro (VBA) automation |Financial Modeling | Ethical Hacking

Monday 14 May 2012

Excel : Unlock Workbook And Unlock Worksheet

If you have forgotten your workbook or worksheet password. You will find below information helpful to unprotect excel workbook or worksheet password

The code below can unlock a workbook password and sheet passwords
Module provides Excel workbook and sheet unlock routines. The algorithm
relies on a backdoor password that can be 1 to 9 characters long where each
character is either an "A" or "B" except the last which can be any character
from ASCII (American Standard Code for Information Interchange) code 32 to 255.Implemented as a regular module for use with any Excel VBA project.

Code by : Kevin M. Jones

Option Explicit
Private Sub DisplayStatus( _
ByVal PasswordsTried As Long _
)
' Display the status in the Excel status bar.
' Syntax
' DisplayStatus(PasswordsTried)
' PasswordsTried - The number of passwords tried thus far.
Static LastStatus As String
LastStatus = Format(PasswordsTried / 57120, "0%") & " of possible passwords tried."
If Application.StatusBar <> LastStatus Then
Application.StatusBar = LastStatus
DoEvents
End If
End Sub
Private Function TrySheetPasswordSize( _
ByVal Size As Long, _
ByRef PasswordsTried As Long, _
ByRef Password As String, _
Optional ByVal Base As String _
) As Boolean
' Try unlocking the sheet with all passwords of the specified size.
' TrySheetPasswordSize(Size, PasswordsTried, Password, [Base])
' Size - The size of the password to try.
' PasswordsTried - The cummulative number of passwords tried thus far.
' Password - The current password.
' Base - The base password from the calling routine.
Dim Index As Long
On Error Resume Next
If IsMissing(Base) Then Base = vbNullString
If Len(Base) < Size - 1 Then
For Index = 65 To 66
If TrySheetPasswordSize(Size, PasswordsTried, Password, Base & Chr(Index)) Then
TrySheetPasswordSize = True
Exit Function
End If
Next Index
ElseIf Len(Base) < Size Then
For Index = 32 To 255
ActiveSheet.Unprotect Base & Chr(Index)
If Not ActiveSheet.ProtectContents Then
TrySheetPasswordSize = True
Password = Base & Chr(Index)
Exit Function
End If
PasswordsTried = PasswordsTried + 1
Next Index
End If
On Error GoTo 0
DisplayStatus PasswordsTried
End Function

 
Private Function TryWorkbookPasswordSize( _
ByVal Size As Long, _
ByRef PasswordsTried As Long, _
ByRef Password As String, _
Optional ByVal Base As String _
) As Boolean
' Try unlocking the workbook with all passwords of the specified size.
' TryWorkbookPasswordSize(Size, PasswordsTried, Password, [Base])
' Size - The size of the password to try.
' PasswordsTried - The cummulative number of passwords tried thus far.
' Password - The current password.
' Base - The base password from the calling routine.
Dim Index As Long
On Error Resume Next
If IsMissing(Base) Then Base = vbNullString
If Len(Base) < Size - 1 Then
For Index = 65 To 66
If TryWorkbookPasswordSize(Size, PasswordsTried, Password, Base & Chr(Index)) Then
TryWorkbookPasswordSize = True
Exit Function
End If
Next Index
ElseIf Len(Base) < Size Then
For Index = 32 To 255
ActiveWorkbook.Unprotect Base & Chr(Index)
If Not ActiveWorkbook.ProtectStructure And Not ActiveWorkbook.ProtectWindows Then
TryWorkbookPasswordSize = True
Password = Base & Chr(Index)
Exit Function
End If
PasswordsTried = PasswordsTried + 1
Next Index
End If
On Error GoTo 0
DisplayStatus PasswordsTried
End Function

 

Public Sub UnlockSheet()

' Unlock the active sheet using a backdoor Excel provides where an alternate

' password is created that is more limited.

Dim PasswordSize As Variant
Dim PasswordsTried As Long
Dim Password As String
PasswordsTried = 0
If Not ActiveSheet.ProtectContents Then
MsgBox "The sheet is already unprotected."
Exit Sub
End If
On Error Resume Next
ActiveSheet.Protect ""
ActiveSheet.Unprotect ""
On Error GoTo 0
If ActiveSheet.ProtectContents Then
For Each PasswordSize In Array(5, 4, 6, 7, 8, 3, 2, 1)
If TrySheetPasswordSize(PasswordSize, PasswordsTried, Password) Then Exit For
Next PasswordSize
End If
If Not ActiveSheet.ProtectContents Then
MsgBox "The sheet " & ActiveSheet.Name & " has been unprotected with password '" & Password & "'."
End If
Application.StatusBar = False
End Sub

 

Public Sub UnlockWorkbook()
' Unlock the active workbook using a backdoor Excel provides where an alternate
' password is created that is more limited.
Dim PasswordSize As Variant
Dim PasswordsTried As Long
Dim Password As String
PasswordsTried = 0
If Not ActiveWorkbook.ProtectStructure And Not ActiveWorkbook.ProtectWindows Then
MsgBox "The workbook is already unprotected."
Exit Sub
End If
On Error Resume Next
ActiveWorkbook.Unprotect vbNullString
On Error GoTo 0
If ActiveWorkbook.ProtectStructure Or ActiveWorkbook.ProtectWindows Then
For Each PasswordSize In Array(5, 4, 6, 7, 8, 3, 2, 1)
If TryWorkbookPasswordSize(PasswordSize, PasswordsTried, Password) Then Exit For
Next PasswordSize
End If
If Not ActiveWorkbook.ProtectStructure And Not ActiveWorkbook.ProtectWindows Then
MsgBox "The workbook " & ActiveWorkbook.Name & " has been unprotected with password '" & Password & "'."
End If
Application.StatusBar = False
End Sub

1 comment:

  1. RECOVERY OF LOST FUNDS (BINARY OPTIONS, BITCOINS, LOAN SCAM).
    THINGS YOU NEED TO KNOW ABOUT THE GLOBALKOS HACKS RECOVERY COMPANY.
    (leroysteckler@gmail.com)
    ⏱️2MIN.
    Hiring a professional hacker has been one of the world most technical valued navigating information. High prolific information and Privileges comes rare as it has been understood that what people do not see, they will never know.
    Welcome to the Global KOS hacking agency where every request concerning lost funds are recovered within a short period of time.
    The crucial benefit of contacting The Global-KOS hackers is
    • ZERO TRACES: When a hack is accomplished by us, no tracking base method will be used to trace any of our hacks to our clients or our organization because we use a strong proxy firewall switching and a firm security system to prevent unauthorized bodies from tracking or modifying our network accessible resources. I.e the hacker and clients are 100% safe and anonymous. Secondly,
    ADVANTAGE TO CLIENTS:
    • REPEAT CLIENTS and SERVICES: E.g, after helping a client recover all money lost to fraudulent practices, most of this clients comes back requesting we provide the same service in disguise as another person. We found a way to issue serial Numbers to each clients who seeks our help and services for identification purposes because we are not interested in your names nor location. But we urge that individuals shouldn't abuse this opportunities as we have provided value to you.
    However, when you wonder “which hacking company should I hire, the crucial aspect that should concern you is swift response. Clearly, you want to embark for services that provide swift responses. It's takes a test to find out our service imply precision and action.
    On this platform of recovery, you will be assigned to a designated professional hacker who is systematically known for operating on a dark web protocol. The operation of these hackers is to potentially deploy a distinguished cyber security technique to retrieving back the victims stolen funds via the application of a diverse intercall XX breacher which enables you to track the data location of a scammer. And extract every informations on the con database. Every information required by the Global KOS would be used to make this trace to navigate into every transaction, time and location of the scammer. This is achieved using the systematic courier tracking method.
    Which of the uneasy financial situation do you find youreslf in right now?
    ✅(BITCOIN INVESTMENTS, BINARY OPTIONS AND LOAN SCAM?
    This shocking study points to one harsh reality we all face today. It saddens our mind when a client expresses annoyance or dissatisfaction of unethical behaviors of scammers. We have striven to make tenacious efforts to help those who are victims of this fleas get off their traumatic feeling of loss.
    Our strength is based on the ability to help fix cyber problems by bringing together active cyber professionals in the GlobalkOS to work with.
    For prolific services and info,
    Contact:
    ✉️Email: theglobalkos@gmail.com
    leroysteckler@gmail.com
    ®Global KOS™
    2020.


    ReplyDelete