19.04.2013 Views

2KKUU7ita

2KKUU7ita

2KKUU7ita

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

308<br />

Part V: Hacking Applications<br />

(continued)<br />

Finally, it was time to attempt one last act of<br />

database dastardliness. First, Mr. Andrews<br />

loaded the tool called Cain & Abel and set it to<br />

enter sniffing mode. Then, using Paros Proxy<br />

and the already identified vulnerable parameter,<br />

he used the xp_dirtree extended stored<br />

procedure, which is available to all SQL Server<br />

database users, to attempt to show a directory<br />

on his Internet-connected machine using a<br />

Universal Naming Convention (UNC) path. This<br />

forced the target database to actually attempt<br />

to authenticate itself against Mr. Andrews’s<br />

machine. Because Cain & Abel was listening on<br />

the wire, it obtained the hash of the challenge<br />

used to authenticate the exposed file share. By<br />

passing this hash to the password cracker built<br />

in to Cain & Abel, Mr. Andrews would have the<br />

username and password of the account under<br />

which the vulnerable SQL Server was running<br />

in just a matter of time (assuming it wasn’t a<br />

local system account).<br />

SQLPing3 can discover instances of SQL Server hidden behind personal firewalls<br />

and more — a feature formerly only available in SQLPing2’s sister application<br />

SQLRecon.<br />

If you have Oracle in your environment, Pete Finnigan has a great list of<br />

Oracle-centric security tools at www.petefinnigan.com/tools.htm that<br />

can perform functions similar to SQLPing3.<br />

Cracking database passwords<br />

Would this hacked account use the same password<br />

as the admin account of the web application?<br />

Would this password be the same as<br />

the local administrator account on the host?<br />

Those were questions for another day. It was<br />

time to assemble all the collected data, prepare<br />

a report for the client, and put the tools away for<br />

another day.<br />

Chip Andrews is a co-founder of security<br />

consulting firm Special Ops Security, Inc.<br />

and owner of SQLSecurity.com (www.sql<br />

security.com), which has multiple<br />

resources about Microsoft SQL Server security,<br />

including the SQLPing3 tool. A co-author for<br />

several books on SQL Server security (Hacking<br />

Exposed: Windows Server 2003 and SQL<br />

Server Security, both published by McGraw-<br />

Hill Osborne) and a Black Hat presenter, Mr.<br />

Andrews has been promoting SQL Server and<br />

application security since 1999.<br />

SQLPing3 also serves as a nice dictionary-based SQL Server password-<br />

cracking program. As you can see in Figure 15-1, it checks for blank sa<br />

passwords by default. Another free tool for cracking SQL Server, MySQL,<br />

and Oracle password hashes is Cain & Abel, shown in Figure 15-2.<br />

The commercial product Elcomsoft Distributed Password Recovery (www.<br />

elcomsoft.com/edpr.html) can also crack Oracle password hashes.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!