<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>
<channel>
	<title>Comments on: Mass Attack FAQ</title>
	<link>http://hackademix.net/2008/04/26/mass-attack-faq/</link>
	<description>Giorgio Maone's answers to the Web, the Universe, and Everything</description>
	<pubDate>Sun, 06 Jul 2008 19:49:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.3</generator>

	<item>
		<title>By: Jean-Luc</title>
		<link>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8497</link>
		<dc:creator>Jean-Luc</dc:creator>
		<pubDate>Fri, 04 Jul 2008 16:10:37 +0000</pubDate>
		<guid>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8497</guid>
		<description>I like the idea of denying select on sysobjects and other. Anybody who tried it ? Any reason for this not working on a shared SQL Server 2000 ?</description>
		<content:encoded><![CDATA[<p>I like the idea of denying select on sysobjects and other. Anybody who tried it ? Any reason for this not working on a shared SQL Server 2000 ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jonathan</title>
		<link>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8475</link>
		<dc:creator>jonathan</dc:creator>
		<pubDate>Thu, 03 Jul 2008 04:02:16 +0000</pubDate>
		<guid>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8475</guid>
		<description>This is the script that worked of me  It handles multiple instances of the </description>
		<content:encoded><![CDATA[<p>This is the script that worked of me  It handles multiple instances of the</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alecos</title>
		<link>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8467</link>
		<dc:creator>Alecos</dc:creator>
		<pubDate>Wed, 02 Jul 2008 08:42:18 +0000</pubDate>
		<guid>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8467</guid>
		<description>Final Solution ckeched (no code redesign is needed)
Crisis management steps:
1) Stop the web site (IIS) that is affected from the attack
2)Run the procedure mentioned above from Georgio (included below):
-------------------------------------------------------------
DECLARE @T varchar(255), @C varchar(255);
DECLARE Table_Cursor CURSOR FOR
SELECT a.name, b.name
FROM sysobjects a, syscolumns b
WHERE a.id = b.id AND a.xtype = 'u' AND
(b.xtype = 99 OR
b.xtype = 35 OR
b.xtype = 231 OR
b.xtype = 167);
OPEN Table_Cursor;
FETCH NEXT FROM Table_Cursor INTO @T, @C;
WHILE (@@FETCH_STATUS = 0) BEGIN
EXEC(
'update [' + @T + '] set [' + @C + '] =
rtrim(convert(varchar,[' + @C + ']))+
'''''
);
FETCH NEXT FROM Table_Cursor INTO @T, @C;
END;
CLOSE Table_Cursor;
DEALLOCATE Table_Cursor;
----------------------------------------------------------------
I'm not sure if it cleans ntext or text fields so take a look at the end of these fields to check if the script is there
4) Make sure you have applied deny to these tables (as mentioned by Marie):

deny select on sysobjects to sql_login_of_your_app
deny select on syscomments to ql_login_of_your_app
deny select on syscolumns to ql_login_of_your_app
deny select on systypes to ql_login_of_your_app
5) As these have been applied the script cannot affect anymore your application database
6) Get URLScan 2.5 or Port 80 ServerDefender (http://www.port80software.com/products/serverdefender/) that blocks URL injections specified by the length of the query string you allow in the preferences (the attack script has a length of 1180 characters I think) and additionally it blocks the IP of the attacker for a period of time you specify. Good tool but very expensive. The same functionality but the blocking of IP does the Microsoft URLScan 2.5 that restricts the length of the Query string but cannot block automatically the IP of the attacker.
I put 450 characters as the maximum length. You have to decide on this depending on the query strings that run on your server.
That's it 
I think that the literature on bad coding practices is not well documented.</description>
		<content:encoded><![CDATA[<p>Final Solution ckeched (no code redesign is needed)<br />
Crisis management steps:<br />
1) Stop the web site (IIS) that is affected from the attack<br />
2)Run the procedure mentioned above from Georgio (included below):<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
DECLARE @T varchar(255), @C varchar(255);<br />
DECLARE Table_Cursor CURSOR FOR<br />
SELECT a.name, b.name<br />
FROM sysobjects a, syscolumns b<br />
WHERE a.id = b.id AND a.xtype = &#8216;u&#8217; AND<br />
(b.xtype = 99 OR<br />
b.xtype = 35 OR<br />
b.xtype = 231 OR<br />
b.xtype = 167);<br />
OPEN Table_Cursor;<br />
FETCH NEXT FROM Table_Cursor INTO @T, @C;<br />
WHILE (@@FETCH_STATUS = 0) BEGIN<br />
EXEC(<br />
&#8216;update [&#8217; + @T + &#8216;] set [&#8217; + @C + &#8216;] =<br />
rtrim(convert(varchar,[&#8217; + @C + &#8216;]))+<br />
&#8221;&#8221;&#8217;<br />
);<br />
FETCH NEXT FROM Table_Cursor INTO @T, @C;<br />
END;<br />
CLOSE Table_Cursor;<br />
DEALLOCATE Table_Cursor;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
I&#8217;m not sure if it cleans ntext or text fields so take a look at the end of these fields to check if the script is there<br />
4) Make sure you have applied deny to these tables (as mentioned by Marie):</p>
<p>deny select on sysobjects to sql_login_of_your_app<br />
deny select on syscomments to ql_login_of_your_app<br />
deny select on syscolumns to ql_login_of_your_app<br />
deny select on systypes to ql_login_of_your_app<br />
5) As these have been applied the script cannot affect anymore your application database<br />
6) Get URLScan 2.5 or Port 80 ServerDefender (http://www.port80software.com/products/serverdefender/) that blocks URL injections specified by the length of the query string you allow in the preferences (the attack script has a length of 1180 characters I think) and additionally it blocks the IP of the attacker for a period of time you specify. Good tool but very expensive. The same functionality but the blocking of IP does the Microsoft URLScan 2.5 that restricts the length of the Query string but cannot block automatically the IP of the attacker.<br />
I put 450 characters as the maximum length. You have to decide on this depending on the query strings that run on your server.<br />
That&#8217;s it<br />
I think that the literature on bad coding practices is not well documented.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: twd76</title>
		<link>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8429</link>
		<dc:creator>twd76</dc:creator>
		<pubDate>Mon, 30 Jun 2008 16:06:31 +0000</pubDate>
		<guid>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8429</guid>
		<description>With this latest round of injections that have occurred, are you seeing the code being run as a stored proc or is it being injected via form fields?</description>
		<content:encoded><![CDATA[<p>With this latest round of injections that have occurred, are you seeing the code being run as a stored proc or is it being injected via form fields?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tenmoku</title>
		<link>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8385</link>
		<dc:creator>tenmoku</dc:creator>
		<pubDate>Thu, 26 Jun 2008 08:10:16 +0000</pubDate>
		<guid>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8385</guid>
		<description>yup.. www.tenmokupottery.com.my also get hacked with those Sql injection, thank you for all your comment, i learn alot from this blog</description>
		<content:encoded><![CDATA[<p>yup.. <a href="http://www.tenmokupottery.com.my" rel="nofollow">www.tenmokupottery.com.my</a> also get hacked with those Sql injection, thank you for all your comment, i learn alot from this blog</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Zero in a bit » Scrawlr: Are We Being Too Greedy?</title>
		<link>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8379</link>
		<dc:creator>Zero in a bit » Scrawlr: Are We Being Too Greedy?</dc:creator>
		<pubDate>Wed, 25 Jun 2008 16:19:50 +0000</pubDate>
		<guid>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8379</guid>
		<description>[...] vulnerabilities in a website. It was a joint effort with Microsoft and a direct response to the mass SQL Injection attacks of [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] vulnerabilities in a website. It was a joint effort with Microsoft and a direct response to the mass SQL Injection attacks of [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hackademix.net » Got SQL Injections? Free HP Tool Tells You.</title>
		<link>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8367</link>
		<dc:creator>hackademix.net » Got SQL Injections? Free HP Tool Tells You.</dc:creator>
		<pubDate>Tue, 24 Jun 2008 22:42:37 +0000</pubDate>
		<guid>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8367</guid>
		<description>[...] mass SQL injection attacks we talked about in in several posts, being mainly targeted to ASP sites running on Microsoft IIS [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] mass SQL injection attacks we talked about in in several posts, being mainly targeted to ASP sites running on Microsoft IIS [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shiggity</title>
		<link>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8321</link>
		<dc:creator>Shiggity</dc:creator>
		<pubDate>Fri, 20 Jun 2008 22:54:42 +0000</pubDate>
		<guid>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8321</guid>
		<description>That's not clever.  It's a mundane use of the cursor object affecting anyone careless enough to allow raw SQL injection across their querystrings.</description>
		<content:encoded><![CDATA[<p>That&#8217;s not clever.  It&#8217;s a mundane use of the cursor object affecting anyone careless enough to allow raw SQL injection across their querystrings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mass SQL Injection attack is still out there » Musings on Database Security</title>
		<link>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8318</link>
		<dc:creator>Mass SQL Injection attack is still out there » Musings on Database Security</dc:creator>
		<pubDate>Fri, 20 Jun 2008 13:22:48 +0000</pubDate>
		<guid>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8318</guid>
		<description>[...] an interesting day today for us in Sentrigo. One of our customers was being attacked by this mass SQL injection and since our software identified the attack he came to us to help him cope with the situation. As [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] an interesting day today for us in Sentrigo. One of our customers was being attacked by this mass SQL injection and since our software identified the attack he came to us to help him cope with the situation. As [&#8230;]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marie</title>
		<link>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8288</link>
		<dc:creator>Marie</dc:creator>
		<pubDate>Wed, 18 Jun 2008 23:42:13 +0000</pubDate>
		<guid>http://hackademix.net/2008/04/26/mass-attack-faq/#comment-8288</guid>
		<description>1- You can prevent the script from executing or any further issues:

deny select on sysobjects to sql_login_of_your_app
deny select on syscomments  to ql_login_of_your_app
deny select on syscolumns  to ql_login_of_your_app
deny select on systypes  to ql_login_of_your_app

The script won't even get access to the sys tables anymore (you can add more but these are the minimum).

2- You canuse what the Hacker used (query below) and know what is/was infected.

select a.name'b.name from sysobjects a'syscolumns b where a.id=b.id and a.xtype='u'
and (b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167)</description>
		<content:encoded><![CDATA[<p>1- You can prevent the script from executing or any further issues:</p>
<p>deny select on sysobjects to sql_login_of_your_app<br />
deny select on syscomments  to ql_login_of_your_app<br />
deny select on syscolumns  to ql_login_of_your_app<br />
deny select on systypes  to ql_login_of_your_app</p>
<p>The script won&#8217;t even get access to the sys tables anymore (you can add more but these are the minimum).</p>
<p>2- You canuse what the Hacker used (query below) and know what is/was infected.</p>
<p>select a.name&#8217;b.name from sysobjects a&#8217;syscolumns b where a.id=b.id and a.xtype=&#8217;u&#8217;<br />
and (b.xtype=99 or b.xtype=35 or b.xtype=231 or b.xtype=167)</p>
]]></content:encoded>
	</item>
</channel>
</rss>
