<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.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>Neil Carpenter's Blog</title><link>http://blogs.technet.com/b/neilcar/</link><description>Forefront products, WSUS, Security Incident Response, and whatever else comes up.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>Incident Response: The Importance of Anti-Virus</title><link>http://blogs.technet.com/b/neilcar/archive/2009/11/23/incident-response-the-importance-of-anti-virus.aspx</link><pubDate>Mon, 23 Nov 2009 17:17:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3295852</guid><dc:creator>neilcar</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/neilcar/rsscomments.aspx?WeblogPostID=3295852</wfw:commentRss><comments>http://blogs.technet.com/b/neilcar/archive/2009/11/23/incident-response-the-importance-of-anti-virus.aspx#comments</comments><description>&lt;P&gt;Heading home from the CSS Security Global Summit on Friday, I got stuck in Cincinnati’s airport.&amp;nbsp; While walking through baggage claim, I saw this displayed on the arrivals board:&lt;/P&gt;&lt;A href="http://blogs.technet.com/blogfiles/neilcar/WindowsLiveWriter/IncidentResponseTheImportanceofAntiVirus_A547/IMG_0230.jpg" mce_href="http://blogs.technet.com/blogfiles/neilcar/WindowsLiveWriter/IncidentResponseTheImportanceofAntiVirus_A547/IMG_0230.jpg"&gt;&lt;IMG style="BORDER-RIGHT-WIDTH: 0px; DISPLAY: inline; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px" title=IMG_0230 border=0 alt=IMG_0230 src="http://blogs.technet.com/blogfiles/neilcar/WindowsLiveWriter/IncidentResponseTheImportanceofAntiVirus_A547/IMG_0230_thumb.jpg" width=456 height=369 mce_src="http://blogs.technet.com/blogfiles/neilcar/WindowsLiveWriter/IncidentResponseTheImportanceofAntiVirus_A547/IMG_0230_thumb.jpg"&gt;&lt;/A&gt; 
&lt;P&gt;(I didn’t have a proper camera with me so, if that’s hard to read, it’s a Symantec AntiVirus Auto-Protect notification of a trojan horse found.&amp;nbsp; Symantec was unable to quarantine it due to an access denied.)&lt;/P&gt;
&lt;P&gt;Now, I suspect that this was a false positive; however, I’m just a guy walking by their wall of monitors.&amp;nbsp; Even if it is a false positive, it was first detected at 4:26PM…and it was 8:30pm when I was walking by.&amp;nbsp; (CORRECTION:&amp;nbsp; It occurred to me, when I looked back at the picture, that this was detected on THURSDAY at 4:26PM.&amp;nbsp; This was, apparently, displayed for over a day.)&amp;nbsp; Even if there is no risk, I think it would have been wise for somebody to react to this faster just so that you don’t have smart-alec security guys walking by taking pictures…&lt;/P&gt;
&lt;P&gt;This reminded me of a common thread that I’ve seen in security incidents lately:&amp;nbsp; &lt;STRONG&gt;You can’t ignore your anti-virus software.&amp;nbsp; &lt;/STRONG&gt;Your AV software is whispering softly in your ear, telling you that something bad has happened – if you ignore it, you may go on (for months, sometimes) not knowing that something bad has happened.&lt;/P&gt;
&lt;P&gt;What about if it’s a false positive?&amp;nbsp; Do something about it.&amp;nbsp; You paid for AV software and it’s an important factor in early detection of security incidents, so don’t just accept that it’s generating noise.&amp;nbsp; If there’s not a clear resolution, contact your AV vendor and get them to help figure it out.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;The same thing is true of errors -- “Unable to scan file X because of reason Y”, for example.&amp;nbsp; Either this is a valid error that should be solved or it’s noise which shouldn’t be bubbling up to you as an error.&amp;nbsp; In some cases, this is an indication of an attacker who is circumventing your AV software.&amp;nbsp; If you can’t easily fix these, talk to your AV vendor and get their help in resolving them.&lt;/P&gt;
&lt;P&gt;Another important thing, in regards to AV vendors, is their ability to react quickly in an emergency.&amp;nbsp; Make sure that you know how to contact them and get samples to them if you have something rampant in your environment that isn’t caught by their current signatures.&amp;nbsp; Also, be sure to understand how the vendor would deliver a new signature and how you would deploy it as quickly as possible.&amp;nbsp; Include disaster scenarios such as “What if my network was completely down?” and “What if my enterprise had no Internet connectivity?” in your planning.&lt;/P&gt;
&lt;P&gt;In general, make sure that you have an excellent relationship with your AV vendor and that they are a company that you can rely on, especially in a crisis.&lt;/P&gt;
&lt;P&gt;AV isn’t a perfect solution but, then again, neither is any other single part of your security strategy.&amp;nbsp; In some cases, it may be the difference between responding quickly to an incident and not responding until significant damage has been done.&lt;/P&gt;
&lt;HR&gt;

