Welcome!

Thank you visiting ICB - Iceberg Code Blog
This is the place, where I'd like to share ideas and some useful code (VB, Excel, T-SQL, JavaScript, ...)
Table of Content

Wednesday, March 29, 2006

When you forgot Password ... you need to break them!

It's easy because the Excel worksheet protection is not very strong.

For some people this a bug, for me it is ok, because I use protection
just to prevent end-user destruction! ... If You know what I mean.

So you can put any kind of password and forget it, because with
the code I post now you are no more in trouble.

personally I like this pwd "sdsadsadsdssdadadasdsadsadasdasdas"
(you can break with "AAAAAABBBBAe")

This code is not mine it comes from Aaron T. Blood web page
www.xl-logic.com/pages/vba.html
here the file (the original one):
password_hack.xls
After reading the code don't tell me that programming is not a kind of magic!

This is my first occasion to thank all the smart guy out there that likes to share
their knowledge!
Here's the code (I don't understand ... but I adapt myself):

Sub breakit()
Dim i As Integer, j As Integer, k As Integer,
Dim l As Integer, m As Integer, n As Integer
On Error Resume Next
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
ActiveSheet.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)
Application.StatusBar = 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 ActiveSheet.ProtectContents = False Then
MsgBox "One useble password is " & Chr(i) & Chr(j) & Chr(k) & Chr(l) & Chr(m) & _
  Chr(i1) & Chr(i2) & Chr(i3) & Chr(i4) & Chr(i5) & Chr(i6) & Chr(n)
Exit Sub
End If
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
Next
End Sub

Comments: Post a Comment



<< Home