Pete Finnigan's Oracle Security Forum (http://www.petefinnigan.com/forum/yabb/YaBB.cgi)
Oracle Security >> Oracle Security tools >> hashattack a dictionary attack tool for Oracle
(Message started by: Pete Finnigan on Aug 8th, 2005, 10:38pm)

Title: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 8th, 2005, 10:38pm
Josh Wright has written a set of PL/SQL scripts that can be used to pre-compute password hashes for an Oracle user account. The results are stored in a table and this table can then be used at a later date to check any other database for the password of the same account.

The generation of the password hashes takes time up front but the table of results can be used many times again. This is useful for default accounts such as SYS, SYSTEM, DBSNMP and OUTLN.

I just discussed the tool in my blog in a post titled "[url http://www.petefinnigan.com/weblog/archives/00000502.htm]Joshua Wright has provided a free tool to check Oracle accounts for common passwords[/url]" - the code is available from Josh at [url http://802.11ninja.net/code/hashattack-0.1.tgz]Hashattack[/url]

Any comments, suggestions, improvements, then please let us know

cheers

Pete

Title: Re: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 9th, 2005, 7:55am
Had a quick look at this.
I think the speed could be considerably improved if the cleartext passwords were loaded into a table rather than read using UTL_FILE.
Also, there's no need for the INSERT to be done with EXECUTE IMMEDIATE which will have an additional parsing overhead.



Title: Re: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 9th, 2005, 3:40pm
Hi Gary,

Thanks for the suggestions. Josh is a member here so hopefully he will jump in and contribute.

I thought about the same myself yesterday (about loading the passwords) and sent an email to Josh to see if he could do it. The Adam Martin tool installed a big list of dictionary words into a table with a set of insert statements. The same could be done with SQL*Loader - which should be the fastest method.

A pre-created table exported would be an alternate solution - I could host this here depending on its size.

Your other suggestion about not using execute immediate is also valid, dynamic SQL is always slower and of course presents a risk of SQL Injection.

cheers

Pete

Title: Re: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 10th, 2005, 1:01am
The USAGE file with the downlead mentions a precreated file : hashattack-system-35m-rec.csv.bz2
with "~3.5 million passwords for the SYSTEM account"

A quick estimate would give that about 100-150 Mb uncompressed.

Another advantage of a table loaded password list, is that you could easily add mangled passwords with things like
INSERT ... SELECT translate(password,'OL','01')

PS. If he does read this, it probably worth including in the USAGE notes that anyone running it should ensure the profile for the created user has any password reuse checking disabled as that would almost certainly kill performance.

Title: Re: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 11th, 2005, 7:19pm
Pete, gaymers,

Thanks for the comments on the hashattack tool, I appreciate your feedback.

I implemented some of your suggestions, and re-wrote how I'm obtaining the dictionary words in this 2nd version of the tool.  Instead of reading one word at a time with utl_file, I create a directory object and an external table to refer to the wordlist, then I use a CTAS statement to create a table with all the dictionary words.

Once the dictionary words are populated in the table, I LOOP through a cursor for each dictionary word with ALTER USER and an INSERT into the hashattack table.  I removed the unnecessary EXECUTE IMMEDIATE for the insert as well.

Here is how performance looks on my P4 3.4 GHz 9.2.0.1.0 Linux database:

hashattack 0.1.0 - 25k words completed in 245 seconds
hashattack 0.2.0 - 25k words completed in 198 seconds

That's a decent performance boost, plus it allows me to add a "password permutation mode" feature like both of you suggested using translate().

The new version is up at http://802.11ninja.net/code/hashattack-0.2.0.tgz.  I'd love feedback and comments on my puny PL/SQL coding style. :)

Thanks!

-Josh

Title: Re: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 11th, 2005, 10:43pm
Hi Josh,

Thanks very much for the updated version. I have added a link to it on my tools page and also downloaded it.

I have had a look at the code and will have a play with it later.

cheers

Pete

Title: Re: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 12th, 2005, 8:06am
This morning I tried to download hashattack-0.2.tgz, but it wasn't available. hashattack-0.1.tgz is available, I've noticed after altering the URL slightly.

Apparently this tool doesn't go unnoticed as I found while searching on the Internet: http://www.indianz.ch/toolslnxe.html.

Title: Re: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 12th, 2005, 11:13am
Hi Marcel-Jan,

Welcome to the forum!, I just tried the link again for hashattack 2.0 and it works for me. I just downloaded it again and unzipped it fine. Maybe Josh's site was down when you tried?, although if you were able to get version 1.0 that theory doesn't hold true. Anyway it just worked for me.

cheers

Pete

Title: Re: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 13th, 2005, 9:22pm
Hi Pete,

I've tried to download it several times from both work and home locations, with both Mozilla Firefox and Internet Explorer. I've also tried it at several times on the day, but the message is the same everytime:

Not Found
The requested URL /code/hashattack-0.2.tgz was not found on this server.

???

Title: Re: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 14th, 2005, 9:32pm
Hi Marcel-Jan,

Not sure what your issue is, I just tried it again and it was OK. maybe Josh could check his logs and see if there is a generic download issue.

In the meantime I have just emailed hashattack 2.0 to you.

cheers

Pete

Title: Re: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 15th, 2005, 8:51am
Thanks a lot. I got it this time :)

Title: Re: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 15th, 2005, 9:40pm
Hi guys,

Note that the URL is http://802.11ninja.net/code/hashattack-0.2.0.tgz - not "hashattack-0.2.tgz".

Thanks!

-Josh

Title: Re: hashattack a dictionary attack tool for Oracle
Post by Pete Finnigan on Aug 16th, 2005, 8:41pm
OK, we now might be getting somewhere. The link in Josh's last reply is correct and works and I have also fixed the link on my [url http://www.petefinnigan.com/tools.htm]tools page[/url] which was missing a "0" in the URL.

Thanks for the correction Josh.

cheers

Pete



Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright 2000-2004 Yet another Bulletin Board