&lt;P&gt;I’ve often discussed these concepts with customers; however, two specific incidents that I’ve seen recently have made me think more about this topic.&lt;/P&gt;
&lt;P&gt;In the first incident, a company was first penetrated by a remote-access trojan that their AV software didn’t detect; however, when I looked at each of the machines that this was installed on, I saw that the AV software had logged failures to scan various files on every machine that was compromised.&amp;nbsp; (There might be a high volume of these errors in the enterprise; however, I doubt it since none of these machines had errors except where they correlated with specific malware being dropped on the system.)&amp;nbsp; Additionally, some of the other tools did cause AV detections – for example, PWDump was detected on one of the compromised workstations.&amp;nbsp; The attackers went on to use a different password hash dumping tool that was not detected…&lt;/P&gt;
&lt;P&gt;Had these issues been remediated immediately, the company could have stopped the incident before it really started.&amp;nbsp; Instead, the company didn’t discover the incident until months later from unrelated symptoms.&lt;/P&gt;
&lt;P&gt;The second incident was large enough to take the company entirely off the Internet and turn off most of their Windows machines as a precaution.&amp;nbsp; The company had an outbreak of a piece of malware similar to Conficker (in that it impersonated users to spread to machines that were otherwise not vulnerable) but different enough that its AV vendor didn’t have signatures that covered it.&amp;nbsp; It was 50+ hours between when the initial infections were discovered and when signatures that were considered to be totally effective were deployed.&lt;/P&gt;
&lt;P&gt;In this case, the AV vendor wasn’t a ‘trusted advisor’ to the company.&amp;nbsp; The company was unable to effectively deliver on the promise of AV software to contain and remove malware at the time that it counted most to them.&amp;nbsp; &lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3295852" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Security/">Security</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Incident+Response/">Incident Response</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/AV/">AV</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/AntiVirus/">AntiVirus</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Anti_2D00_Virus/">Anti-Virus</category></item><item><title>SQL Injection Hijinks</title><link>http://blogs.technet.com/b/neilcar/archive/2008/10/31/sql-injection-hijinks.aspx</link><pubDate>Fri, 31 Oct 2008 23:07:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3145432</guid><dc:creator>neilcar</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/neilcar/rsscomments.aspx?WeblogPostID=3145432</wfw:commentRss><comments>http://blogs.technet.com/b/neilcar/archive/2008/10/31/sql-injection-hijinks.aspx#comments</comments><description>&lt;P&gt;&lt;I&gt;or Why I Keep Harping On Blacklisting&lt;/I&gt;&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Summary:&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;An incident reveals attempts to get around blacklisting by manipulating behavior in ASP, illustrating the weakness of blacklist approaches.&lt;/P&gt;
&lt;P&gt;A new version of &lt;A href="http://blogs.iis.net/wadeh/archive/2008/10/31/urlscan-3-1.aspx" mce_href="http://blogs.iis.net/wadeh/archive/2008/10/31/urlscan-3-1.aspx"&gt;UrlScan is shipping today&lt;/A&gt; with a change specifically to address this.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Discussion:&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;I was working with a colleague on an incident last week that looked like a garden-variety SQL injection drive-by except for something interesting.&lt;/P&gt;
&lt;P&gt;While looking through the IIS logs from the affected server, I saw this:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;abc=120364DEC%LARE%20@S%20VAR%CHAR(4000)%3BS%ET%20@S%...&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As I looked at this, "DEC%LARE", "VAR%CHAR", and "BS%ET" immediately stood out to me.&amp;nbsp; Obviously, the percent sign is usually used to escape something in a URL (like the %20's in there, which are spaces); however, this naked percent sign thrown in there didn't seem to have any purpose and should have caused SQL to not execute the code in question.&lt;/P&gt;
&lt;P&gt;When I see somebody do something like this, it's usually for a purpose so I took another look at it.&amp;nbsp; I realized that, if ASP silently stripped that percent sign out of there, then this would be an efficient way to bypass a lot of blacklist-based filters.&lt;/P&gt;
&lt;P&gt;I wrote a quick test ASP page(1) and found that my guess was right on -- ASP drops a percent sign from the query string if it isn't followed by two valid hex characters(0-9, A-F) when it actually interprets it via Request.QueryString.&amp;nbsp; This means that any filter that inspects raw headers using Request.ServerVariables is going to miss "DEC%LARE" if it is looking for "DECLARE" but, on the other hand, the ASP app that actually consumes that string using Request.QueryString("abc") is going to get it without the percent sign.&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Conclusion:&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;As this incident illustrates, a blacklist approach to SQL injection only works for as long as nobody finds a way around your blacklist.&amp;nbsp; As soon as somebody finds a way around it (and experience suggests that attackers are motivated to do so), the value of your blacklist is zero.&lt;/P&gt;
&lt;P&gt;The right approach is to fix the actual vulnerability in the code using parameterized queries.&amp;nbsp; See the articles below for more information and examples.&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A title=http://msdn.microsoft.com/en-us/library/cc676512.aspx href="http://msdn.microsoft.com/en-us/library/cc676512.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc676512.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc676512.aspx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="SQL Injection Mitigation- Using Parameterized Queries" href="http://blogs.technet.com/neilcar/archive/2008/05/21/sql-injection-mitigation-using-parameterized-queries.aspx" mce_href="http://blogs.technet.com/neilcar/archive/2008/05/21/sql-injection-mitigation-using-parameterized-queries.aspx"&gt;SQL Injection Mitigation- Using Parameterized Queries&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A title="SQL Injection Mitigation- Using Parameterized Queries part 2 (types and recordsets)" href="http://blogs.technet.com/neilcar/archive/2008/05/23/sql-injection-mitigation-using-parameterized-queries-part-2-types-and-recordsets.aspx" mce_href="http://blogs.technet.com/neilcar/archive/2008/05/23/sql-injection-mitigation-using-parameterized-queries-part-2-types-and-recordsets.aspx"&gt;SQL Injection Mitigation- Using Parameterized Queries part 2 (types and recordsets)&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The IIS team is releasing an update to UrlScan today that includes changes to address this in their filtering product.&amp;nbsp; Of course, as I've said over and and over, no filter-based approach is going to be perfect, but UrlScan is still an excellent defense-in-depth tool and a way to mitigate SQL injection vulns in the short term while your developers fix them.&lt;/P&gt;
&lt;P&gt;For more information on the UrlScan update, Wade Hilmo has all the details:&amp;nbsp; &lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;A href="http://blogs.iis.net/wadeh/archive/2008/10/31/urlscan-3-1.aspx" mce_href="http://blogs.iis.net/wadeh/archive/2008/10/31/urlscan-3-1.aspx"&gt;http://blogs.iis.net/wadeh/archive/2008/10/31/urlscan-3-1.aspx&lt;/A&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(1)&lt;/P&gt;
&lt;P&gt;&amp;lt;HTML&amp;gt; &lt;BR&gt;QUERY_STRING = &amp;lt;%= Request.ServerVariables("QUERY_STRING") %&amp;gt; &amp;lt;BR&amp;gt;&amp;nbsp; &lt;BR&gt;test =&amp;lt;%= Request.QueryString("test") %&amp;gt; &amp;lt;BR&amp;gt; &lt;BR&gt;&amp;lt;/HTML&amp;gt;&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3145432" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Security/">Security</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Incident+Response/">Incident Response</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/SQL/">SQL</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/ASP/">ASP</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Tool/">Tool</category></item><item><title>PASSGEN</title><link>http://blogs.technet.com/b/neilcar/archive/2008/10/22/passgen.aspx</link><pubDate>Wed, 22 Oct 2008 21:52:02 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3140463</guid><dc:creator>neilcar</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/neilcar/rsscomments.aspx?WeblogPostID=3140463</wfw:commentRss><comments>http://blogs.technet.com/b/neilcar/archive/2008/10/22/passgen.aspx#comments</comments><description>&lt;p&gt;Occasionally, I see a security incident where one of the things that went wrong was that all of the customer's machines have the same password for the built-in administrator's account.&amp;#160; Whenever this happens, I suggest the PASSGEN tool that was included with the book &lt;a href="http://www.amazon.com/dp/0321336437"&gt;&amp;quot;Protect Your Windows Network&amp;quot;&lt;/a&gt; by &lt;a href="http://blogs.technet.com/steriley"&gt;Steve Riley&lt;/a&gt; and &lt;a href="http://msinfluentials.com/blogs/jesper/"&gt;Jesper Johansson&lt;/a&gt;.&amp;#160; Obviously, most people don't want to run to the bookstore in the middle of a security incident but, fortunately, it was available on their website.&lt;/p&gt;  &lt;p&gt;Unfortunately, the website disappeared recently and I had to scramble around to find it.&amp;#160; If you're looking for PASSGEN (and you should be if you have the same password for local admin across a number of machines), you can find it in two places:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;a href="http://blogs.technet.com/steriley/archive/2008/09/29/passgen-tool-from-my-book.aspx"&gt;The Windows Server 2008 Resource Kit&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://blogs.technet.com/steriley/archive/2008/09/29/passgen-tool-from-my-book.aspx"&gt;Steve's blog&lt;/a&gt;&lt;/li&gt; &lt;/ol&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3140463" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Security/">Security</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Tool/">Tool</category></item><item><title>Err</title><link>http://blogs.technet.com/b/neilcar/archive/2008/08/12/err.aspx</link><pubDate>Wed, 13 Aug 2008 05:10:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3104496</guid><dc:creator>neilcar</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/neilcar/rsscomments.aspx?WeblogPostID=3104496</wfw:commentRss><comments>http://blogs.technet.com/b/neilcar/archive/2008/08/12/err.aspx#comments</comments><description>&lt;p&gt;I might be the last person to know this but one of my favorite internal Microsoft tools is now external.&amp;nbsp; Err.exe is a command-line tool that looks up error codes and spits out possible matches from various header files.&amp;nbsp; This is invaluable when you're reading through a log and run across something like "Failed, err 0x80070003" -- just run err and you'll find out what this possibly means:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;C:\Users\Neilcar\Downloads\Err&amp;gt;err 0x80070003&lt;br&gt;# for hex 0x80070003 / decimal -2147024893 :&lt;br&gt;&amp;nbsp; COR_E_DIRECTORYNOTFOUND&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; corerror.h&lt;br&gt;# MessageText:&lt;br&gt;# The specified path couldn't be found.&lt;br&gt;# 1 matches found for "0x80070003" &lt;br&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;The download for err is available at &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=be596899-7bb8-4208-b7fc-09e02a13696c&amp;amp;displaylang=en" mce_href="http://www.microsoft.com/downloads/details.aspx?familyid=be596899-7bb8-4208-b7fc-09e02a13696c&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?familyid=be596899-7bb8-4208-b7fc-09e02a13696c&amp;amp;displaylang=en&lt;/a&gt;.&amp;nbsp; Download it and extract it to somewhere in %PATH% so that it's only a command prompt away. &lt;br&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3104496" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Tool/">Tool</category></item><item><title>Input Validation Is Not The Answer</title><link>http://blogs.technet.com/b/neilcar/archive/2008/08/07/input-validation-is-not-the-answer.aspx</link><pubDate>Thu, 07 Aug 2008 21:11:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3102263</guid><dc:creator>neilcar</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/neilcar/rsscomments.aspx?WeblogPostID=3102263</wfw:commentRss><comments>http://blogs.technet.com/b/neilcar/archive/2008/08/07/input-validation-is-not-the-answer.aspx#comments</comments><description>&lt;p&gt;I just sent a piece of e-mail to my team about input validation and SQL injection and it occurred to me that I've been meaning to get into this here, too:&lt;/p&gt;&lt;blockquote&gt;&lt;blockquote&gt;&lt;p&gt;&lt;b&gt;If you're trying to solve a SQL injection problem, input validation is NOT the answer!&lt;/b&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/blockquote&gt;&lt;p&gt;There, I've said it. &amp;nbsp; I keep seeing blog posts, forum posts, e-mail, etc, that say "Oh, you got hax0red by SQL injection, you should have been doing input validation".&amp;nbsp; I'm sorry, but y'all are wrong, wrong, wrong, wrong.&amp;nbsp; Let me copy-and-paste my e-mail to explain why:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Your customer is failing to stop SQL injection because they don’t understand the problem (or, by extension, the solution).&lt;br&gt;&lt;br&gt;It sounds like the customer is trying to do input validation.&amp;nbsp; What input validation does is to check input coming from an untrusted user to make sure that it doesn’t contain any blacklisted characters/phrases.&amp;nbsp; Depending on the implementation, it either replaces items on the blacklist with something innocuous or it blocks the input entirely.&lt;br&gt;&lt;br&gt;This is the wrong way to stop SQL injection, period.&amp;nbsp; Input validation is sometimes useful as part of a defense-in-depth strategy but that’s it.&amp;nbsp; There are several major problems with input validation:&lt;br&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;It only works for as long as you’re smarter than your attackers because you have to anticipate every potential attack. &lt;/li&gt;&lt;li&gt;It doesn’t solve your real problem, which is that SQL can potentially execute something in input you get from your untrusted user. &lt;/li&gt;&lt;li&gt;You can end up with a lot of false positives if you’re not careful — if you’re blocking “exec”, what happens when one of your users has the title “Executive Assistant”?&lt;br&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;To use an analogy, using input validation to stop SQL injection is like using anti-virus software to stop malware.&amp;nbsp; It might work, it might not, but you’d be far better off if you actually resolved the vulnerability instead of just trying to mitigate it.&lt;br&gt;&lt;br&gt;How, then, should the customer fix their vulnerabilities?&amp;nbsp; Parameterizing queries is the single best step.&amp;nbsp; Instead of simply mitigating the vulnerability, this actually resolves it.&amp;nbsp; At a high level, I think of parameterized queries as DEP for SQL — it separates the executable code from the data and prevents anything in the data from executing.&lt;br&gt;&lt;br&gt;Bala Neeumalla wrote a great MSDN article on how to code in ASP to prevent SQL injection (&lt;a href="http://msdn.microsoft.com/en-us/library/cc676512.aspx" mce_href="http://msdn.microsoft.com/en-us/library/cc676512.aspx"&gt;http://msdn.microsoft.com/en-us/library/cc676512.aspx&lt;/a&gt;) that covers this in detail.&amp;nbsp; His article should be considered definitive.&amp;nbsp; I wrote a few blog entries (&lt;a href="http://blogs.technet.com/neilcar/archive/2008/05/21/sql-injection-mitigation-using-parameterized-queries.aspx" mce_href="http://blogs.technet.com/neilcar/archive/2008/05/21/sql-injection-mitigation-using-parameterized-queries.aspx"&gt;http://blogs.technet.com/neilcar/archive/2008/05/21/sql-injection-mitigation-using-parameterized-queries.aspx&lt;/a&gt;, &lt;a href="http://blogs.technet.com/neilcar/archive/2008/05/23/sql-injection-mitigation-using-parameterized-queries-part-2-types-and-recordsets.aspx" mce_href="http://blogs.technet.com/neilcar/archive/2008/05/23/sql-injection-mitigation-using-parameterized-queries-part-2-types-and-recordsets.aspx"&gt;http://blogs.technet.com/neilcar/archive/2008/05/23/sql-injection-mitigation-using-parameterized-queries-part-2-types-and-recordsets.aspx&lt;/a&gt;) that have additional examples that might be helpful to the customer.&lt;br&gt;&lt;br&gt;Michael Howard also wrote a great blog entry regarding SQL injection and the SDL (&lt;a href="http://blogs.msdn.com/sdl/archive/2008/05/15/giving-sql-injection-the-respect-it-deserves.aspx" mce_href="http://blogs.msdn.com/sdl/archive/2008/05/15/giving-sql-injection-the-respect-it-deserves.aspx"&gt;http://blogs.msdn.com/sdl/archive/2008/05/15/giving-sql-injection-the-respect-it-deserves.aspx&lt;/a&gt;).&amp;nbsp; Besides using parameterized queries, there are two additional steps that can be taken to further protect an application:&lt;br&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Use properly designed stored procedures &lt;/li&gt;&lt;li&gt;Use SQL Execute-only permission so that the application can only execute the stored procedures and cannot execute other statements.&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;p&gt;This doesn't mean that input validation isn't useful and it doesn't mean it isn't appropriate mitigation in some cases.&amp;nbsp; It's still not the way to prevent SQL injection.&lt;/p&gt;&lt;p&gt;And I'm not just talking about&amp;nbsp; ASP, either.&amp;nbsp; The same thing holds true for ASP.Net, the same thing holds true for Cold Fusion (look up &lt;a href="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-b20.htm" mce_href="http://livedocs.adobe.com/coldfusion/6.1/htmldocs/tags-b20.htm"&gt;CFQueryParam&lt;/a&gt;), &lt;a href="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html" mce_href="http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html"&gt;Java&lt;/a&gt;, etc, etc.&amp;nbsp; Wherever you query, there shall ye parameterize.&lt;br&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3102263" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Security/">Security</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/SQL/">SQL</category></item><item><title>Forefront Server Security Management Console, Templates, and Revisions</title><link>http://blogs.technet.com/b/neilcar/archive/2008/07/11/forefront-server-security-management-console-templates-and-revisions.aspx</link><pubDate>Fri, 11 Jul 2008 23:57:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3087531</guid><dc:creator>neilcar</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/neilcar/rsscomments.aspx?WeblogPostID=3087531</wfw:commentRss><comments>http://blogs.technet.com/b/neilcar/archive/2008/07/11/forefront-server-security-management-console-templates-and-revisions.aspx#comments</comments><description>&lt;P&gt;Sometimes, working in support, you come across a best practice or a bit of knowledge that is well-known to some people...but that bit of knowledge has never actually been documented.&amp;nbsp; Today was one of those days.&lt;/P&gt;
&lt;P&gt;While working in an environment with multiple Exchange Server 2003 servers running Antigen 9.1 Hotfix Rollup 3, we had to reinstall Antigen on one of the servers.&amp;nbsp; We installed Antigen 9.1 and tested to make sure that mail was flowing after the install (it was).&amp;nbsp; We then configured Antigen, including re-installing the FSSMC agent, redeploying the template for this server, and disabling Antigen performance counters.&lt;/P&gt;
&lt;P&gt;At that point, things went off the rails.&amp;nbsp; When we opened the Antigen admin console, it told us "You have 4 days left on your evaluation".&amp;nbsp; Confused, we tried various things, including rebooting the box; however, every time, the console mocked us with it's eval message.&lt;/P&gt;
&lt;P&gt;Since we were working in a maintenance window and we had run out of time, we made a decision to disable Antigen temporarily and investigate further.&amp;nbsp; We took the template to a non-production Antigen 9.1 server and applied it.&amp;nbsp; After applying it, we opened the admin console and we were greeted with "You have 4 days left on your evaluation".&lt;/P&gt;
&lt;P&gt;At this point, we knew we were onto something.&amp;nbsp; After working with our sustained engineering team to investigate further, we found out the root cause was something that is an FSSMC best practice even though I don't know that it's been written down before:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;You should never apply a template created with a later version of Antigen or Forefront Server to an earlier version.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In this case, the template had been created in Antigen 9.1 Hotfix Rollup 3.&amp;nbsp; As long as we applied it to servers running rollup 3 (or later), everything was A-OK; however, when we applied it to an Antigen 9.1 with no hotfix rollup on it, we ran into trouble.&lt;/P&gt;
&lt;P&gt;The trouble, in this case, is that the schema for scanjobs was changed to add some additional options into the scanjobs.&amp;nbsp; The template includes this new information but, once it's applied, the older code doesn't know how to handle it.&amp;nbsp; This resulted in memory corruption which caused the false eval notice.&lt;/P&gt;
&lt;P&gt;The takeaway here is that, if you're running a mixture of patch levels for your Antigen or Forefront Server servers, you have to be sure that the templates you are deploying with FSSMC were created in the earliest patch level you have in production.&amp;nbsp; This will mean that you can't take advantage of any settings that are added in later patch levels but it also means that you won't run into issues like the one we wrestled with today.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Alternately, you could create templates for each patch level but I think that would end up being more difficult to manage.&lt;/P&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3087531" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Forefront/">Forefront</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Antigen/">Antigen</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/FSSMC/">FSSMC</category></item><item><title>Does This Make Me A Fanboy?</title><link>http://blogs.technet.com/b/neilcar/archive/2008/07/10/does-this-make-me-a-fanboy.aspx</link><pubDate>Fri, 11 Jul 2008 06:21:00 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3087133</guid><dc:creator>neilcar</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/neilcar/rsscomments.aspx?WeblogPostID=3087133</wfw:commentRss><comments>http://blogs.technet.com/b/neilcar/archive/2008/07/10/does-this-make-me-a-fanboy.aspx#comments</comments><description>&lt;p&gt;I upgraded my iPhone to the 2.0 firmware today and I've been playing with the app store all day.&amp;nbsp; It's pretty neat stuff.&lt;/p&gt;&lt;p&gt;Since I'm on a conference call tonight but I'm only here in an advisory/observational way, I put my phone on mute and kept playing with the app store.&amp;nbsp; I downloaded the &lt;a href="http://blogs.technet.com/neilcar/archive/2008/07/10/does-this-make-me-a-fanboy.aspx" mce_href="http://blogs.technet.com/neilcar/archive/2008/07/10/does-this-make-me-a-fanboy.aspx"&gt;PhoneSaber&lt;/a&gt; application, which lets you pretend your phone is a light saber from Star Wars.&amp;nbsp; As you move the phone around, it makes light saber sounds.&lt;/p&gt;&lt;p&gt;So, I amused myself with my virtual light saber for a few moments before somebody said "What is all that noise?&amp;nbsp; I think we have a bad connection!"&lt;/p&gt;&lt;p&gt;I stopped what I was doing and thought for a long, hard moment before sending her an instant message:&amp;nbsp; "Ummm, did it sound like a light saber?"&lt;/p&gt;&lt;p&gt;"Yes." &lt;br&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3087133" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/neilcar/archive/tags/humor/">humor</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/iphone/">iphone</category></item><item><title>Antigen 9.1 Hotfix Rollup 3 and Performance Monitor</title><link>http://blogs.technet.com/b/neilcar/archive/2008/07/09/antigen-9-1-hotfix-rollup-3-and-performance-monitor.aspx</link><pubDate>Wed, 09 Jul 2008 22:56:30 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3086321</guid><dc:creator>neilcar</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/neilcar/rsscomments.aspx?WeblogPostID=3086321</wfw:commentRss><comments>http://blogs.technet.com/b/neilcar/archive/2008/07/09/antigen-9-1-hotfix-rollup-3-and-performance-monitor.aspx#comments</comments><description>&lt;p&gt;While investigating an issue where mail was queuing in the Exchange Information Store, we discovered an issue that affects customers running Antigen 9.1 Hotfix Rollup 3 when there are performance monitoring tools such as Perfmon, Perfwiz, and the MOM client running.&amp;#160; This issue will manifest itself as mail queuing (and never un-queueing), particularly immediately after the store is restarted.&amp;#160; In this particular instance, we were seeing this happen when we failed from one cluster node to another.&amp;#160; This could also occur in non-cluster environments and it could occur if scanjobs are restarted for other reasons (such as scan timeouts).&lt;/p&gt;  &lt;p&gt;Additionally, you may see entries in ProgamLog.txt similar to the following:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;quot;ERROR: scanjobs.cpp::ConfigScanJobFile(): AddNewScanJob() Failed 0x80030021&amp;quot;      &lt;br /&gt;&amp;quot;ERROR: scanjobs.cpp::CheckScanJobs(): ConfigScanJobFile() failed. hr[0x80030021]&amp;quot;&lt;/p&gt;    &lt;p&gt;&amp;quot;ERROR: Unexpected, RetrieveScanJobIdentifier could not find the index&amp;quot;      &lt;br /&gt;&amp;quot;ERROR: Problems retrieving ScanJob identifier from RegisterMonitor&amp;quot;       &lt;br /&gt;&amp;quot;ERROR: antigenvsapi.cpp::VSAPINavigatorThread(): RegisterMonitor() returned 8000ffff&amp;quot;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You may also see instances where you open the Antigen Administrator console and scanjobs are not visible.&lt;/p&gt;  &lt;p&gt;The root cause of this is a regression in the Antigen performance counters DLL that results in Antigen services being unable to access the configuration information for scanjobs; thus, when the server is in this state, scanning processes cannot be started and the admin console cannot access scanjob configuration information. &lt;/p&gt;  &lt;p&gt;These symptoms will not occur in all instances.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Recommendations:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If a server is having this issue, you should be able to resolve the immediate issue by stopping all applications that are performing performance monitoring and restarting Exchange services.&lt;/p&gt;  &lt;p&gt;If you are running services/applications that gather performance data on your Exchange Server with Antigen 9.1 Hotfix Rollup 3, you can mitigate this in the short-term by disabling Antigen performance counters.&amp;#160; The following steps will disable those counters:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;At c:\program files\microsoft antigen for exchange\ &lt;/li&gt;    &lt;li&gt;Enter command: antigenpmsetup -uninstall &lt;/li&gt;    &lt;li&gt;You will also have to restart any application that loads performance counters.&amp;#160; Rebooting the server will accomplish this; however, short of that, you can run 'tlist -m antigenpmdll.dll' to get a list.&amp;#160; (Tlist is part of the debuggers package.) &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;This will be resolved in Rollup 4 when it is released.&amp;#160; After Rollup 4 is available, we recommend re-enabling Antigen performance counters by running 'antigenpmsetup -install'.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3086321" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Forefront/">Forefront</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Antigen/">Antigen</category></item><item><title>SQL Storm:  Possible ASP.Net</title><link>http://blogs.technet.com/b/neilcar/archive/2008/06/04/sql-storm-possible-asp-net.aspx</link><pubDate>Thu, 05 Jun 2008 00:13:59 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3066167</guid><dc:creator>neilcar</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/neilcar/rsscomments.aspx?WeblogPostID=3066167</wfw:commentRss><comments>http://blogs.technet.com/b/neilcar/archive/2008/06/04/sql-storm-possible-asp-net.aspx#comments</comments><description>&lt;p&gt;I&amp;#8217;ve had an unconfirmed report that the SQL Storm attacks are now also affecting ASP.Net pages, specifically with a&amp;#160; URL of http://www.chliyi.com/m.js (this appears to be offline currently but I wouldn't suggest browsing there...) being injected into those pages.&amp;#160; My team hasn&amp;#8217;t worked on any incidents yet so I can&amp;#8217;t confirm that it is the same issue; however, it certainly looks very similar.&lt;/p&gt;  &lt;p&gt;This is a good time for me to remind everybody that Microsoft does provide no-cost support in the case of a security incident.&amp;#160; If you&amp;#8217;ve been affected, you can call 1-866-PCSAFETY in the United States &amp;amp; Canada.&amp;#160; Outside of that area, refer to &lt;a href="http://support.microsoft.com/common/international.aspx?rdpath=4"&gt;http://support.microsoft.com/common/international.aspx?rdpath=4&lt;/a&gt; to find the right contact information.&amp;#160; &lt;/p&gt;  &lt;p&gt;(Thanks to Erwin Geirnaert for the heads-up.)&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3066167" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Security/">Security</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/SQL/">SQL</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/asp-net/">asp.net</category></item><item><title>SQL Injection:  Trends &amp; Guidance</title><link>http://blogs.technet.com/b/neilcar/archive/2008/05/30/sql-injection-trends-guidance.aspx</link><pubDate>Fri, 30 May 2008 19:17:11 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3063668</guid><dc:creator>neilcar</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.technet.com/b/neilcar/rsscomments.aspx?WeblogPostID=3063668</wfw:commentRss><comments>http://blogs.technet.com/b/neilcar/archive/2008/05/30/sql-injection-trends-guidance.aspx#comments</comments><description>&lt;p&gt;I've been working with the SWI team to write a comprehensive overview of the SQL Storm attacks with guidance for IT administrators, developers, and end users.&amp;#160; That article is posted at &lt;a title="sql-injection-attack.aspx" href="http://blogs.technet.com/swi/archive/2008/05/29/sql-injection-attack.aspx"&gt;sql-injection-attack.aspx&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;For developers, specifically, Bala Neerumalla has written an excellent overview of SQL injection and classic ASP code for MSDN at &lt;a title="cc676512.aspx" href="http://msdn.microsoft.com/en-us/library/cc676512.aspx"&gt;cc676512.aspx&lt;/a&gt;.&amp;#160; This is well worth a read for any developer who has legacy ASP code running -- it covers a variety of scenarios and how to resolve them.&lt;/p&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3063668" width="1" height="1"&gt;</description><category domain="http://blogs.technet.com/b/neilcar/archive/tags/Security/">Security</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/SQL/">SQL</category><category domain="http://blogs.technet.com/b/neilcar/archive/tags/ASP/">ASP</category></item></channel></rss>