From: Yuhler G on

On article <4b1c11d8$0$5329$9a566e8b(a)news.aliant.net>, wrote:

[...]
>
> Please post the VBS script. I'll check out that reference too as well. Thank
> you.
>
> Dugie
>
>
>
YW.

Get the original from here: http://www.sendspace.com/file/vlq6k1

It shall be available for 30 days or so. Let me know if it arrived
ok.

--
Best,
Yuhler G.

Reply-To: partially ROT13, invalid=com
Due to spam I'm filtering-out GoogleGroups. Sorry. :(
From: H-Man on
On Sat, 05 Dec 2009 08:48:34 -0600, hmmm wrote:

> I have an old Excel spreadsheet and I can't remember the password.
> Are there any free tools available? I see there are several payware tools
> available.

If it's to unprotect sheets, let me know, I have an add-in that will
unprotect sheet as is required. It will also report the first password that
works for later use. Once the sheets are unprotected you can change the
protection settings and resave.

If this will work for you, let me know and I can post it somewhere.

--
HK
From: "Dugie" d_fren at hotmail with a dot on
"Yuhler G" <rstrezna.hfrarg(a)znvyahyy.invalid> wrote in message
news:MPG.258612edbd568f5a9896ad(a)news.eternal-september.org...
>
> On article <4b1c11d8$0$5329$9a566e8b(a)news.aliant.net>, wrote:
>
> [...]
> >
> > Please post the VBS script. I'll check out that reference too as well.
Thank
> > you.
> >
> > Dugie

> YW.
>
> Get the original from here: http://www.sendspace.com/file/vlq6k1
>
> It shall be available for 30 days or so. Let me know if it arrived
> ok.
>
> --
> Best,
> Yuhler G.

I have the file. Now what? Scripts are new to me. :)

Dugie


From: H-Man on
On Mon, 7 Dec 2009 16:03:23 -0400, Dugie wrote:

> "Yuhler G" <rstrezna.hfrarg(a)znvyahyy.invalid> wrote in message
> news:MPG.258612edbd568f5a9896ad(a)news.eternal-september.org...
>>
>> On article <4b1c11d8$0$5329$9a566e8b(a)news.aliant.net>, wrote:
>>
>> [...]
>>>
>>> Please post the VBS script. I'll check out that reference too as well.
> Thank
>>> you.
>>>
>>> Dugie
>
>> YW.
>>
>> Get the original from here: http://www.sendspace.com/file/vlq6k1
>>
>> It shall be available for 30 days or so. Let me know if it arrived
>> ok.
>>
>> --
>> Best,
>> Yuhler G.
>
> I have the file. Now what? Scripts are new to me. :)
>
> Dugie

In the script there's a couple of things you'll want to look at.

1) The line where it says strFilePath = "c:\Run.xls"
"c:\Run.xls" is the name of the file it's looking for so either change
this path and filename to reflect the file you want to decrypt or simply
put a copy of your file in the C:\ path and rename it to Run.xls.

2) on the line wscript.echo strCPWD you'll want to put a single quote in
front of that line, otherwise you'll have to acknowledge every password
tried.

There are further limitations to this script. The script only checks
alphanumeric combinations, so if someone used a special character like a
comma or period or even a space in their password, the script will not
work. The password generator did weird things like it would never have
found a password of a single lowercase character or it would never have
found a purely numeric password. The biggest limitation is the brute force
attack method. I don't know of another attack on an Excel file, so this is
not to cast stones at the original author, to be sure the script is quite
useful, but you should be aware that a 3 character password could take 10
to 15 minutes, each additional character could take up to 62 times longer
than the password length before it, so it might be best to let it run
overnight.

To get around some of these limitations, you can include additional
character sets and so forth to allow for a worst case scenario, but the
crack time will increase exponentially.

The script however, is a great place to start and I thank the original
author for sharing.

I'm including my 'fixed' version of this script here, if you would like to
include additional characters, post back here and I can open it up a bit.
I would have completely rewritten the NextPW function to make it a little
less, well awkward, but this works, (watch for line wrap)

'~~[author]~~
'Jim Jackson
' slightly modified by HK
'~~[/author]~~

'~~[emailAddress]~~
'j3dante37(a)gmail.com
'~~[/emailAddress]~~

'~~[scriptType]~~
'vbscript
'~~[/scriptType]~~

'~~[subType]~~
'Misc
'~~[/subType]~~

'~~[keywords]~~
'Brute,force,excel,password
'~~[/keywords]~~

'~~[comment]~~
'Script runs a Brute Force attack against a password protected Excel file.
Uses lower and uppercase Alphanumeric characters.
'~~[/comment]~~

