Database Password Hashes Cracking

April 15, 2008 Research | Comments (1) sid @ 8:42 am

SQL Server 2000:-

SELECT password from master.dbo.sysxlogins where name='sa' 

0×010034767D5C0CFA5FDCA28C4A56085E65E882E71CB0ED250341

2FD54D6119FFF04129A1D72E7C3194F7284A7F3A

0×0100- constant header

34767D5C- salt

0CFA5FDCA28C4A56085E65E882E71CB0ED250341- case senstive hash

2FD54D6119FFF04129A1D72E7C3194F7284A7F3A- upper case hash

crack the upper case hash in 'cain and abel' and then work the case sentive hash

 

SQL server 2005:-

SELECT password_hash FROM sys.sql_logins where name='sa'

0×0100993BF2315F36CC441485B35C4D84687DC02C78B0E680411F

0×0100- constant header

993BF231-salt

5F36CC441485B35C4D84687DC02C78B0E680411F- case sensitive hash

crack case sensitive hash in cain, try brute force and dictionary based attacks.

 

update:- following bernardo's comments:-

use function fn_varbintohexstr() to cast password in a hex string. 

e.g. select name from sysxlogins union all select master.dbo.fn_varbintohexstr(password)from sysxlogins 

 

MYSQL:-

In MySQL you can generate hashes internally using the password(), md5(), or sha1 functions. password() is the function used for MySQL's own user authentication system. It returns a 16-byte string for MySQL versions prior to 4.1, and a 41-byte string (based on a double SHA-1 hash) for versions 4.1 and up. md5() is available from MySQL version 3.23.2 and sha1() was added later in 4.0.2.

 

*mysql  < 4.1

 

mysql> SELECT PASSWORD('mypass');

+——————–+

| PASSWORD('mypass') |

+——————–+

| 6f8c114b58f2ce9e   |

+——————–+

 

*mysql >=4.1

 

mysql> SELECT PASSWORD('mypass');

+——————————————-+

| PASSWORD('mypass')                        |

+——————————————-+

| *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |

+——————————————-+

Select user, password from mysql.user

The hashes can be cracked in 'cain and abel' 

 

Postgres:-

Postgres keeps MD5-based password hashes for database-level users in the pg_shadow table.  You need to be the database superuser to read this table (usually called "postgres" or "pgsql")

select usename, passwd from pg_shadow;

     usename      |  passwd                

——————+————————————- 

testuser            | md5fabb6d7172aadfda4753bf0507ed4396

use mdcrack to crack these hashes:-

$ wine MDCrack-sse.exe –algorithm=MD5 –append=testuser fabb6d7172aadfda4753bf0507ed4396

Oracle:-

select name, password, spare4 from sys.user$

hashes could be cracked using 'cain and abel' or thc-orakelcrackert11g

More on Oracle later, i am a bit bored…. 

References/Copied from:-

http://hkashfi.blogspot.com/2007/08/breaking-sql-server-2005-hashes.html

http://dev.mysql.com/doc/refman/5.0/en/password-hashing.html

http://pentestmonkey.net/blog/cracking-postgres-hashes/

http://freeworld.thc.org/thc-orakelcrackert11g/

Xgrid Controller, Mac Unleashed

March 2, 2008 Research | Comments (0) sid @ 9:58 pm

 I have been using Mac OSX since last few months, and its fun to explore things which apple do. Apple in 2004 introduced XGrid, which allows you to utilize the resources of different Mac OS in your network and gain a considerable performance boost. Here is a great article, talking about How to Turn Your Macs into a Super Computer

The thing which immediately comes to my mind is, whether we can use this in password cracking. I could not find any mention of this on John-the-ripper website. A few emails discussing this could be read here

Security Of Flash Games

February 20, 2008 Research | Comments (0) sid @ 9:44 am

A number of websites allow users to play flash games online and then submit their score. After the competition end, the user with highest score wins a prize. A major problem which such websites face, is, how do they ensure user submits the correct score?

The scores submitted by user is mostly a HTTP POST request, which the user's browser makes to the web server. This request could easily by modified using a man-in-the-middle(proxy) tool and thus a bogus request could easily be submitted. This is a very common/popular hack for flash games. Unfortunately, there is nothing much a server could do to stop users from submitting bogus scores. A server could make it harder for users to submit bogus scores by encrypting/signing the score. It is to be noted that flash files could easily be decompiled and the hashing algorithm could be obtained and a determined attacker could still submit a bogus score (hashed).

A  very interesting discussion could be read here. I particularly liked these comments:-

"One idea I had would be for the game to keep telling the server it's current state, and the server could employ cheat detection algorithms to detect unlikely events happening in real time - and then stop the game from continuing"

"Comunication between client (flash) and server(php) is going throught XML PRC protocol. This xml rpc protocol is fully crypted. So Flash client send a crypted xml-rpc request, I decrypt it in PHP, and send encrypted response that Flash decrypt for its self. Of course HTTP comunication is transparent..but consist of binary 256bit crypted data. The point is it's gonna be very very difficult for someone to sniff comunication and to 'cheat' it."

If you know a solution to stop a user from submitting a bogus score, do let me know..

Mail Fraud: Case Study

February 14, 2008 Research | Comments (1) sid @ 9:31 am

A few days ago, i came across this mail fraud. I was looking for some merchandise and came across this forum, in which someone has advertised an iphone for just 100 quid. This sounded very phishy and too good to be true. I decided to contact the person and enquire about the product. The person on the other side of internet, narrated me a story which is also documented on this phising website:-

http://tnteu.com/tnt.express.london.depot.overseas.transactions

What is interesting to note is the tracking option and the website layout. The 'whois' information shows the domain has been recently bought. Also, the homepage of the website redirects to the legitimate website. 

Note:- Please be careful while making a deal with anyone on the internet. Any deals requiring money transaction through untraceable means like Western Union, is more likely to be a scam.

Flawed XSRF Protection In Wordpress

February 13, 2008 Research | Comments (0) sid @ 3:16 pm

Wordpress XSRF Protection

As demonstrated by ferruh 'http://ferruh.mavituna.com/flawed-csrf-protections-oku/', this is a serious flaw which surprisingly went un-noticed. An admin could be easily tricked into clicking a 'Yes' button resulting in a password update. An attacker could also update the admin's email and use the 'forgot password' functionality to reset his password. Wordpress, do not ask user's to provide their existing password to change it.

This demonstrates that inorder to protect against Cross Site request Forgery (XSRF), application's must discard the request whenever any XSRF attempt is detected.