'~~[script]~~
'@@@ Script runs a Brute Force attack
'@@@ on an Excel File that is password protected for open
'@@@ Created by Jim Jackson MCP
'@@@ Created on 4/20/2005

dim strCPWD, curPW, Found
Found = 0
strFilePath = "c:\Run.xls"
strCPWD = "0"
Set objExcel = CreateObject("Excel.Application")

Do While Found = 0
on error resume next
objExcel.Workbooks.Open strFilePath, , , ,strCPWD
' remarked out the following line to avoid msgbox for each pwd (HK)
'wscript.echo strCPWD
Error_Handle
Loop

Sub Error_Handle
if err.number = 1004 then
strCPWD = NextPW(strCPWD, False, 0)
err.clear
elseif err.number <> 0 then
wscript.echo "Other Error: " & vbcrlf & "Number: " & err.number &
vbcrlf & "Description: " & _
err.description & vbcrlf & "Password: " & strCPWD
wscript.quit
else
wscript.Echo "Password Found: " & strCPWD
Found = 1
end if
end sub

'this function is changed from the original to cover every combination
' of intended character sets
Function NextPW(startPW, noChange, startLength)
Dim pw, i , s

If startPW <> "" And curPW = "" Then
curPW = startPW
NextPW = curPW
Exit Function
End If

If curPW = "" Then
curPW = String(startLength, 48)
NextPW = curPW
Exit Function
End If

If curPW = String(Len(curPW), 122) Then
NextPW = String(Len(curPW) + 1, 48)
If noChange = False Then curPW = NextPW
Exit Function
End If

ReDim pw(Len(curPW))

For i = 1 To Len(curPW)
pw(i) = Mid(curPW, i, 1)
Next

i = UBound(pw)
x = 1

Do while x = 1'donextchar:
x = 0
s = Asc(pw(i)) + 1
Select Case s
Case 58
pw(i) = Chr(65)
Case 91
pw(i) = Chr(97)
Case 123
pw(i) = Chr(48)
i = i - 1
x = 1'GoTo donextchar
Case Else
pw(i) = Chr(s)
End Select
loop

For s = LBound(pw) To UBound(pw)
NextPW = NextPW & pw(s)
Next

If noChange = False Then curPW = NextPW

End Function
'~~[/script]~~


--
HK
From: "Dugie" d_fren at hotmail with a dot on
"H-Man" <Spam(a)bites.fs> wrote in message
news:4b1e8f5a$0$65839$892e0abb(a)auth.newsreader.octanews.com...
> On Mon, 7 Dec 2009 16:03:23 -0400, Dugie wrote:
>
> > "Yuhler G" <rstrezna.hfrarg(a)znvyahyy.invalid> wrote in message
> > news:MPG.258612edbd568f5a9896ad(a)news.eternal-september.org...
> >>
> >> On article <4b1c11d8$0$5329$9a566e8b(a)news.aliant.net>, wrote:
> >>
> >> [...]
> >>>
> >>> Please post the VBS script. I'll check out that reference too as well.
> > Thank
> >>> you.
> >>>
> >>> Dugie
> >
> >> YW.
> >>
> >> Get the original from here: http://www.sendspace.com/file/vlq6k1
> >>
> >> It shall be available for 30 days or so. Let me know if it arrived
> >> ok.
> >>
> >> --
> >> Best,
> >> Yuhler G.
> >
> > I have the file. Now what? Scripts are new to me. :)
> >
> > Dugie
>
> In the script there's a couple of things you'll want to look at.
>
> 1) The line where it says strFilePath = "c:\Run.xls"
> "c:\Run.xls" is the name of the file it's looking for so either change
> this path and filename to reflect the file you want to decrypt or simply
> put a copy of your file in the C:\ path and rename it to Run.xls.
>
> 2) on the line wscript.echo strCPWD you'll want to put a single quote in
> front of that line, otherwise you'll have to acknowledge every password
> tried.
>
> There are further limitations to this script. The script only checks
<snip>
> I'm including my 'fixed' version of this script here, if you would like to
> include additional characters, post back here and I can open it up a bit.
> I would have completely rewritten the NextPW function to make it a little
> less, well awkward, but this works, (watch for line wrap)
<snip>
> --
> HK

I appreciate your effort, explanations and modified script, H-Man!

My original post states this is for a WORD file, ie. .DOC. Yesterday I
noticed the original script called for "c:\Run.xls" so I did copy & rename
the doc file to that location. Got an error: "file format it not valid."

Word wrap is a problem: scripting is new to me, so I don't always recognize
a wrapped line.

After spending some time trying to modifying the script, I've given up. :)

Dugie