<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Casaba Security</title>
	<atom:link href="http://www.casaba.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.casaba.com/blog</link>
	<description>Building and breaking software and robots</description>
	<lastBuildDate>Wed, 11 Jan 2012 18:08:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Porting Watcher checks to ModSecurity rules!</title>
		<link>http://www.casaba.com/blog/2012/01/porting-watcher-checks-to-modsecurity-rules/</link>
		<comments>http://www.casaba.com/blog/2012/01/porting-watcher-checks-to-modsecurity-rules/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 23:55:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[ModSecurity]]></category>
		<category><![CDATA[Watcher]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=381</guid>
		<description><![CDATA[Earlier this year, Ryan Barnett at TrustWave&#8217;s Spiderlabs started porting some of Watcher&#8217;s checks to ModSecurity.   After we chatted about this, I decided to get involved.  We always liked the idea of a server-side scanner watching the Web traffic, and since ModSecurity sits right in the sweet spot it all made sense to focus [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier this year, Ryan Barnett at <a href="http://blog.spiderlabs.com/">TrustWave&#8217;s Spiderlabs</a> started <a href="http://blog.spiderlabs.com/2011/05/modsecurity-advanced-topic-of-the-week-passive-vulnerability-scanning-part-2-watcher-checks.html">porting some of Watcher&#8217;s checks to ModSecurity</a>.   After we chatted about this, I decided to get involved.  We always liked the idea of a server-side scanner watching the Web traffic, and since ModSecurity sits right in the sweet spot it all made sense to focus some effort there.</p>
<p>So over the past few months we&#8217;ve been working to port more of <a title="Watcher passive Web application scanner" href="http://websecuritytool.codeplex.com">Watcher&#8217;s </a>passive Web scanning checks to the<a title="ModSecurity" href="http://modsecurity.org/">ModSecurity </a>open source Web Application Firewall.  It seems to be working out, as some of the rules have made it into the latest release of <a title="Watcher and ModSecurity" href="http://blog.spiderlabs.com/2011/12/announcing-release-of-owasp-modsecurity-core-rule-set-v223.html">ModSecurity&#8217;s Core Rule Set v2.2.3</a> as well as some earlier rule sets.  There&#8217;s more to come.  Please send any feedback to me or Ryan, and look for more rules to be added very soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2012/01/porting-watcher-checks-to-modsecurity-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft &#8220;Roslyn&#8221; based REPL injection.</title>
		<link>http://www.casaba.com/blog/2011/12/microsoft-roslyn-based-repl-injection/</link>
		<comments>http://www.casaba.com/blog/2011/12/microsoft-roslyn-based-repl-injection/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 18:05:12 +0000</pubDate>
		<dc:creator>John Hernandez</dc:creator>
				<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=277</guid>
		<description><![CDATA[Microsoft recently released their new Compiler API codename &#8220;Roslyn&#8221;. If you haven&#8217;t checked it out yet you should. Here&#8217;s the link: http://msdn.microsoft.com/en-us/roslyn/. I wanted to get my hands a little dirty and play with the new API. I&#8217;ve been meaning to look into Managed DLL injection for a while to get code execution for process [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft recently released their new Compiler API codename &#8220;Roslyn&#8221;. If you haven&#8217;t checked it out yet you should. Here&#8217;s the link: http://msdn.microsoft.com/en-us/roslyn/.</p>
<p>I wanted to get my hands a little dirty and play with the new API. I&#8217;ve been meaning to look into Managed DLL injection for a while to get code execution for process interrogation. There are times when we&#8217;re testing that we want to interrogate a process for framework level information. For whatever reasons we sometimes can&#8217;t compile the target with hooks. So it would be nice to have a way to execute code. Roslyn’s CSX files look like a great way to accomplish this so that&#8217;s what I&#8217;m trying to expose. </p>
<p>Currently this only works on 32 bit processes.  </p>
<p>Let&#8217;s start by describing the architecture as there are 3 things going on. The major components are the Injector, Unmanaged Injectee and Managed Injectee. The injector is the controller in this scenario; he&#8217;s responsible for the injection into the managed process and communication between the components. Communication is handled via named pipes. </p>
<p>The injector uses a well-documented dll injection technique via CreateRemoteThread and LoadLibrary. This loads the unmanaged dll into the Managed process. The unmanaged DLL actually handles the Managed DLL injection. I wont go into unmanaged dll injection as it&#8217;s pretty well document technique. I assume the reader understands these concepts. </p>
<p>From this point I assume the unmanaged DLL has been injected into the managed process. </p>
<p>After the unmanaged DLL is injected I need to make sure the correct version of the CLR is loaded. To accomplish this use the CLR hosting API’s to determine the version of the CLR that is loaded by the process (Provided there is one loaded). The host process must be running .Net 4.0 to support the Roslyn API. Because the early versions of the hosting API&#8217;s are deprecated I need to check to see if the .net 4.0 mscoree is loaded &#8220;msvcr100_clr0400.dll&#8221;. I check via a GetModuleHandle. If it exists we know we are running .Net 4.0 and know the CLR is already running. Two birds down with a single stone. </p>
<pre>
hMod = GetModuleHandle(L"msvcr100_clr0400.dll");
</pre>
<p>Once we know the CLR is loaded and it’s 4.0 we can get a handle to the CLSID_CLRMetaHost via:</p>
<pre>
hr = CLRCreateInstance( CLSID_CLRMetaHost,
IID_ICLRMetaHost,
(LPVOID*)&amp;pMetaHost );
</pre>
<p>From the meta host we can get a handle to the running RunTimeHost via:</p>
<pre>
ICLRRuntimeHost *pClrHost = NULL;
runTimeInfo-&gt;GetInterface(CLSID_CLRRuntimeHost, IID_ICLRRuntimeHost, (LPVOID *)&amp;pClrHost);
</pre>
<p>This will return a handle to the current RuntimeHost (Or load the runtime if it isn’t running). The next call is to load my Managed DLL plus call the entry method.</p>
<pre>
pClrHost-&gt;ExecuteInDefaultAppDomain(L"InjectedManagedDll_Net_4.dll", L"InjectedManagedDll_Net_4.InjectedClass", L"Test", L"TestArg" , &amp;ret);
</pre>
<p>This loads the Managed DLL into the process. Once the Managed DLL’s Test method is called I create a managed thread.</p>
<pre>
public static int Test(string param)
{
new Thread(new ThreadStart(ThreadFunc)).Start();
return 666;
}
</pre>
<p>This thread then generates a few more threads and sets up the NamedPipe communication pipe and reports to the server things are setup.</p>
<pre>
static void ThreadFunc()
{
try
{
PipeClient.Instance.Start("CNIPipe");
}
catch (Exception e)
{
PipeClient.Instance.LogMessageToServer(e.Message);
}
}
</pre>
<p>I then expose some simple messages back and forth between the injector and injectee and expose a simple REPL loosely based on this guy’s implementation: http://visualstudiomagazine.com/articles/2011/11/16/the-roslyn-scripting-api.aspx.</p>
<pre>
private ScriptHost()
{

HashSetassemblys = new HashSet();
assemblys.Add(Assembly.GetCallingAssembly());
assemblys.Add(Assembly.GetEntryAssembly());
assemblys.Add(Assembly.GetExecutingAssembly());

Listnamespaces = new List() { "System", "System.Collections", "System.Collections.Generic" };

ScriptEngine = new ScriptEngine(assemblys.ToList(), namespaces);

Session = Session.Create(this);
}

public object Execute(string code)
{
return ScriptEngine.Execute(code, Session);
}
</pre>
<p>This gets you a basic REPL inside another process. Next steps include making sure the communication API between the host and injectee are more well formed and able to handle both 32 and 64 bit processes. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2011/12/microsoft-roslyn-based-repl-injection/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>XML Hell presentation at Blue Hat v11</title>
		<link>http://www.casaba.com/blog/2011/10/xml-hell-presentation-at-blue-hat-v11/</link>
		<comments>http://www.casaba.com/blog/2011/10/xml-hell-presentation-at-blue-hat-v11/#comments</comments>
		<pubDate>Mon, 24 Oct 2011 20:32:06 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=266</guid>
		<description><![CDATA[At Microsoft BlueHat v11 I&#8217;ll be delivering an internal-only briefing along with Matt Swann.  While I can&#8217;t go into the confidential details of the talk, there are some things I want to mention that are more general and already public information.  There&#8217;s significant attack surface when it comes to parsing XML documents, and processing contextual [...]]]></description>
			<content:encoded><![CDATA[<p>At <a title="Microsoft BlueHat" href="http://technet.microsoft.com/en-us/security/hh508834">Microsoft BlueHat v11</a> I&#8217;ll be delivering an internal-only briefing along with Matt Swann.  While I can&#8217;t go into the confidential details of the talk, there are some things I want to mention that are more general and already public information.  There&#8217;s significant attack surface when it comes to parsing XML documents, and processing contextual information in those documents.  The threats are not limited to any one tech stack, and can be found in most of the popular ones.  To name the main exploit scenarios we see and test for regarding XML:</p>
<div>
<ul>
<li>Information Disclosure (file system access)</li>
<li>Logical Abuse</li>
<li>Injection and XSS</li>
<li>Denial of Service</li>
<li>Remote Code Execution</li>
</ul>
</div>
<p>I might blog about each one of these in turn because they&#8217;re each a little different and unfortunately the mitigation is not as simple as &#8220;validate input&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2011/10/xml-hell-presentation-at-blue-hat-v11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New release of Microsoft Web Application Configuration Analyzer v2.0</title>
		<link>http://www.casaba.com/blog/2011/05/new-release-of-microsoft-web-application-configuration-analyzer-v2-0/</link>
		<comments>http://www.casaba.com/blog/2011/05/new-release-of-microsoft-web-application-configuration-analyzer-v2-0/#comments</comments>
		<pubDate>Wed, 18 May 2011 20:33:21 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=261</guid>
		<description><![CDATA[From: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=60585590-57df-4fc1-8f0c-05a286059406 Web Application Configuration Analyzer (WACA) is a tool that scans a server against a set of best practices recommended for pre-production and production servers. It can be used by developers to ensure that their codebase works within a secure / hardened environment (although many of the checks are not as applicable for developers). The [...]]]></description>
			<content:encoded><![CDATA[<p>From: <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=60585590-57df-4fc1-8f0c-05a286059406">http://www.microsoft.com/downloads/en/details.aspx?FamilyID=60585590-57df-4fc1-8f0c-05a286059406</a></p>
<p>Web Application Configuration Analyzer (WACA) is a tool that scans a server against a set of best practices recommended for pre-production and production servers. It can be used by developers to ensure that their codebase works within a secure / hardened environment (although many of the checks are not as applicable for developers). The list of best practices is derived from the Microsoft Information Security &amp; Risk Management Deployment Review Standards used internally at Microsoft to harden production and pre-production environments for line of business applications. The Deployment Review standards themselves were derived from content released by Microsoft Patterns &amp; Practices, in particular: Improving Web Application Security: Threats and Countermeasures available at: http://msdn.microsoft.com/en-us/library/ms994921.aspx. It uses an agent-less scan that requires the user to have admin privileges on the target server, as well as any SQL Server instances running on that machine.</p>
<p>This release of WACA we included some new features.  They include:</p>
<ul>
<li>Suppressions – you can now suppress any rule you feel is not appropriate for your scan.</li>
<li>Saving of suppression files – once you set up a suppression list you want to use you can save it off for future uses.</li>
<li>You can change the suppressions and regenerate the report without needing to re-run the scan.</li>
<li>Reporting – Updated the reporting section to include suppression information so you know what passed, failed, was not applicable and what was suppressed.</li>
<li>Multiple reports – you can view multiple scans of the same machine or view a single machine’s scan and compare it to other machines.</li>
<li>Export to the Microsoft RED format.</li>
<li>Scan multiple systems and SQL instances in one bulk scan.</li>
<li>Additional rules – we’ve added in additional SQL rules.</li>
<li>And of course bug fixes that were missed in the last release.</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2011/05/new-release-of-microsoft-web-application-configuration-analyzer-v2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SDL Requirements and Release Videos Now Online</title>
		<link>http://www.casaba.com/blog/2011/02/sdl-requirements-and-release-videos-now-online/</link>
		<comments>http://www.casaba.com/blog/2011/02/sdl-requirements-and-release-videos-now-online/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 09:03:45 +0000</pubDate>
		<dc:creator>Robert Mooney</dc:creator>
				<category><![CDATA[SDL]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=246</guid>
		<description><![CDATA[Not too long ago Chris, Jason, and myself did a handful of videos with the folks over in the Microsoft SDL and Azure teams on applying the SDL to various phases of the software development process. Give them a watch! Microsoft SDL Requirements Phase: Security Practices http://technet.microsoft.com/en-us/edge/Gg520839 Applying Microsoft SDL Requirements Practices within Windows Azure [...]]]></description>
			<content:encoded><![CDATA[<p>Not too long ago Chris, Jason, and myself did a handful of videos with the folks over in the Microsoft SDL and Azure teams on applying the SDL to various phases of the software development process.</p>
<p>Give them a watch!</p>
<p><strong>Microsoft SDL Requirements Phase: Security Practices</strong><br />
<a href="http://technet.microsoft.com/en-us/edge/Gg520839">http://technet.microsoft.com/en-us/edge/Gg520839</a></p>
<p><strong>Applying Microsoft SDL Requirements Practices within Windows Azure</strong><br />
<a href="http://technet.microsoft.com/en-us/edge/Video/gg482149">http://technet.microsoft.com/en-us/edge/Video/gg482149</a></p>
<p><strong>Microsoft SDL Release Phase: Security Practices</strong><br />
<a href="http://technet.microsoft.com/en-us/edge/video/gg583895">http://technet.microsoft.com/en-us/edge/video/gg583895</a></p>
<p><strong>Applying Microsoft SDL Release Practices within Windows Azure</strong><br />
<a href="http://technet.microsoft.com/en-US/edge/Gg583898">http://technet.microsoft.com/en-US/edge/Gg583898</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2011/02/sdl-requirements-and-release-videos-now-online/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Egyptians Use Low-Tech Gadgets to Get Around Communications Block</title>
		<link>http://www.casaba.com/blog/2011/01/egyptians-use-low-tech-gadgets-to-get-around-communications-block/</link>
		<comments>http://www.casaba.com/blog/2011/01/egyptians-use-low-tech-gadgets-to-get-around-communications-block/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 18:59:40 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=349</guid>
		<description><![CDATA[Chris Weber discusses how &#8220;Egyptians Use Low-Tech Gadgets to Get Around Communications Block&#8221; with FoxNews.com]]></description>
			<content:encoded><![CDATA[<p>Chris Weber discusses how &#8220;<a href="http://www.foxnews.com/scitech/2011/01/28/old-technology-helps-egyptians-communications-black/" title=" Egyptians Use Low-Tech Gadgets to Get Around Communications Block">Egyptians Use Low-Tech Gadgets to Get Around Communications Block</a>&#8221; with FoxNews.com</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2011/01/egyptians-use-low-tech-gadgets-to-get-around-communications-block/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is the Internet Running Out of Room?</title>
		<link>http://www.casaba.com/blog/2011/01/is-the-internet-running-out-of-room/</link>
		<comments>http://www.casaba.com/blog/2011/01/is-the-internet-running-out-of-room/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 18:58:56 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=347</guid>
		<description><![CDATA[Samuel Bucholtz discusses the implications of IPv4 depletion and the IPv6 transition in &#8220;Is the Internet Running Out of Room?&#8220;]]></description>
			<content:encoded><![CDATA[<p>Samuel Bucholtz discusses the implications of IPv4 depletion and the IPv6 transition in &#8220;<a href="http://video.foxnews.com/v/4513668/is-the-internet-running-out-of-room/?playlist_id=86861" title="Is the Internet Running Out of Room?">Is the Internet Running Out of Room?</a>&#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2011/01/is-the-internet-running-out-of-room/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What Would You Do If Your Computer Got Hacked?</title>
		<link>http://www.casaba.com/blog/2011/01/what-would-you-do-if-your-computer-got-hacked/</link>
		<comments>http://www.casaba.com/blog/2011/01/what-would-you-do-if-your-computer-got-hacked/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 18:57:59 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=343</guid>
		<description><![CDATA[Chris Weber and Jason Glassberg on Seattle&#8217;s Q13 Fox News story &#8220;What Would You Do If Your Computer Got Hacked?&#8220;]]></description>
			<content:encoded><![CDATA[<p>Chris Weber and Jason Glassberg on Seattle&#8217;s Q13 Fox News story &#8220;<a href="http://www.q13fox.com/news/what-would-you-do/kcpq-what-would-you-do-if-your-comp-01252011,0,202248.story" title="What Would You Do If Your Computer Got Hacked?">What Would You Do If Your Computer Got Hacked?</a>&#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2011/01/what-would-you-do-if-your-computer-got-hacked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft SDL Release Phase: Security Practices</title>
		<link>http://www.casaba.com/blog/2011/01/microsoft-sdl-release-phase-security-practices/</link>
		<comments>http://www.casaba.com/blog/2011/01/microsoft-sdl-release-phase-security-practices/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 18:57:24 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=341</guid>
		<description><![CDATA[Jason Glassberg, Co-Founder, Casaba, discusses the three security practices of the Microsoft SDL Release phase. Jason talks about the planning for post-release contingencies by creating a well thought-out incident response plan, then stresses the importance of the application of a Final Security Review, its outcomes and mitigation of any outstanding issues. Finally he discusses the [...]]]></description>
			<content:encoded><![CDATA[<p>Jason Glassberg, Co-Founder, Casaba, discusses <a href="http://www.microsoft.com/security/sdl/video/default.aspx?t=Microsoft+SDL+Release+Phase%3a+Security+Practices" title="Microsoft SDL Release Phase: Security Practices">the three security practices of the Microsoft SDL Release phase</a>. Jason talks about the planning for post-release contingencies by creating a well thought-out incident response plan, then stresses the importance of the application of a Final Security Review, its outcomes and mitigation of any outstanding issues. Finally he discusses the archiving of all pertinent information and data to allow for post-release servicing of the software.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2011/01/microsoft-sdl-release-phase-security-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Which E-mail Service is Safest?</title>
		<link>http://www.casaba.com/blog/2011/01/which-e-mail-service-is-safest/</link>
		<comments>http://www.casaba.com/blog/2011/01/which-e-mail-service-is-safest/#comments</comments>
		<pubDate>Tue, 11 Jan 2011 18:53:16 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=335</guid>
		<description><![CDATA[Chris Weber&#8217;s article on &#8220;Which E-mail Service is Safest?&#8221; goes online. Explore the key differences between Hotmail, Gmail, Yahoo Mail, and Facebook and some of the alternatives such as Hushmail and Countermail.]]></description>
			<content:encoded><![CDATA[<p>Chris Weber&#8217;s article on &#8220;<a href="http://www.foxbusiness.com/personal-finance/2011/01/11/e-mail-service-safest/" title="Which E-mail Service is Safest?">Which E-mail Service is Safest?</a>&#8221; goes online. Explore the key differences between Hotmail, Gmail, Yahoo Mail, and Facebook and some of the alternatives such as Hushmail and Countermail.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2011/01/which-e-mail-service-is-safest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grading Steve Ballmer</title>
		<link>http://www.casaba.com/blog/2011/01/grading-steve-ballmer/</link>
		<comments>http://www.casaba.com/blog/2011/01/grading-steve-ballmer/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 18:52:27 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=333</guid>
		<description><![CDATA[Jason Glassberg speaks about &#8220;Grading Steve Ballmer&#8221; on CNBC]]></description>
			<content:encoded><![CDATA[<p>Jason Glassberg speaks about &#8220;<a href="http://video.cnbc.com/gallery/?video=1724299547" title="Grading Steve Ballmer">Grading Steve Ballmer</a>&#8221; on CNBC </p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2011/01/grading-steve-ballmer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>X5S V2.0&#8230;. its coming!</title>
		<link>http://www.casaba.com/blog/2011/01/x5s-v2-0-its-coming/</link>
		<comments>http://www.casaba.com/blog/2011/01/x5s-v2-0-its-coming/#comments</comments>
		<pubDate>Mon, 03 Jan 2011 16:59:22 +0000</pubDate>
		<dc:creator>John Hernandez</dc:creator>
				<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Nebulous]]></category>
		<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Unicode]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=233</guid>
		<description><![CDATA[So, It&#8217;s been awhile since we&#8217;ve done any public updates to X5S. Over the last year, I&#8217;ve improved the algorithm and process significantly. Be on the look out, it should be released within the next couple of weeks (Sometime in Jan. 11). Some of the improvements include: * Better Algorithms for doing checks * Better [...]]]></description>
			<content:encoded><![CDATA[<p>So, It&#8217;s been awhile since we&#8217;ve done any public updates to X5S. Over the last year, I&#8217;ve improved the algorithm and process significantly. Be on the look out, it should be released within the next couple of weeks (Sometime in Jan. 11).</p>
<p>Some of the improvements include:<br />
* Better Algorithms for doing checks<br />
* Better output format .. Now uses a tree view.. Going to add better support for reporting too..<br />
* Cleaner UI (Easier to use)<br />
* Re-factored the code to be cleaner/make more sense and easier to maintain. It&#8217;s much easier to understand/work with.. before was mostly prototyped code/ Alpha code.<br />
* Changed how test cases are defined for more control over the types of injects<br />
* Added a fuzzing mode that will take data from a file and inject it where canaries would normally be injected. (This can be slow with lots of injections)<br />
* Added a replay from Fiddler capture.. (Replays the capture while fuzzing/injecting on the requests). </p>
<p>* many many more minor/significant changes..  =)</p>
<p>Check back soon for a release date!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2011/01/x5s-v2-0-its-coming/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>List of characters for testing Unicode transformations and best-fit mapping to dangerous ASCII</title>
		<link>http://www.casaba.com/blog/2010/12/list-of-characters-for-testing-unicode-transformations-and-best-fit-mapping-to-dangerous-ascii/</link>
		<comments>http://www.casaba.com/blog/2010/12/list-of-characters-for-testing-unicode-transformations-and-best-fit-mapping-to-dangerous-ascii/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 18:54:58 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[bestfit]]></category>
		<category><![CDATA[SQL injection]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=239</guid>
		<description><![CDATA[I&#8217;m attaching two CSV files for use in test cases and tools.  The uni2asc.csv contains all of the Unicode characters that map to something ASCII &#60; 0&#215;80.  The bestfit.csv  contains all of the known best-fit  mappings to dangerous ASCII between legacy charsets and Unicode. uni2asc.csv &#8211; for straight Unicode to Unicode mappings bestfit.csv &#8211; for [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>I&#8217;m attaching two CSV files for use in test cases and tools.  The uni2asc.csv contains all of the Unicode characters that map to something ASCII &lt; 0&#215;80.  The bestfit.csv  contains all of the known best-fit  mappings to dangerous ASCII between legacy charsets and Unicode.</p>
<p><a href="http://www.lookout.net/wp-content/uploads/2010/12/uni2asc.csv">uni2asc.csv</a> &#8211; for straight Unicode to Unicode mappings<br />
<a href="http://www.lookout.net/wp-content/uploads/2010/12/bestfit.csv">bestfit.csv</a> &#8211; for legacy charset to Unicode mappings</p>
<p>I gave these to Gareth so they may wind up in <a href="http://hackvertor.co.uk/public">HackVertor</a>.</p>
<p>The Unicode database contains meta data about every character, including compatibility mappings, normalization mappings, case mappings, and other decomposition data.  It&#8217;s useful for testing to know what special Unicode characters may transform to dangerous ASCII.  For example:</p>
<ul>
<li>U+2134 SCRIPT SMALL O character will transform to the U+006F LATIN SMALL LETTER in certain cases</li>
</ul>
<p>Of course, if you&#8217;re testing for SQL injection or XSS you probably want to know what transforms to dangerous characters like &#8216; and &lt;.  We attempted to automate some of this in our <a href="http://xss.codeplex.com/">x5s tool</a> which has done a good job so far, and we have a big update for that coming soon.</p>
<p>In the bestfit.csv file you&#8217;ll find all of best-fit mappings from Unicode to dangerous ASCII &lt; 0&#215;80 (and vice versa) in many of the legacy charsets from <a href="http://unicode.org/Public/MAPPINGS/">http://unicode.org/Public/MAPPINGS/</a>.  There&#8217;s some wild legacy stuff in here.  For example:</p>
<ul>
<li>
<div id="_mcePaste">In APL-ISO-IR-68, 0&#215;27 maps to 0x5D in Unicode, and vice versa.</div>
</li>
</ul>
<p>If you put these to use anywhere please let me know so I can pass the word along.</p>
</div>
<p>In APL-ISO-IR-68, 0&#215;27 maps to 0x5D in Unicode, and vice versa.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/12/list-of-characters-for-testing-unicode-transformations-and-best-fit-mapping-to-dangerous-ascii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Amazon.com&#8217;s Success in Wikileaks Attack is Proof of Cloud Safety for Businesses</title>
		<link>http://www.casaba.com/blog/2010/12/amazon-coms-success-in-wikileaks-attack-is-proof-of-cloud-safety-for-businesses/</link>
		<comments>http://www.casaba.com/blog/2010/12/amazon-coms-success-in-wikileaks-attack-is-proof-of-cloud-safety-for-businesses/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 18:29:08 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=327</guid>
		<description><![CDATA[Chris Weber on why Amazon.com&#8217;s Success in Wikileaks Attack is Proof of Cloud Safety for Businesses.]]></description>
			<content:encoded><![CDATA[<p>Chris Weber on why <a href="http://www.foxbusiness.com/personal-finance/2010/12/20/amazoncoms-success-wikileaks-attack-proof-cloud-safety-businesses/" title="Amazon.com's Success in Wikileaks Attack is Proof of Cloud Safety for Businesses">Amazon.com&#8217;s Success in Wikileaks Attack is Proof of Cloud Safety for Businesses</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/12/amazon-coms-success-in-wikileaks-attack-is-proof-of-cloud-safety-for-businesses/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We&#8217;re Hiring:  Application Security Consultant and Researcher</title>
		<link>http://www.casaba.com/blog/2010/12/application-security-consultant-and-researcher/</link>
		<comments>http://www.casaba.com/blog/2010/12/application-security-consultant-and-researcher/#comments</comments>
		<pubDate>Sat, 18 Dec 2010 00:04:27 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[career]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=235</guid>
		<description><![CDATA[Want to put your security research skills to the test in Seattle? We&#8217;re looking for junior and senior appsec consultants and vulnerability researchers to join Casaba &#8211; good work/life balance, salary plus profit sharing, 100% health coverage, and some other things I&#8217;m surely forgetting. Oh ya we&#8217;re a small company in our 8th year, there&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Want to put your security research skills to the test in Seattle? We&#8217;re looking for junior and senior appsec consultants and vulnerability researchers to join Casaba &#8211; good work/life balance, salary plus profit sharing, 100% health coverage, and some other things I&#8217;m surely forgetting. Oh ya we&#8217;re a small company in our 8th year, there&#8217;s no middle management and the only politics are outside the office.</p>
<p>You should fit at least 2 of the following profiles:</p>
<p>- <strong>Web-application vulnerability researcher</strong> &#8211; You&#8217;re able to find flaws and exploitable bugs in the most popular and complex products on the Internet. Of course you intimately understand the W3 protocols and can find XSS, CSRF, cross-domain and nasty browser-quirk-related vulns in about the time it takes to pour a cup of coffee. You can also manage a code review of C#, Rails, or Java and document bugs and remediations. When you get bored you spend a night finding cross-domain Same Origin Policy holes in every major browser.</p>
<p>- <strong>Reverse Engineer</strong> &#8211; You&#8217;re able to disassemble and debug even hardened binaries, analyze and dissect a black-box communication protocol, and build a rogue client or server. You&#8217;re of course a master of your chosen programming language, and can script up IDA, PyDbg, and Immunity. You don&#8217;t even need to respond to this job posting, because you&#8217;ve already hacked into my laptop and dropped your resume on my desktop.</p>
<p>- <strong>Fuzzer </strong>- You find more bugs than a pond full of frogs on a warm summer night. At any given moment you have 15 fuzzers running in parallel across a herd of VM&#8217;s. You live for finding zero-days in anything that has a network stack or a file parser. If the art of fuzzing suddenly became useless you&#8217;d probably leave the tech world behind and move to the beach to surf forever.</p>
<p>- <strong>Builder</strong> &#8211; You like to break stuff but would really rather build it. When there&#8217;s a new vulnerability discovered you get excited to build a tool to test for and exploit it. If it&#8217;s related to a browser, protocol, or language you never studied before, even better because now you have an excuse to learn something. If a colleague asks if you can help with a test harness you ask for her short list of requirements. Nothing&#8217;s out of reach, but you&#8217;re not all over the map either. You&#8217;re focused and have one or two major research goals of your own.</p>
<p>Please email &#8216;chris&#8217; (my first name) @casaba.com with at least two profiles that describe you and whether you&#8217;re a fit for a junior or senior level position.</p>
<p>Juniors generally have 1-3 years professional experience, have been to some conferences and have released some tool, paper, or vulnerability. Seniors have done those things and are regular speakers at industry conferences, have their name on a book, and are also capable of managing projects, small teams, and client relationships.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/12/application-security-consultant-and-researcher/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft SDL Requirements Phase: Security Practices</title>
		<link>http://www.casaba.com/blog/2010/12/microsoft-sdl-requirements-phase-security-practices/</link>
		<comments>http://www.casaba.com/blog/2010/12/microsoft-sdl-requirements-phase-security-practices/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 18:55:53 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=339</guid>
		<description><![CDATA[Chris Weber, Managing Partner and Robert Mooney, Senior Software Development, Casaba, speak about the security practices of the &#8220;Requirements&#8221; phase of the Microsoft SDL. Chris and Robert explain the benefits of following the Microsoft SDL to building more secure, reliable, and standard-compliant software. Whitepaper: The Simplified Implementation of the Microsoft SDL]]></description>
			<content:encoded><![CDATA[<p>Chris Weber, Managing Partner and Robert Mooney, Senior Software Development, Casaba, speak about the <a href="http://www.microsoft.com/security/sdl/video/default.aspx?t=Microsoft+SDL+Requirements+Phase%3a+Security+Practices" title="Microsoft SDL Requirements Phase: Security Practices">security practices of the &#8220;Requirements&#8221; phase of the Microsoft SDL</a>. Chris and Robert explain the benefits of following the Microsoft SDL to building more secure, reliable, and standard-compliant software.<br /><BR><br />
Whitepaper: <a href="http://go.microsoft.com/?linkid=9708425" title="Whitepaper: The Simplified Implementation of the Microsoft SDL ">The Simplified Implementation of the Microsoft SDL</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/12/microsoft-sdl-requirements-phase-security-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Applying Microsoft SDL Requirements Practices within Windows Azure</title>
		<link>http://www.casaba.com/blog/2010/12/applying-microsoft-sdl-requirements-practices-within-windows-azure/</link>
		<comments>http://www.casaba.com/blog/2010/12/applying-microsoft-sdl-requirements-practices-within-windows-azure/#comments</comments>
		<pubDate>Tue, 14 Dec 2010 18:54:15 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=337</guid>
		<description><![CDATA[Chris Weber, Managing Partner and Robert Mooney, Senior Software Development, Casaba, speak about applying Microsoft SDL Requirements security practices to applications built on top of Windows Azure, focusing on the &#8220;Requirements&#8221; phase. Chris and Robert stress the similarities of Windows Azure applications to regular web applications, explaining that you won&#8217;t be operating in an entirely [...]]]></description>
			<content:encoded><![CDATA[<p>Chris Weber, Managing Partner and Robert Mooney, Senior Software Development, Casaba, speak about <a href="http://www.microsoft.com/security/sdl/video/default.aspx?t=Applying+Microsoft+SDL+Requirements+Practices+within+Windows+Azure" title="Applying Microsoft SDL Requirements Practices within Windows Azure">applying Microsoft SDL Requirements security practices to applications built on top of Windows Azure</a>, focusing on the &#8220;Requirements&#8221; phase. Chris and Robert stress the similarities of Windows Azure applications to regular web applications, explaining that you won&#8217;t be operating in an entirely new environment, talk about decreased need to focus on infrastructure and platform and increased focus on securing the application layer. The presenters explain the similarities and differences in planning for security and privacy when deploying to Windows Azure, and explain how to map the existing and new risks to the cloud-based environment.</p>
<p>Whitepaper: <a href="http://go.microsoft.com/?linkid=9708425 " title="Whitepaper: The Simplified Implementation of the Microsoft SDL ">The Simplified Implementation of the Microsoft SDL</a><br />
Whitepaper: <a href="http://go.microsoft.com/?linkid=9751872" title="Whitepaper: Security Best Practices for Developing Windows Azure Applications">Security Best Practices for Developing Windows Azure Applications</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/12/applying-microsoft-sdl-requirements-practices-within-windows-azure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8216;Hacktivist&#8217; Jester Claims Responsibility for WikiLeaks Attack</title>
		<link>http://www.casaba.com/blog/2010/12/hacktivist-jester-claims-responsibility-for-wikileaks-attack/</link>
		<comments>http://www.casaba.com/blog/2010/12/hacktivist-jester-claims-responsibility-for-wikileaks-attack/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 18:29:57 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=329</guid>
		<description><![CDATA[Jason Glassberg interviewed by FOX News on &#8220;&#8216;Hacktivist&#8217; Jester Claims Responsibility for WikiLeaks Attack&#8220;]]></description>
			<content:encoded><![CDATA[<p>Jason Glassberg interviewed by FOX News on &#8220;<a href="http://www.foxnews.com/scitech/2010/12/03/patriotic-hactivist-took-down-wikileaks/" title="'Hacktivist' Jester Claims Responsibility for WikiLeaks Attack">&#8216;Hacktivist&#8217; Jester Claims Responsibility for WikiLeaks Attack</a>&#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/12/hacktivist-jester-claims-responsibility-for-wikileaks-attack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Microsoft has been a leader in responding to cyberattacks</title>
		<link>http://www.casaba.com/blog/2010/12/why-microsoft-has-been-a-leader-in-responding-to-cyberattacks/</link>
		<comments>http://www.casaba.com/blog/2010/12/why-microsoft-has-been-a-leader-in-responding-to-cyberattacks/#comments</comments>
		<pubDate>Wed, 01 Dec 2010 18:50:26 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=331</guid>
		<description><![CDATA[Chris Weber&#8217;s guest blog post on The Last Watchdog concerning Microsoft&#8217;s leadership in responding to threats and vulnerabilities in &#8220;Why Microsoft has been a leader in responding to cyberattacks.&#8221;]]></description>
			<content:encoded><![CDATA[<p>Chris Weber&#8217;s guest blog post on The Last Watchdog concerning Microsoft&#8217;s leadership in responding to threats and vulnerabilities in &#8220;<a href="http://lastwatchdog.com/microsoft-leader-responding-cyberattacks/" title="Why Microsoft has been a leader in responding to cyberattacks">Why Microsoft has been a leader in responding to cyberattacks</a>.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/12/why-microsoft-has-been-a-leader-in-responding-to-cyberattacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft wins legal dispute over Bing.com IDN lookalike</title>
		<link>http://www.casaba.com/blog/2010/11/microsoft-wins-legal-dispute-over-bing-com-idn-lookalike/</link>
		<comments>http://www.casaba.com/blog/2010/11/microsoft-wins-legal-dispute-over-bing-com-idn-lookalike/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 19:52:25 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Unicode]]></category>
		<category><![CDATA[confusables]]></category>
		<category><![CDATA[IDN]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=228</guid>
		<description><![CDATA[A couple years ago I tried registering IDNs (Internationalized Domain Names) that were visually identical or similar to popular sites like mozilla.org, bing.com, and google.com. What I found was that I wasn&#8217;t the only one doing this. For me, it was just to demonstrate the possibilities for visual spoofing in modern user-agents, similar to what [...]]]></description>
			<content:encoded><![CDATA[<p>A couple years ago I tried registering IDNs (Internationalized Domain Names) that were visually identical or similar to popular sites like mozilla.org, bing.com, and google.com.  What I found was that I wasn&#8217;t the only one doing this.  For me, it was just to demonstrate the possibilities for visual spoofing in modern user-agents, similar to what we saw in 2005 with the paypal.com spoof.</p>
<p>I don&#8217;t think this recent legal decision made the news anywhere, but Microsoft filed a complaint that a registered domain name <a href="http://www.bıng.com">www.bıng.com</a> was <a href="http://domains.adrforum.com/domains/decisions/1305319.htm">confusingly similar to its <a href="http://www.bing.com">www.bing.com</a> brand</a>.  In case it&#8217;s hard to see, the issue here is with the dotless &#8216;i&#8217; in the lookalike domain.  In that domain, the registrant used Unicode character U+0131 LATIN SMALL LETTER DOTLESS I in place of the usual U+0069 LATIN SMALL LETTER I in bing.com.  </p>
<p>Microsoft won the case on valid merits, and as far as we know there was no harm done.  That is, I haven&#8217;t heard any news of a phishing attack that utilized this domain name.  It&#8217;s easy to imagine the extent of harm possible through a phishing/luring/schmoozing/whatever attack that utilizes confusing IDNs across the context of email clients, web browsers, and other user-agents.  A well-thought attack could be surprisingly effective.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/11/microsoft-wins-legal-dispute-over-bing-com-idn-lookalike/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Asp .Net MVC Security Review Checklist</title>
		<link>http://www.casaba.com/blog/2010/10/asp-net-mvc-security-review-checklist/</link>
		<comments>http://www.casaba.com/blog/2010/10/asp-net-mvc-security-review-checklist/#comments</comments>
		<pubDate>Thu, 14 Oct 2010 18:15:49 +0000</pubDate>
		<dc:creator>John Hernandez</dc:creator>
				<category><![CDATA[Code Review]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false">https://www.casabasecurity.com/blog/?p=225</guid>
		<description><![CDATA[Here’s a little checklist I put together for ASP .Net MVC. It includes the high level stuff to look at when reviewing a MVC application. In order to fully understand/consume the info it requires at least a basic understanding of MVC architecture which can be gained from any introduction document. Some of this stuff could [...]]]></description>
			<content:encoded><![CDATA[<p>Here’s a little checklist I put together for ASP .Net MVC. It includes the high level stuff to look at when reviewing a MVC application. In order to fully understand/consume the info it requires at least a basic understanding of MVC architecture which can be gained from any introduction document. Some of this stuff could be automated through something like FxCop.</p>
<p>Below is an outline of the different components of MVC that are important to look into when reviewing ASP .Net MVC applications. It’s also important to review the normal MVC spec’s to understand context, but here is a “security” minded checklist.</p>
<h2>ViewData Dictionary</h2>
<p>This is used to pass data from a Controller to the View. It’s extremely important to verify the ViewData on both the View and Controller. The ViewData is a dictionary for passing untyped data to the view. It’s important to make a recommendation that either data is encoded on the input or the output and try not to mix the two as you can get yourself in trouble. I think output encoding is easier to manage than input.<br />
Look at the controller actions and the parameters they receive. If they are strings, verify on the output or input encoding occurs for the appropriate uses.  A grep to look for:</p>
<p>ViewData\[“”</p>
<h2>ViewData.Model</h2>
<p>The ViewData.Model is a method for passing TYPED objects back to the view. You can specify a ViewPage&lt;T&gt; where T can be a typed to the value of ViewData.Model. In your controller when you return a View you can pass the object to the page. Example would be return View(“Index”, objOfTypeT)</p>
<p>So it’s important to understand the type being used in this case as unencoded data can make it to the view from this object.</p>
<h2>AntiForgeryToken Attribute</h2>
<p>Any post which would require Anti-CSRF protections should include the AntiForgeryToken Attribute on the controller Action where the post submits to. There is also a requirement on the View side of things to ensure that the AntiForgeryToken is actually used. Make sure that Html.AntiForgeryToken() method is being called within the form definition on the view.</p>
<h2>Public Methods in the Controllers</h2>
<p>Any public methods contained in the controller are accessible via crafted URLs. Verify there are no unintended consequences from public methods, also validate that authZ occurs on appropriate methods.</p>
<h2>Direct browsing View pages</h2>
<p>The View directory for the MVC application contains a web.config for blocking access to view pages among other view wide configurations. It’s important to note that by default .aspx pages are blocked, however if there is a custom extension being used you will to ensure they are explicitly blocked via config. Below are the relevant keys</p>
<p>IIS 6<br />
&lt;add path="*.aspx" verb="*" type="System.Web.HttpNotFoundHandler"/&gt;</p>
<p>IIS 7<br />
&lt;add name="BlockViewHandler" path="*.aspx" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler"/&gt;</p>
<h2>Controller Action Parameters</h2>
<p>Action parameters can be complex types. For example you could have Action with a method signature like below.</p>
<p>[AcceptVerbs("POST")]<br />
public ActionResult Edit(Product product)</p>
<p>In this case Product could have some public properties associated with it like {Name, Id, etc.}. If Price was meant to be set later by the db after a look occurred on the product id you could end up in trouble depending on the logic.</p>
<p>The root problem here is if the complex type exposes a property that was not supposed to be set by the client you could inadvertently end up with a tainted object. Also it introduces a place where unencoded data could make it to the view depending on how the object is used.<br />
Here is a link that explains it better and more in detail.<br />
<a href="http://www.codethinked.com/post/2009/01/08/ASPNET-MVC-Think-Before-You-Bind.aspx">http://www.codethinked.com/post/2009/01/08/ASPNET-MVC-Think-Before-You-Bind.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/10/asp-net-mvc-security-review-checklist/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Detecting malicious URL obfuscation techniques in spam</title>
		<link>http://www.casaba.com/blog/2010/10/detecting-malicious-url-obfuscation-techniques-in-spam/</link>
		<comments>http://www.casaba.com/blog/2010/10/detecting-malicious-url-obfuscation-techniques-in-spam/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 20:12:19 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Malware]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[confusables]]></category>
		<category><![CDATA[spam]]></category>
		<category><![CDATA[UCAPI]]></category>

		<guid isPermaLink="false">https://www.casabasecurity.com/blog/2010/10/detecting-malicious-url-obfuscation-techniques-in-spam/</guid>
		<description><![CDATA[URLs offer loads of fun for pranks, hacks, and spam.&#160; The reasons are numerous and inherent in their structural and visual complexity.&#160; Add IDNs to the mix and the fun-factor just doubled.&#160; But this isn’t about IDNs.&#160; It’s recently been noted by Symantec that spammers are using the soft hyphen character to obfuscate URLs and [...]]]></description>
			<content:encoded><![CDATA[<p>URLs offer loads of fun for pranks, hacks, and spam.&#160; The reasons are numerous and inherent in their structural and visual complexity.&#160; Add IDNs to the mix and the fun-factor just doubled.&#160; But this isn’t about IDNs.&#160; It’s recently been noted by Symantec that spammers are using the <a href="http://www.symantec.com/connect/blogs/soft-hyphen-new-url-obfuscation-technique">soft hyphen character to obfuscate URLs</a> and bypass anti-spam filters.</p>
<p>It’s a neat trick that plays into the widely divergent <a href="http://www.cs.tut.fi/~jkorpela/shy.html">implementation details of this specific character</a>.&#160; In Unicode the soft hyphen is U+00AD but its problem handling in browsers and email clients involves some confusions around its specification in other character sets such as ISO-8859-1 as well as HTML 4.&#160; </p>
<p>The fun shouldn’t stop with soft hyphens though.&#160; There seem to be many interesting ways content inspection filters could be bypassed using characters with special meanings and others with special transformative properties.&#160; I haven’t taken the time to do any thorough testing here, but my <a href="http://www.lookout.net/test-cases/idn-and-iri-spoofing-tests/">IDN and IRI spoofing test page</a> has some examples of what I’m talking about.&#160; If you think of the test cases as plain string content instead of IDNs you can imagine some of the other ways which content filters might be confused.</p>
<p>Looking at the Normalization tests on that page one can see that valid Unicode characters like the Ⓞ get normalized (as hyperlinks) to a Latin small letter ‘o’ by Web browsers through a standard process defined by IDNA2003, namely stringprep with a nameprep profile applied.&#160; That’s just the tip of the iceberg, and still more possibilities for abuse exist.</p>
<p>These issues are why we created the UCAPI library for <a href="http://www.casabasecurity.com/products/UCAPI/">detecting string confusability</a>.&#160; I wonder how many content inspection products are looking at strings in this way?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/10/detecting-malicious-url-obfuscation-techniques-in-spam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IDNA2008 hits the standards track &#8211; visually confusing strings remain a threat</title>
		<link>http://www.casaba.com/blog/2010/08/idna2008-hits-the-standards-track-visually-confusing-strings-remain-a-threat/</link>
		<comments>http://www.casaba.com/blog/2010/08/idna2008-hits-the-standards-track-visually-confusing-strings-remain-a-threat/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 18:27:09 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[confusables]]></category>
		<category><![CDATA[IDN]]></category>

		<guid isPermaLink="false">http://www.casabasecurity.com/blog/?p=216</guid>
		<description><![CDATA[After many years of engineering efforts, the Internationalizing Domain Names in Applications (IDNA) protocol had a major update released from its original 2003 standard. Although named IDNA2008, it hit the standards track in August 2010. It&#8217;s worth noting in section &#8220;4.4 Visually Confusable Characters&#8221; of RFC 5890: It is worth noting that there are no [...]]]></description>
			<content:encoded><![CDATA[<p>After many years of engineering efforts, the Internationalizing Domain Names in Applications (IDNA) protocol had a major update released from its original 2003 standard.  Although named IDNA2008, it hit the standards track in August 2010.  It&#8217;s worth noting in section &#8220;<a href="http://tools.ietf.org/html/rfc5890#section-4.4">4.4 Visually Confusable Characters</a>&#8221; of <a href="http://tools.ietf.org/html/rfc5890">RFC 5890</a>:</p>
<blockquote><p>It is worth noting that there are no comprehensive technical solutions to the problems of confusable characters.  One can reduce the extent of the problems in various ways, but probably never eliminate it.</p></blockquote>
<p>Taken out of context this may sound hopeless, but the RFC goes on to reference Unicode TR36 as providing a set of suggestions for mitigating <a href="http://www.casabasecurity.com/products/UCAPI/">string confusability</a>.  It&#8217;s in this vein that Casaba has built <a href="http://www.casabasecurity.com/products/UCAPI">UCAPI </a>which provides an implementation of the Unicode Consortium&#8217;s suggestions as well as defensive techniques from our own learnings.</p>
<p>I can imagine that we will one day see a wide-spread attack that leverages string confusability &#8211; or maybe &#8211; we won&#8217;t see it because it&#8217;ll blend in so well as to be undetectable.</p>
<p>New registrations of Internationalized Domain Names are expected to increase radicallly over time as ICANN has opened up ccTLD support for Unicode and IDN, as well as gTLD.   As more TLDs become provisioned in native scripts, it&#8217;s expected that they will support the expansion of many more internationalized domain names.</p>
<p>What are registrars doing now to protect customers from lookalike attacks on their brand?  Is it their responsibility?  Who&#8217;s is it?  Many organizations including ICANN are making suggestions, but is anyone listening?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/08/idna2008-hits-the-standards-track-visually-confusing-strings-remain-a-threat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacking IRL: Crafting for the Modern Geek at OSCON</title>
		<link>http://www.casaba.com/blog/2010/07/hacking-irl-crafting-for-the-modern-geek-at-oscon/</link>
		<comments>http://www.casaba.com/blog/2010/07/hacking-irl-crafting-for-the-modern-geek-at-oscon/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 18:27:21 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=325</guid>
		<description><![CDATA[Casaba Security joins the Open Source Convention (OSCON) lineup as Mary Kelly presents Hacking IRL: Crafting for the Modern Geek. What do you get when you mix fractals, 3D printers, robotics, open source, high-powered lasers, and non-orientable surfaces with wood, plastic, textiles, steel, cloth&#8230; and lots of coffee? A completely new range of geek fabricated [...]]]></description>
			<content:encoded><![CDATA[<p>Casaba Security joins the Open Source Convention (OSCON) lineup as Mary Kelly presents <a href="http://www.oscon.com/oscon2010/public/schedule/detail/14070" title="Hacking IRL: Crafting for the Modern Geek at OSCON">Hacking IRL: Crafting for the Modern Geek.</a> </p>
<p>What do you get when you mix fractals, 3D printers, robotics, open source, high-powered lasers, and non-orientable surfaces with wood, plastic, textiles, steel, cloth&#8230; and lots of coffee? A completely new range of geek fabricated items and appliances. It&#8217;s hacking in real life.</p>
<p>Presentation: <a href="http://assets.en.oreilly.com/1/event/45/Hacking%20IRL_%20Crafting%20for%20the%20Modern%20Geek%20Presentation.zip" title="Hacking IRL: Crafting for the Modern Geek Presentation">Hacking IRL: Crafting for the Modern Geek (ZIP)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/07/hacking-irl-crafting-for-the-modern-geek-at-oscon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watcher 1.4.0 released</title>
		<link>http://www.casaba.com/blog/2010/05/watcher-1-4-0-released/</link>
		<comments>http://www.casaba.com/blog/2010/05/watcher-1-4-0-released/#comments</comments>
		<pubDate>Tue, 25 May 2010 19:32:01 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Watcher]]></category>

		<guid isPermaLink="false">http://www.casabasecurity.com/blog/?p=213</guid>
		<description><![CDATA[A new update to the Watcher passive Web-vulnerability scanner has been released. Based on user feedback we&#8217;ve built out the Wiki documentation on Codeplex with more details about the issues identified by each Watcher check. Inside the tool, a reference is now included as a link back to the Wiki. I hope to improve the [...]]]></description>
			<content:encoded><![CDATA[<p>A new update to the Watcher passive Web-vulnerability scanner has been released.  Based on user feedback we&#8217;ve built out the Wiki documentation on Codeplex with more details about the issues identified by each Watcher check.  Inside the tool, a reference is now included as a link back to the Wiki.  I hope to improve the documentation on the Wiki and welcome all your suggestions.</p>
<p>A new check has been added to detect when domain lowering occurs through javascript, typically done by setting document.domain equal to the parent domain.  We&#8217;ve also made some more efforts at noise-reduction, by enabling some of the noise-reduction configurations by default, namely in the cookie and VIEWSTATE checks.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/05/watcher-1-4-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watcher 1.3.0 released</title>
		<link>http://www.casaba.com/blog/2010/02/watcher-1-3-0-released/</link>
		<comments>http://www.casaba.com/blog/2010/02/watcher-1-3-0-released/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 17:40:59 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[TFS]]></category>
		<category><![CDATA[VIEWSTATE]]></category>
		<category><![CDATA[Watcher]]></category>

		<guid isPermaLink="false">http://www.casabasecurity.com/blog/?p=203</guid>
		<description><![CDATA[A new update to the Watcher passive vulnerability detection and security testing tool has been released. Watcher is an open source addon to the Fiddler Web proxy that aids developers, auditors, and penetration testers in finding Web-application security issues as well as hot-spots for deeper review. Among other things, we&#8217;ve added new checks to identify [...]]]></description>
			<content:encoded><![CDATA[<p>A new update to the Watcher passive vulnerability detection and security testing tool has been released.  Watcher is an open source addon to the Fiddler Web proxy that aids developers, auditors, and penetration testers in finding Web-application security issues as well as hot-spots for deeper review. Among other things, we&#8217;ve added new checks to identify the insecure ViewState issues as recently reported by Trustwave&#8217;s SpiderLabs [1].  </p>
<p><a href="http://websecuritytool.codeplex.com/releases/view/22212">Download Watcher </a>from CodePlex.  A short list of new features and improvements includes:</p>
<ul>
<li>A separate, optional component to export results to Team Foundation Server.</li>
<li>New check to identify insecure ASP.NET VIEWSTATE configurations subject to tampering and pervasive XSS attacks. </li>
<li>New check to identify insecure JavaServer MyFaces ViewState subject to tampering and XSS attacks. </li>
<li>New check for Silverlight EnableHtmlAccess.</li>
<li>Export results to HTML report.</li>
<li>Compliance mappings to Microsoft SDL.</li>
<li>If no origin domain is specified, each response domain will be treated as the origin, enabling better cross-domain analysis.</li>
<li>Assorted bug fixes and improvements.</li>
</ul>
<p>Bryan Sullivan and Patrick Toomey&#8217;s ViewStateViewer plugin [2] provided inspiration for detecting ASP.NET VIEWSTATE MAC protection.  When testing .NET 4.0 we discovered a change in the MAC implementation which has also been accounted for in this check.  David Byrne from Trustwave [1] provided most of the methodology ideas for detecting insecure JavaServer MyFaces ViewState.</p>
<p>In addition to the main developers (Robert Mooney and Samuel Bucholtz), we wanted to thank everyone who helped or provided suggestions for this release:</p>
<p>Hidetake Jo<br />
Bryan Sullivan<br />
David Byrne<br />
Jason D. Montgomery<br />
Dave Wichers</p>
<p>[1] Trustwave advisory <a href="https://www.trustwave.com/spiderlabs/advisories/TWSL2010-001.txt.">https://www.trustwave.com/spiderlabs/advisories/TWSL2010-001.txt</a><br />
[2] ViewStateViewer plugin for Fiddler <a href="http://labs.neohapsis.com/2009/08/03/viewstateviewer-a-gui-tool-for-deserializingreserializing-viewstate/">http://labs.neohapsis.com/2009/08/03/viewstateviewer-a-gui-tool-for-deserializingreserializing-viewstate/</a>  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/02/watcher-1-3-0-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft CCI Framework for Deobfuscating .Net binaries. (Part 3)</title>
		<link>http://www.casaba.com/blog/2010/02/microsoft-cci-framework-for-deobfuscating-net-binaries-part-3/</link>
		<comments>http://www.casaba.com/blog/2010/02/microsoft-cci-framework-for-deobfuscating-net-binaries-part-3/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 18:04:51 +0000</pubDate>
		<dc:creator>John Hernandez</dc:creator>
				<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[Nebulous]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Babel]]></category>
		<category><![CDATA[CCI]]></category>
		<category><![CDATA[Deobfuscation]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.casabasecurity.com/blog/?p=188</guid>
		<description><![CDATA[Renaming parts of the assembly. So I promised this last week, but I&#8217;ve been busy on a new project. Below is some code that shows renaming of methods. This is a solution to renaming classes within namespaces. It iterates over each namespace renaming classes from class1 -&#62; classN. This is more useful for human readability [...]]]></description>
			<content:encoded><![CDATA[<p>Renaming parts of the assembly.</p>
<p>So I promised this last week, but I&#8217;ve been busy on a new project. Below is some code that shows renaming of methods. This is a solution to renaming classes within namespaces. It iterates over each namespace renaming classes from class1 -&gt; classN. This is more useful for human readability and tracing logic. I leave it as an exercise to the reader to figure out how to rename other parts of the assembly. But hey if you really need it an get stuck, let me know!</p>
<p>I&#8217;ll be posting a tool at some point that does all these different actions for you. Hopefully I&#8217;ll have a early release out by mid next month. I&#8217;m currently learning WPF well enough to build in visulalizations of the control flow graph. That way after a mutator is applied you can visually see the results.</p>
<p>There is a dictionary in the mutator class that uses the namespace string as a key in order to know which class # i left off at. I test on the string length &lt; 2 because the obfuscators I&#8217;ve seen that do this trick tend to just rename everything to some obscure unicode code point of length 1. Just a easy stop condition. You can use any stop condition that suits your needs.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p188code2'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1882"><td class="code" id="p188code2"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> NamespaceTypeDefinition Visit<span style="color: #008000;">&#40;</span>NamespaceTypeDefinition namespaceTypeDefinition<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
  <span style="color: #6666cc; font-weight: bold;">string</span> key <span style="color: #008000;">=</span> namespaceTypeDefinition<span style="color: #008000;">.</span><span style="color: #0000FF;">ContainingUnitNamespace</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span><span style="color: #008000;">;</span>
  <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">!</span>classDict<span style="color: #008000;">.</span><span style="color: #0000FF;">ContainsKey</span><span style="color: #008000;">&#40;</span>key<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
  <span style="color: #008000;">&#123;</span>
     classDict<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>key, <span style="color: #FF0000;">0</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
  <span style="color: #008000;">&#125;</span>
  <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>namespaceTypeDefinition<span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Length</span> <span style="color: #008000;">&lt;</span> <span style="color: #FF0000;">2</span><span style="color: #008000;">&#41;</span>
  <span style="color: #008000;">&#123;</span>
     <span style="color: #6666cc; font-weight: bold;">int</span> i <span style="color: #008000;">=</span> classDict<span style="color: #008000;">&#91;</span>key<span style="color: #008000;">&#93;</span><span style="color: #008000;">;</span>
     namespaceTypeDefinition<span style="color: #008000;">.</span><span style="color: #0000FF;">Name</span> <span style="color: #008000;">=</span> <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">host</span><span style="color: #008000;">.</span><span style="color: #0000FF;">NameTable</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetNameFor</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">String</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Format</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Class{0}&quot;</span>, i<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
     i<span style="color: #008000;">++;</span>
     classDict<span style="color: #008000;">&#91;</span>key<span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> i<span style="color: #008000;">;</span>
  <span style="color: #008000;">&#125;</span>
  <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Visit</span><span style="color: #008000;">&#40;</span>namespaceTypeDefinition<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/02/microsoft-cci-framework-for-deobfuscating-net-binaries-part-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft CCI Framework for Deobfuscating .Net binaries. (Part 2)</title>
		<link>http://www.casaba.com/blog/2010/02/microsoft-cci-framework-for-deobfuscating-net-binaries-part-2/</link>
		<comments>http://www.casaba.com/blog/2010/02/microsoft-cci-framework-for-deobfuscating-net-binaries-part-2/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 23:53:14 +0000</pubDate>
		<dc:creator>John Hernandez</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Babel]]></category>
		<category><![CDATA[CCI]]></category>
		<category><![CDATA[Deobfuscated]]></category>
		<category><![CDATA[Microsoft CCI]]></category>
		<category><![CDATA[Reversing]]></category>

		<guid isPermaLink="false">http://www.casabasecurity.com/blog/?p=171</guid>
		<description><![CDATA[So yesterday I talked a about using CCI to remove attributes from .Net binaries. Specifically the SupressIldasm attribute. I promised I&#8217;d put up some more code highlighting the framework&#8217;s benefits. So some more detail on the binary I&#8217;m working with. It has been ran through Babel -&#62; Netz -&#62; Babel again. My goals have been [...]]]></description>
			<content:encoded><![CDATA[<p>So yesterday I talked a about using CCI to remove attributes from .Net binaries. Specifically the SupressIldasm attribute. I promised I&#8217;d put up some more code highlighting the framework&#8217;s benefits. So some more detail on the binary I&#8217;m working with. It has been ran through Babel -&gt; Netz -&gt; Babel again. My goals have been to reverse Debabel-&gt; Unpack Netz -&gt; Rebuild the .exe -&gt; debabel again, although the first stage of babel could be skipped, but why not analyze it.</p>
<p>Babel uses a couple of simple techniques to prevent programs like reflector from analyzing protected binaries. These techniques are also found in other protections, so it&#8217;s useful to understand why the work and how they work, they are really very simple.</p>
<p>Today I&#8217;ll cover a simple but annoying technique being employed; inserting junk bytes. Babel inserts junk bytes into the IL stream of each method. When reflected it causes the disassembler to fail as it does not recognize the byte sequences it can&#8217;t continue.</p>
<p>Below is an example of a method ildasm’ed after removing the “suppressIldasm” attribute from the previous post.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p171code5'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1715"><td class="code" id="p171code5"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">class</span> <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">auto</span> ansi beforefieldinit netz<span style="color: #008000;">.</span><span style="color: #0000FF;">NetzStarter</span>
       extends <span style="color: #008000;">&#91;</span>mscorlib<span style="color: #008000;">&#93;</span><span style="color: #000000;">System</span><span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">Object</span>
<span style="color: #008000;">&#123;</span>
  <span style="color: #008000;">.</span><span style="color: #0000FF;">field</span> <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> initonly <span style="color: #6666cc; font-weight: bold;">string</span> Property0
  <span style="color: #008000;">.</span><span style="color: #0000FF;">field</span> <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> initonly <span style="color: #6666cc; font-weight: bold;">string</span> Property1
  <span style="color: #008000;">.</span><span style="color: #0000FF;">field</span> <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> initonly <span style="color: #6666cc; font-weight: bold;">string</span> Property2
  <span style="color: #008000;">.</span><span style="color: #0000FF;">field</span> <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> <span style="color: #008000;">&#91;</span><span style="color: #000000;">System</span><span style="color: #008000;">&#93;</span><span style="color: #000000;">System.<span style="color: #0000FF;">Collections</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">Specialized</span><span style="color: #008000;">.</span><span style="color: #0000FF;">HybridDictionary</span> Property3
  <span style="color: #008000;">.</span><span style="color: #0000FF;">field</span> <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> <span style="color: #008000;">&#91;</span>mscorlib<span style="color: #008000;">&#93;</span><span style="color: #000000;">System.<span style="color: #0000FF;">Resources</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">ResourceManager</span> Property4
  <span style="color: #008000;">.</span><span style="color: #0000FF;">field</span> <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">class</span> <span style="color: #008000;">&#91;</span>mscorlib<span style="color: #008000;">&#93;</span><span style="color: #000000;">System.<span style="color: #0000FF;">Collections</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">ArrayList</span> Property5
  <span style="color: #008000;">.</span><span style="color: #0000FF;">field</span> <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">bool</span> Property6
  <span style="color: #008000;">.</span><span style="color: #0000FF;">method</span> <span style="color: #0600FF; font-weight: bold;">public</span> hidebysig specialname rtspecialname
          instance <span style="color: #6666cc; font-weight: bold;">void</span>  <span style="color: #008000;">.</span><span style="color: #0000FF;">ctor</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> cil managed
  <span style="color: #008000;">&#123;</span>
    <span style="color: #008080; font-style: italic;">// Code size       14 (0xe)</span>
    <span style="color: #008000;">.</span><span style="color: #0000FF;">maxstack</span>  <span style="color: #FF0000;">8</span>
    IL_0000<span style="color: #008000;">:</span>  br         IL_0007
&nbsp;
    IL_0005<span style="color: #008000;">:</span>  unused
    IL_0006<span style="color: #008000;">:</span>  unused
    IL_0007<span style="color: #008000;">:</span>  ldarg<span style="color: #008000;">.</span>0
    IL_0008<span style="color: #008000;">:</span>  call       instance <span style="color: #6666cc; font-weight: bold;">void</span> <span style="color: #008000;">&#91;</span>mscorlib<span style="color: #008000;">&#93;</span><span style="color: #000000;">System</span><span style="color: #008000;">.</span><span style="color: #6666cc; font-weight: bold;">Object</span><span style="color: #008000;">::.</span><span style="color: #0000FF;">ctor</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span>
    IL_000d<span style="color: #008000;">:</span>  ret
  <span style="color: #008000;">&#125;</span> <span style="color: #008080; font-style: italic;">// end of method NetzStarter::.ctor</span></pre></td></tr></table></div>

<p>As you can see it does an absolute jump over some &#8220;unused&#8221; bytes which are really invalid bytes. This way the logic of the program is maintained while confusing the disassembler. One technique I&#8217;ve read to handle this is to use a hex editor to look for the absolute jump op code and nop out those bytes. However this is unreliable as babel inserts bytes not just at the start of the method.</p>
<p><strong>Microsoft CCI to the rescue again!. </strong></p>
<p>So lets use CCI to handle rebuilding the binary by replacing invalid bytes with nops. This way we can now view this application in reflector and be able to navigate it.  Below is the mutator class i wrote to handle NOP&#8217;ing invalid bytes. Again a very simple solution. Now the code is visible in reflector using the IL view. At least you get the &#8220;browsing&#8221; functionality and easily go to functions and view their dependencies and cross-references.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p171code6'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1716"><td class="code" id="p171code6"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> InvalidCodeNOPReplace <span style="color: #008000;">:</span> MetadataMutator
<span style="color: #008000;">&#123;</span>
	<span style="color: #0600FF; font-weight: bold;">public</span> InvalidCodeNOPReplace<span style="color: #008000;">&#40;</span>IMetadataHost host<span style="color: #008000;">&#41;</span>
	    <span style="color: #008000;">:</span> <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">&#40;</span>host<span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
&nbsp;
	<span style="color: #008000;">&#125;</span>
&nbsp;
	<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> List<span style="color: #008000;">&lt;</span>IOperation<span style="color: #008000;">&gt;</span> Visit<span style="color: #008000;">&#40;</span>List<span style="color: #008000;">&lt;</span>IOperation<span style="color: #008000;">&gt;</span> operations<span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
	    operations <span style="color: #008000;">=</span> Utilities<span style="color: #008000;">.</span><span style="color: #0000FF;">ReplaceInvalidOpCodeAsNOP</span><span style="color: #008000;">&#40;</span>operations<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
	    <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Visit</span><span style="color: #008000;">&#40;</span>operations<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> List<span style="color: #008000;">&lt;</span>IOperation<span style="color: #008000;">&gt;</span> ReplaceInvalidOpCodeAsNOP<span style="color: #008000;">&#40;</span>List<span style="color: #008000;">&lt;</span>IOperation<span style="color: #008000;">&gt;</span> ops<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
    List<span style="color: #008000;">&lt;</span>IOperation<span style="color: #008000;">&gt;</span> newOps <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> List<span style="color: #008000;">&lt;</span>IOperation<span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF; font-weight: bold;">foreach</span> <span style="color: #008000;">&#40;</span>IOperation op <span style="color: #0600FF; font-weight: bold;">in</span> ops<span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
&nbsp;
	<span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #008000;">!</span>IsValidOpCode<span style="color: #008000;">&#40;</span>op<span style="color: #008000;">.</span><span style="color: #0000FF;">OperationCode</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
	<span style="color: #008000;">&#123;</span>
	    Operation o <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Operation<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	    o<span style="color: #008000;">.</span><span style="color: #0000FF;">Location</span> <span style="color: #008000;">=</span> op<span style="color: #008000;">.</span><span style="color: #0000FF;">Location</span><span style="color: #008000;">;</span>
	    o<span style="color: #008000;">.</span><span style="color: #0000FF;">Offset</span> <span style="color: #008000;">=</span> op<span style="color: #008000;">.</span><span style="color: #0000FF;">Offset</span><span style="color: #008000;">;</span>
	    o<span style="color: #008000;">.</span><span style="color: #0000FF;">OperationCode</span> <span style="color: #008000;">=</span> OperationCode<span style="color: #008000;">.</span><span style="color: #0000FF;">Nop</span><span style="color: #008000;">;</span>
	    o<span style="color: #008000;">.</span><span style="color: #0000FF;">Value</span> <span style="color: #008000;">=</span> 0x0<span style="color: #008000;">;</span>
	    newOps<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>o<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #008000;">&#125;</span>
	<span style="color: #0600FF; font-weight: bold;">else</span>
	<span style="color: #008000;">&#123;</span>
	    newOps<span style="color: #008000;">.</span><span style="color: #0000FF;">Add</span><span style="color: #008000;">&#40;</span>op<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
	<span style="color: #008000;">&#125;</span>
    <span style="color: #008000;">&#125;</span>
    <span style="color: #0600FF; font-weight: bold;">return</span> newOps<span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> populateOpCodeDic<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#123;</span>
   OpCodes <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> Dictionary<span style="color: #008000;">&lt;</span>OperationCode,<span style="color: #6666cc; font-weight: bold;">int</span><span style="color: #008000;">&gt;</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
   <span style="color: #0600FF; font-weight: bold;">foreach</span><span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span> i <span style="color: #0600FF; font-weight: bold;">in</span> <span style="color: #6666cc; font-weight: bold;">Enum</span><span style="color: #008000;">.</span><span style="color: #0000FF;">GetValues</span><span style="color: #008000;">&#40;</span><a href="http://www.google.com/search?q=typeof+msdn.microsoft.com"><span style="color: #008000;">typeof</span></a><span style="color: #008000;">&#40;</span>OperationCode<span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">&#41;</span>
   <span style="color: #008000;">&#123;</span>
     OpCodes<span style="color: #008000;">&#91;</span><span style="color: #008000;">&#40;</span>OperationCode<span style="color: #008000;">&#41;</span>i<span style="color: #008000;">&#93;</span> <span style="color: #008000;">=</span> i<span style="color: #008000;">;</span>
   <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">bool</span> IsValidOpCode<span style="color: #008000;">&#40;</span>OperationCode opCode<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
       <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>OpCodes <span style="color: #008000;">==</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
       <span style="color: #008000;">&#123;</span>
            populateOpCodeDic<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
       <span style="color: #008000;">&#125;</span>
       <span style="color: #0600FF; font-weight: bold;">return</span> OpCodes<span style="color: #008000;">.</span><span style="color: #0000FF;">ContainsKey</span><span style="color: #008000;">&#40;</span>opCode<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Unfortunately reconstructing the C# source doesn&#8217;t work at this stage due to the nops and invalid branching structure. However, I&#8217;m trying to work out a middle layer which can take a methodbody&#8217;s operations list, abstract it out, turn it in to a control flow graph, optimize it and rewrite. However i&#8217;m still stuck at the rewriting part. I hit a small snag in the logic I haven&#8217;t had time to work out just yet. Hopefully then the C# can be reconstructed.</p>
<p>Tomorrow I&#8217;ll post some simple methods to get readable names out of the method/properties/class names to make following logic easier.</p>
<p>*Edit forgot to add the IsValidOpCode method.</p>
<p>**Edit had to readd disappearing generic types.. Ugh!  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/02/microsoft-cci-framework-for-deobfuscating-net-binaries-part-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft CCI Framework for Deobfuscating .Net binaries.</title>
		<link>http://www.casaba.com/blog/2010/02/microsoft-cci-framework-for-deobfuscating-net-binaries/</link>
		<comments>http://www.casaba.com/blog/2010/02/microsoft-cci-framework-for-deobfuscating-net-binaries/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 20:01:51 +0000</pubDate>
		<dc:creator>John Hernandez</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Malware]]></category>
		<category><![CDATA[Reverse Engineering]]></category>
		<category><![CDATA[Babel]]></category>
		<category><![CDATA[CCI]]></category>
		<category><![CDATA[Deobfuscation]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://www.casabasecurity.com/blog/?p=152</guid>
		<description><![CDATA[We had an issue recently crop up with an obfuscated .Net binary. I’ve been meaning to spend more time reversing .Net protected binaries so I start looking in it. Unfortunately everything I was reading on the forums and internet seemed difficult. Having recently read a little about Microsoft’s CCI framework, I thought this might be [...]]]></description>
			<content:encoded><![CDATA[<p>We had an issue recently crop up with an obfuscated .Net binary. I’ve been meaning to spend more time reversing .Net protected binaries so I start looking in it. Unfortunately everything I was reading on the forums and internet seemed difficult. Having recently read a little about Microsoft’s CCI framework, I thought this might be the best solution to the problem. Using a hex editor and looking for patterns seems hokey and a bit impractical.</p>
<p>So the first thing I decided to try was removing the SuppressIldasmAttribute attribute.  Below is some example code doing just that using CCI and rewriting the file. This produces an executable that works and doesn’t require just hex editing out the attribute leaving an executable that doesn’t run.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p152code8'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1528"><td class="code" id="p152code8"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">static</span> <span style="color: #6666cc; font-weight: bold;">void</span> Main<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span><span style="color: #008000;">&#91;</span><span style="color: #008000;">&#93;</span> args<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
     var host <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> PeReader<span style="color: #008000;">.</span><span style="color: #0000FF;">DefaultHost</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
     var module <span style="color: #008000;">=</span> host<span style="color: #008000;">.</span><span style="color: #0000FF;">LoadUnitFrom</span><span style="color: #008000;">&#40;</span>args<span style="color: #008000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #008000;">&#93;</span><span style="color: #008000;">&#41;</span> <span style="color: #0600FF; font-weight: bold;">as</span> IModule<span style="color: #008000;">;</span>
     var attributeRemover <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> AttributeRemover<span style="color: #008000;">&#40;</span>host<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
     module <span style="color: #008000;">=</span> attributeRemover<span style="color: #008000;">.</span><span style="color: #0000FF;">Visit</span><span style="color: #008000;">&#40;</span>module<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
     Stream peStream <span style="color: #008000;">=</span> File<span style="color: #008000;">.</span><span style="color: #0000FF;">Create</span><span style="color: #008000;">&#40;</span>module<span style="color: #008000;">.</span><span style="color: #0000FF;">Location</span> <span style="color: #666666;">&quot;.fixed&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
     PeWriter<span style="color: #008000;">.</span><span style="color: #0000FF;">WritePeToStream</span><span style="color: #008000;">&#40;</span>module, host, peStream<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
     Console<span style="color: #008000;">.</span><span style="color: #0600FF; font-weight: bold;">Out</span><span style="color: #008000;">.</span><span style="color: #0000FF;">WriteLine</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Finished&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">/*
* Removes the static attribute atm SuppressIldasmAttribute.. can be modified to remove any attribute.
*/</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">class</span> AttributeRemover <span style="color: #008000;">:</span> MetadataMutator
<span style="color: #008000;">&#123;</span>
&nbsp;
     PlatformType pt<span style="color: #008000;">;</span>
&nbsp;
     <span style="color: #0600FF; font-weight: bold;">public</span> AttributeRemover<span style="color: #008000;">&#40;</span>IMetadataHost host<span style="color: #008000;">&#41;</span>
                              <span style="color: #008000;">:</span> <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">&#40;</span>host<span style="color: #008000;">&#41;</span>
     <span style="color: #008000;">&#123;</span>
         pt <span style="color: #008000;">=</span> <a href="http://www.google.com/search?q=new+msdn.microsoft.com"><span style="color: #008000;">new</span></a> PlatformType<span style="color: #008000;">&#40;</span>host<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
     <span style="color: #008000;">&#125;</span>
&nbsp;
     <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">override</span> List<span style="color: #008000;">&lt;</span>ICustomAttribute<span style="color: #008000;">&gt;</span> Visit<span style="color: #008000;">&#40;</span>List<span style="color: #008000;">&lt;</span>ICustomAttribute<span style="color: #008000;">&gt;</span> customAttributes<span style="color: #008000;">&#41;</span>
     <span style="color: #008000;">&#123;</span>
          <span style="color: #0600FF; font-weight: bold;">for</span> <span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">int</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> i <span style="color: #008000;">&lt;</span> customAttributes<span style="color: #008000;">.</span><span style="color: #0000FF;">Count</span><span style="color: #008000;">;</span> i<span style="color: #008000;">++</span>  <span style="color: #008000;">&#41;</span>
          <span style="color: #008000;">&#123;</span>
               <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span>customAttributes<span style="color: #008000;">&#91;</span>i<span style="color: #008000;">&#93;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Type</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToString</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">==</span> <span style="color: #666666;">&quot;System.Runtime.CompilerServices.SuppressIldasmAttribute&quot;</span><span style="color: #008000;">&#41;</span>
               <span style="color: #008000;">&#123;</span>
                    customAttributes<span style="color: #008000;">.</span><span style="color: #0000FF;">RemoveAt</span><span style="color: #008000;">&#40;</span>i<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
                    <span style="color: #0600FF; font-weight: bold;">break</span><span style="color: #008000;">;</span>
               <span style="color: #008000;">&#125;</span>
          <span style="color: #008000;">&#125;</span>
          <span style="color: #0600FF; font-weight: bold;">return</span> <span style="color: #0600FF; font-weight: bold;">base</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Visit</span><span style="color: #008000;">&#40;</span>customAttributes<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
     <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>As you can see it requires very little code. Anyways that’s enough for this post. I also have some more code I’ll be posting that uses CCI to rename methods/class/methods from their “mangled names” and code that removes invalid OpCodes so reflector works at the IL level. I’m still working on code that goes through creates a optimized methods to remove the invalid jumps such that C# code can hopefully be reconstructed. We’ll see how that goes.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/02/microsoft-cci-framework-for-deobfuscating-net-binaries/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Casaba a Consulting Member of Microsoft SDL Pro Network</title>
		<link>http://www.casaba.com/blog/2010/02/casaba-a-consulting-member-of-microsoft-sdl-pro-network/</link>
		<comments>http://www.casaba.com/blog/2010/02/casaba-a-consulting-member-of-microsoft-sdl-pro-network/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 18:26:37 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=323</guid>
		<description><![CDATA[Casaba is now a member of Microsoft&#8217;s SDL Pro Network. This relationship with Microsoft&#8217;s SDL Pro Network will foster Casaba&#8217;s commitment to providing top-quality SDL services to our clients.]]></description>
			<content:encoded><![CDATA[<p>Casaba is now a member of Microsoft&#8217;s SDL Pro Network. This relationship with <a href="http://www.microsoft.com/security/sdl/adopt/pronetwork.aspx" title="Microsoft SDL Pro Network">Microsoft&#8217;s SDL Pro Network</a> will foster Casaba&#8217;s commitment to providing top-quality SDL services to our clients.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2010/02/casaba-a-consulting-member-of-microsoft-sdl-pro-network/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Around Conditionally Banned APIs When Using Microsoft&#8217;s banned.h Header File</title>
		<link>http://www.casaba.com/blog/2009/12/getting-around-conditionally-banned-apis-when-using-microsofts-banned-h-header-file/</link>
		<comments>http://www.casaba.com/blog/2009/12/getting-around-conditionally-banned-apis-when-using-microsofts-banned-h-header-file/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 23:42:28 +0000</pubDate>
		<dc:creator>Ramsey Dow</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SDL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This code sample makes use of banned.h, a Microsoft-supplied header file that deprecates dangerous CRT functions. Microsoft also poisons these functions on UNIX if you include banned.h there. This is a Good Thing, but what about the fact that they banned strlen? The banned API page states: For critical functions, such as those accepting anonymous [...]]]></description>
			<content:encoded><![CDATA[<p>This code sample makes use of <a href="http://download.microsoft.com/download/2/e/b/2ebac853-63b7-49b4-b66f-9fd85f37c0f5/banned.h" target="new"><code>banned.h</code></a>, a Microsoft-supplied header file that deprecates dangerous CRT functions. Microsoft also poisons these functions on UNIX if you include <code>banned.h</code> there. This is a Good Thing, but what about the fact that they banned <a href="http://msdn.microsoft.com/en-us/library/78zh94ax%28VS.71%29.aspx" target="new"><code>strlen</code></a>? The <a href="http://msdn.microsoft.com/en-us/library/bb288454.aspx" target="new">banned API page</a> states:</p>
<p><em>For critical functions, such as those accepting anonymous Internet connections, <code>strlen</code> must also be replaced.</em></p>
<p>That&#8217;s good advice for cases where you want to operate on untrusted data. In those cases they tell you that you should use <a href="http://msdn.microsoft.com/en-us/library/z50ty2zh.aspx" target="new"><code>strnlen_s</code></a>. The problem is, <code>banned.h</code> straight out bans <code>strlen</code>. There is no way to tell it that hey, this particular invocation is safe because I control the buffer in all aspects. Nope, sorry. You can&#8217;t use <code>strlen</code>. Or can you?</p>
<p>Here is a code sample that uses <code>banned.h</code> to deprecate unsafe APIs, yet still manages to invoke <code>strlen</code> when necessary. The sample works in both <a href="http://msdn.microsoft.com/en-us/vstudio/default.aspx" target="new">Visual Studio</a> on Windows and <a href="http://gcc.gnu.org/" target="new">GCC</a> on UNIX.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p5code10'); return false;">View Code</a> C</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p510"><td class="code" id="p5code10"><pre class="c" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">//</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//  banned_test.c</span>
<span style="color: #666666; font-style: italic;">//  20091208 ramsey@casabasecurity.com</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">//  A sample program that illustrates how to &quot;grandfather in&quot; banned APIs</span>
<span style="color: #666666; font-style: italic;">//  for use when they are marked deprecated (Windows) or poisoned (UNIX)</span>
<span style="color: #666666; font-style: italic;">//  by the compiler.</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">//  to compile on Windows:</span>
<span style="color: #666666; font-style: italic;">//  cl /GS /W4 /WX banned_test.c</span>
<span style="color: #666666; font-style: italic;">//</span>
<span style="color: #666666; font-style: italic;">//  to compile on UNIX:</span>
<span style="color: #666666; font-style: italic;">//  gcc -Wall -Werror banned_test.c</span>
&nbsp;
<span style="color: #339933;">#if defined _WIN32</span>
&nbsp;
<span style="color: #339933;">#include &lt;windows.h&gt;</span>
<span style="color: #339933;">#endif    // _WIN32</span>
&nbsp;
<span style="color: #339933;">#include &lt;stdio.h&gt;</span>
<span style="color: #339933;">#include &lt;string.h&gt;</span>
<span style="color: #339933;">#if defined _WIN32</span>
&nbsp;
size_t my_strlen<span style="color: #009900;">&#40;</span><span style="color: #993333;">const</span> <span style="color: #993333;">char</span> <span style="color: #339933;">*</span><span style="color: #993333;">string</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  size_t len<span style="color: #339933;">;</span>
  <span style="color: #339933;">#pragma warning(push)</span>
  <span style="color: #339933;">#pragma warning(disable:4995)</span>
  len <span style="color: #339933;">=</span> strlen<span style="color: #009900;">&#40;</span><span style="color: #993333;">string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #339933;">#pragma warning(pop)</span>
  <span style="color: #b1b100;">return</span> len<span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #339933;">#else</span>
<span style="color: #339933;">#define my_strlen strlen</span>
<span style="color: #339933;">#endif    // _WIN32</span>
&nbsp;
<span style="color: #339933;">#include &quot;banned.h&quot;</span>
&nbsp;
<span style="color: #993333;">int</span> main<span style="color: #009900;">&#40;</span><span style="color: #993333;">int</span> ac<span style="color: #339933;">,</span> <span style="color: #993333;">char</span> <span style="color: #339933;">**</span>av<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #993333;">char</span> <span style="color: #339933;">*</span>str <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;foo&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #339933;">#if defined _WIN32</span>
  UNREFERENCED_PARAMETER<span style="color: #009900;">&#40;</span>ac<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  UNREFERENCED_PARAMETER<span style="color: #009900;">&#40;</span>av<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #339933;">#endif    // _WIN32</span>
  <span style="color: #339933;">#if defined _WIN32</span>
  <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;len is %Id<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> strlen<span style="color: #009900;">&#40;</span>str<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #339933;">#else</span>
  <span style="color: #009900;">&#40;</span><span style="color: #993333;">void</span><span style="color: #009900;">&#41;</span><a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;">printf</span></a><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;len is %zd<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> strlen<span style="color: #009900;">&#40;</span>str<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #339933;">#endif    // _WIN32</span>
  <span style="color: #b1b100;">return</span> <span style="color: #0000dd;">0</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Note that this code requires the use of Microsoft&#8217;s <code>banned.h</code> header file, which can be downloaded <a href="http://download.microsoft.com/download/2/e/b/2ebac853-63b7-49b4-b66f-9fd85f37c0f5/banned.h" target="new">here</a>. Stick it in the same directory as the above source file.</p>
<p>To compile the sample in Windows from a Visual Studio Command Prompt:</p>
<pre>

cl banned_test.c /GS /W4 /WX
</pre>
<p>As expected, this program will generate an error when run:</p>
<pre>

banned_test.c

banned_test.c(50) : error C2220: warning treated as error - no 'object' file generated

banned_test.c(50) : warning C4995: 'strlen': name was marked as #pragma deprecated
</pre>
<p>Now edit <code>banned_test.c</code> and change the <code>strlen</code> on line 50 to <code>my_strlen</code> and recompile:</p>
<pre>

cl banned_test.c /GS /W4 /WX
</pre>
<p>It should compile without error. Now run it and you should see:</p>
<pre>

len is 3
</pre>
<p>Nifty.</p>
<p>The same code works without change on UNIX (tested on NetBSD):</p>
<pre>

gcc -Wall -Werror banned_test.c
</pre>
<p>As with the Windows example, running the program will generate an error, as expected:</p>
<pre>

banned_test.c:52:31: error: attempt to use poisoned "strlen"
</pre>
<p>Again, change the occurrence of <code>strlen</code> (this time on line 52) to <code>my_strlen</code> and recompile. It will work and when run, it will say:</p>
<pre>

len is 3
</pre>
<p>What&#8217;s going on here is simple. While we are banning use of the <code>strlen</code> function, we are still allowing its use selectively through a wrapper that we have &#8220;grandfathered in.&#8221; This is easy to accomplish in UNIX: we simply
<pre>#define my_strlen strlen</pre>
<p> prior to including <code>banned.h</code> and use that function call entry point instead. Problem solved. This is not as easy to accomplish with Windows, however, as <code>cl.exe</code> has no notion of &#8220;grandfathering in&#8221; deprecated APIs. So what we do is wrap <code>strlen</code> in another function. We ignore the deprecation warning that occurs where we make the call to <code>strlen</code> through the judicious application of some Visual Studio-specific <code>pragma</code> instructions. Now all need to do is call in to our new function entry point. We&#8217;re good to go. The Windows solution requires a little more work up front, but turns out to be not so hard to accomplish after all.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/12/getting-around-conditionally-banned-apis-when-using-microsofts-banned-h-header-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preventing Security Development Errors: Lessons Learned at Windows Live by Using ASP.NET MVC</title>
		<link>http://www.casaba.com/blog/2009/11/preventing-security-development-errors-lessons-learned-at-windows-live-by-using-asp-net-mvc/</link>
		<comments>http://www.casaba.com/blog/2009/11/preventing-security-development-errors-lessons-learned-at-windows-live-by-using-asp-net-mvc/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 21:42:45 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[MVC]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Casaba had the opportunity to contribute to a new Microsoft paper regarding ASP.NET MVC security. It&#039;s online through the SDL pages, and here&#39;s the paper&#39;s direct link. A short summary of the paper follows. The SDL preaches &#039;secure by default&#039;. When Windows Live moved to ASP.Net MVC, they used that opportunity to build mitigations into [...]]]></description>
			<content:encoded><![CDATA[<p>Casaba had the opportunity to contribute to a new Microsoft paper regarding ASP.NET MVC security.  It&#039;s online through the <a href="http://www.microsoft.com/security/sdl/"> SDL pages</a>, and here&#39;s the paper&#39;s <a href="http://go.microsoft.com/?linkid=9695423">direct link</a>.  A short summary of the paper follows.</p>
<p>The SDL preaches &#039;secure by default&#039;. When Windows Live moved to ASP.Net MVC, they used that opportunity to build mitigations into the framework that prevent developers from making accidental errors which result in security flaws. Specifically, they targeted these three security issues – XSRF, Open redirects and JSON hijacking. </p>
<p>For XSRF, the mitigation was that all HTTP requests are checked for a canary by default except for HTTP GET requests. Developers can also opt-out specific pages or functionality. This automatic ‘on-by-default’ canary checking prevents accidental errors which lead to XSRF. </p>
<p>For Open redirects, Windows Live added a wrapper around the Redirect result in ASP.Net MVC which checks a list of approved domains. This way when a developer called Redirect and forgot to ensure it was safe, the wrapper would cover them automatically. </p>
<p>For JSON hijacking, they ensure that the JSON result included a canary check by default.  This prevented developers from being able to return JSON without a canary, thus preventing JSON hijacking.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/11/preventing-security-development-errors-lessons-learned-at-windows-live-by-using-asp-net-mvc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On the Importance of Good Developer Documentation</title>
		<link>http://www.casaba.com/blog/2009/11/on-the-importance-of-good-developer-documentation/</link>
		<comments>http://www.casaba.com/blog/2009/11/on-the-importance-of-good-developer-documentation/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 19:01:27 +0000</pubDate>
		<dc:creator>Ramsey Dow</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SDL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Programmers rely on documentation. It&#039;s how we learn to use APIs. Misusing APIs is a leading source of vulnerability. You might think that documentation is a cure to this ailment. Unfortunately, as someone who has been in software development for a long time, I can tell you that documentation quality is not always what it [...]]]></description>
			<content:encoded><![CDATA[<p>Programmers rely on documentation. It&#039;s how we learn to use APIs. Misusing APIs is a leading source of vulnerability. You might think that documentation is a cure to this ailment. Unfortunately, as someone who has been in software development for a long time, I can tell you that documentation quality is not always what it should be. API documentation serves as a reference. I have yet to meet the programmer who can recall every nuance about every API for all the languages they program in. (Were such a programmer to exist, its name might well be <a href="http://en.wikipedia.org/wiki/Robby_the_Robot">Robby the Robot</a>.) </p>
<p>Recently I was converting strings using the <a href="http://msdn.microsoft.com/en-us/library/eyktyxsx.aspx">mbstowcs_s</a> and <a href="http://msdn.microsoft.com/en-us/library/s7wzt4be.aspx">wcstombs_s</a> functions. (These are from from the bounds checking extensions to the C Library specified in ISO/IEC TR 24731-1.) These functions allow you to convert multibyte character sequences to and from wide character sequences. These functions are available to C and C++ programmers using Microsoft&#039;s Visual Studio compiler. (I am not yet aware of any UNIX compatible compiler that supports the draft TR 24731-1 standard.)</p>
<p>Since these two functions convert strings, it is worth looking at the parameters they expect. (Not doing so is a sure fire way to do something stupid, like enable a buffer overflow.) Looking at the relevant parameters for these two functions, we see:</p>
<p><strong>mbstowcs_s</strong>:<br />
[in] <em>sizeInWords</em><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The size of the wcstr buffer in words.<br />
[in] <em>count</em><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The maximum number of wide characters to store in the wcstr buffer, not including the terminating null, or <a href="http://msdn.microsoft.com/en-us/library/ms175769.aspx">_TRUNCATE</a>.</p>
<p><strong>wcstombs_s</strong>:<br />
[in] <em>sizeInBytes</em><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The size in bytes of the mbstr buffer.<br />
[in] <em>count</em><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The maximum number of bytes to be stored in the mbstr buffer, or <a href="http://msdn.microsoft.com/en-us/library/ms175769.aspx">_TRUNCATE</a>.</p>
<p>Does count in wcstombs_s account for the terminating NULL or not? Failure to account for this could introduce an off-by-one error which, in turn, may lead to an exploitable condition, such as a buffer overflow. How can we determine this from the documentation? Well, in its current state, we can&#039;t. This is what we call a &#8220;doc bug.&#8221;</p>
<p>Luckily, Microsoft includes the source code for the C Runtime with most Visual Studio SKUs. Assuming you installed Visual Studio in Program Files, you should be able to find the CRT source code in Program Files\Microsoft Visual Studio 9.0\VC\crt\src. CRT source code is included with all Visual Studio SKUs except for the Express Editions. Luckily for Express Edition users, the forthcoming Visual Studio 2010 release finally opens up the CRT sources to Express Edition users. If you are using an Express Edition of VS2008 or earlier, consider grabbing the VS2010 Express beta from <a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx">here</a>.</p>
<p>In any case, if you have the CRT source code, it is easy to track down the source for wcstombs_s and check to see if the terminating NULL is intended to be accounted for or not. Looking into wcstombs.c we discover this bit of text in the comment for the wcstombs_s function:<br />
<code><br />
size_t n = maximum number of bytes to store in s (not including the terminating NULL)<br />
</code></p>
<p>Clearly, the terminating NULL is not meant to be included. This is as we suspected, but now we have verified it instead of blindly assuming that it would be the case. As security practitioners we should be careful not to make assumptions. Verify instead!</p>
<p>This documentation bug has been reported to Microsoft. With any luck it will get addressed prior to the VS 2010 release on March 22, 2010.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/11/on-the-importance-of-good-developer-documentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security Tesing with Watcher at AppSecDC</title>
		<link>http://www.casaba.com/blog/2009/11/security-tesing-with-watcher-at-appsecdc/</link>
		<comments>http://www.casaba.com/blog/2009/11/security-tesing-with-watcher-at-appsecdc/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 18:25:17 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=321</guid>
		<description><![CDATA[Chris Weber speaks on &#8220;Security Tesing with Watcher&#8221; at OWASP&#8217;s AppSecDC on Unicode security testing and Web-app security testing with the Watcher tool.]]></description>
			<content:encoded><![CDATA[<p>Chris Weber speaks on &#8220;Security Tesing with Watcher&#8221; at OWASP&#8217;s <a href="http://www.appsecdc.com/" title="AppSecDC">AppSecDC</a> on Unicode security testing and Web-app security testing with the <a href="http://www.casaba.com/products/watcher/" title="Watcher at Casaba">Watcher</a> tool.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/11/security-tesing-with-watcher-at-appsecdc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Character Transformations: Finding Hidden Vulnerabilities at BlueHat</title>
		<link>http://www.casaba.com/blog/2009/10/character-transformations-finding-hidden-vulnerabilities-at-bluehat/</link>
		<comments>http://www.casaba.com/blog/2009/10/character-transformations-finding-hidden-vulnerabilities-at-bluehat/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 18:24:16 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=319</guid>
		<description><![CDATA[Chris Weber speaks on &#8220;Character Transformations: Finding Hidden Vulnerabilities&#8221; at Microsoft&#8217;s BlueHat on Unicode and Globalization security testing.]]></description>
			<content:encoded><![CDATA[<p>Chris Weber speaks on &#8220;<a href="http://technet.microsoft.com/en-us/security/ee460903#weber" title="Character Transformations: Finding Hidden Vulnerabilities at BlueHat">Character Transformations: Finding Hidden Vulnerabilities</a>&#8221; at Microsoft&#8217;s <a href="http://technet.microsoft.com/en-us/security/cc261637.aspx" title="BlueHat">BlueHat</a> on Unicode and Globalization security testing.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/10/character-transformations-finding-hidden-vulnerabilities-at-bluehat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use the Source, Luke!</title>
		<link>http://www.casaba.com/blog/2009/10/use-the-source-luke/</link>
		<comments>http://www.casaba.com/blog/2009/10/use-the-source-luke/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 19:35:13 +0000</pubDate>
		<dc:creator>Ramsey Dow</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SDL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[If there&#039;s one thing that I&#039;ve learned throughout the years as a programmer, it is not always safe to trust the documentation. In fact, there is an old saying, &#8220;Use the source, Luke!&#8221; When possible, you should do just that. While looking over the CERT Secure C Coding Standard I noticed the following recommendation: ERR30-C. [...]]]></description>
			<content:encoded><![CDATA[<p>If there&#039;s one thing that I&#039;ve learned throughout the years as a programmer, it is not always safe to trust the documentation. In fact, there is an old saying, &#8220;Use the source, Luke!&#8221; When possible, you should do just that.</p>
<p>While looking over the <a href="http://www.cert.org/">CERT</a> <a href="https://www.securecoding.cert.org/confluence/display/seccode/CERT+C+Secure+Coding+Standard">Secure C Coding Standard</a> I noticed the following recommendation: <a href="https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=6619179">ERR30-C. Set <code>errno</code> to zero before calling a library function known to set <code>errno</code>, and check <code>errno</code> only after the function returns a value indicating failure</a>. CERT goes on to write, &#8220;[s]ome functions lack documentation regarding <code>errno</code> in the C99 standard.&#8221; They follow this up with an example for Windows: &#8220;[i]n this compliant solution, <code>errno</code> is not checked because <code>fopen()</code> makes no promise of setting it.&#8221; This would be fine, were it true. However, it is false. Let us take a closer look.</p>
<p>It is true that the symbol, <code>errno</code>, appears nowhere in the MSDN documentation for <a href="http://msdn.microsoft.com/en-us/library/yeby3zcb%28VS.71%29.aspx">fopen</a>. However, one need only look to <code>fopen.c</code> (included with all commercial Visual C implementations) to see that <code>errno.h</code> is <code>#include</code>&#039;d and <code>errno</code> is indeed set for locked streams, bad names (e.g., empty string), et al.</p>
<p>The use of <code>errno</code> is not as robust in the case of Microsoft&#039;s <code>fopen</code> implementation as it is in the implementation on my <a href="http://www.netbsd.org/">NetBSD</a> box, but that&#039;s not the point. The point is that CERT stated something was true based on documentation when in fact, it was not true. The lesson here is that one cannot simply rely on assumptions based on documentation, one must also look to the source to see what is happening.</p>
<p>In the case of Microsoft&#039;s C and secure C runtimes, the source code is available for you to look at, provided you have Visual Studio installed. (Caveat: you don&#039;t get the CRT source code if you install Visual C++ Express.) I found the code living on my box under Program Files at Microsoft Visual Studio 9.0\VC\crt\src.</p>
<p>Of course, if you&#039;re programming on Windows you should prefer <a href="http://msdn.microsoft.com/en-us/library/z5hh6ee9%28VS.80%29.aspx"><code>fopen_s</code></a> to <code>fopen</code> anyway. For the record, the MSDN documentation for <code>fopen_s</code> clearly states that it returns an <code>errno_t</code>, which is the <a href="http://msdn.microsoft.com/en-us/library/8ef0s5kh%28VS.80%29.aspx">Secure CRT</a>&#039;s answer to <code>errno</code>.</p>
<p>Update: I just found out from a source inside the Visual Studio team at Microsoft that Visual Studio 2010 Beta 2&#039;s Express Edition SKU contains the CRT source code. That&#039;s good news. You can get more information on Visual Studio 2010 Beta 2 <a href="http://blogs.msdn.com/webdevtools/archive/2009/10/21/web-tools-beta-2-overview.aspx">here</a>, and you can download it <a href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/10/use-the-source-luke/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unicode security vulnerabilities &#8211; presentation from Internationalization and Unicode Conference 33</title>
		<link>http://www.casaba.com/blog/2009/10/unicode-security-vulnerabilities-presentation-from-internationalization-and-unicode-conference-33/</link>
		<comments>http://www.casaba.com/blog/2009/10/unicode-security-vulnerabilities-presentation-from-internationalization-and-unicode-conference-33/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 19:24:44 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Unicode]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I&#039;m attaching my slides from the Unicode conference last week in San Jose, California. I&#039;m getting much feedback for code-level action items. Providing details for code review and static analysis is in the works, with a focus on major frameworks such as ICU, .NET, and Java. You can download the presentation here.]]></description>
			<content:encoded><![CDATA[<p>I&#039;m attaching my slides from the Unicode conference last week in San Jose, California.  I&#039;m getting much feedback for code-level action items.  Providing details for code review and static analysis is in the works, with a focus on major frameworks such as ICU, .NET, and Java.</p>
<p>You can <a href="http://www.casabasecurity.com/files/Chris_Weber_Character%20Transformations%20v1.7_IUC33.pdf"> download the presentation here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/10/unicode-security-vulnerabilities-presentation-from-internationalization-and-unicode-conference-33/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unicode Transformations and Security Vulnerabilities at UIC33</title>
		<link>http://www.casaba.com/blog/2009/10/unicode-transformations-and-security-vulnerabilities-at-uic33/</link>
		<comments>http://www.casaba.com/blog/2009/10/unicode-transformations-and-security-vulnerabilities-at-uic33/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 18:23:13 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=317</guid>
		<description><![CDATA[Chris Weber speaks on &#8220;Unicode Transformations and Security Vulnerabilities&#8221; the Internationalization and Unicode Conference 33.]]></description>
			<content:encoded><![CDATA[<p>Chris Weber speaks on &#8220;<a href="http://www.unicodeconference.org/iuc33/program-d.htm#S10-T3" title="Unicode Transformations and Security Vulnerabilities at UIC33">Unicode Transformations and Security Vulnerabilities</a>&#8221; the Internationalization and Unicode Conference 33.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/10/unicode-transformations-and-security-vulnerabilities-at-uic33/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New improved Watcher version 1.2.2 released</title>
		<link>http://www.casaba.com/blog/2009/08/new-improved-watcher-version-1-2-2-released/</link>
		<comments>http://www.casaba.com/blog/2009/08/new-improved-watcher-version-1-2-2-released/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 00:23:02 +0000</pubDate>
		<dc:creator>Samuel Bucholtz</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Watcher]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[A new point version of Watcher, Casaba&#039;s open source, passive, web security analyzer has been released on Codeplex. New in this version is multi-threaded check engine, support for OWASP&#039;s Application Security Verification Standard, and a number of new security checks. For more information checkout: http://websecuritytool.codeplex.com/]]></description>
			<content:encoded><![CDATA[<p>A new point version of Watcher, Casaba&#039;s open source, passive, web security analyzer has been released on Codeplex. New in this version is multi-threaded check engine, support for OWASP&#039;s Application Security Verification Standard, and a number of new security checks.</p>
<p>For more information checkout: <a href="http://websecuritytool.codeplex.com/" title="http://websecuritytool.codeplex.com/">http://websecuritytool.codeplex.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/08/new-improved-watcher-version-1-2-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Vim plugin for highlighting APIs banned by the Microsoft SDL</title>
		<link>http://www.casaba.com/blog/2009/08/a-vim-plugin-for-highlighting-apis-banned-by-the-microsoft-sdl/</link>
		<comments>http://www.casaba.com/blog/2009/08/a-vim-plugin-for-highlighting-apis-banned-by-the-microsoft-sdl/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 01:03:46 +0000</pubDate>
		<dc:creator>Ramsey Dow</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SDL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I do a lot of programming, so I live in my editor. I use Vim. If you also use Vim then I&#039;ve got something to share with you: a new syntax plugin that highlights function calls banned by Microsoft&#039;s Security Development Lifecycle (SDL). You can obtain the banned.vim syntax plugin from the Vim script archive. [...]]]></description>
			<content:encoded><![CDATA[<p>I do a lot of programming, so I live in my editor. I use <a target="new" href="http://www.vim.org/">Vim</a>. If you also use Vim then I&#039;ve got something to share with you: a new syntax plugin that highlights function calls banned by Microsoft&#039;s <a target="new" href="http://msdn.microsoft.com/en-us/security/cc448177.aspx">Security Development Lifecycle</a> (SDL). You can obtain the <strong>banned.vim</strong> syntax plugin from the <a target="new" href="http://www.vim.org/scripts/script.php?script_id=2753">Vim script archive</a>.</p>
<p>The <strong>banned.vim</strong> syntax plugin will highlight C function calls that have been banned by the SDL. It adds functionality to the existing C and C++ Vim syntax plugins. Banned APIs, such as <code>strcpy</code> and others, will appear visually in Vim as if they were errors. It is my hope that this extra attention will cause you to reconsider using the banned API and replace it instead with a safer alternative. Although many of these banned function calls are Windows-specific, there are quite a few that are also available in UNIX and should be avoided. Details on the APIs banned by Microsoft&#039;s SDL can be found on <a target="new" href="http://msdn.microsoft.com/en-us/library/bb288454.aspx">Microsoft&#039;s site</a>.</p>
<p>Here&#039;s a screen shot of <strong>banned.vim</strong> in action. In this case we&#039;re editing <code>str_cat.c</code>, one of the entries from the <a target="new" href="http://www.sans-ssi.org/resources/Winners_of_insecure_coding_contest_20080721.pdf">2008 SANS Awards for Finding Coding Books with Secure programming Flaws</a>. Notice the banned APIs in the code below?</p>
<p><img alt="banned.vim in action" height="362" width="541" style="display: block; margin-left: auto; margin-right: auto" src="http://www.casabasecurity.com/images/banned.png" /></p>
<p>Installing <strong>banned.vim</strong> is easy. First, you need to know what your <em>runtimepath</em> is, which varies from operating system to operating system. If you don&#039;t know what your <em>runtimepath</em> is, check the <a target="new" href="http://vimdoc.sourceforge.net/htmldoc/options.html#%27runtimepath%27">Vim documentation</a>. Second, create the directory structure <code>after/syntax</code> in your <em>runtimepath</em> directory if it doesn&#039;t already exist. Third, copy <strong>banned.vim</strong> into <code><em>runtimepath</em>/after/syntax</code> as both <code>c.vim</code> and <code>cpp.vim</code>. That&#039;s all there is to installation. There is no need to edit your <code>.vimrc</code> or anything.</p>
<p>I would like to thank Rob Mooney for suggesting this plugin in the first place.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/08/a-vim-plugin-for-highlighting-apis-banned-by-the-microsoft-sdl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unraveling Unicode: A Bag of Tricks for Bug Hunting at Black Hat USA</title>
		<link>http://www.casaba.com/blog/2009/07/unraveling-unicode-a-bag-of-tricks-for-bug-hunting-at-black-hat-usa/</link>
		<comments>http://www.casaba.com/blog/2009/07/unraveling-unicode-a-bag-of-tricks-for-bug-hunting-at-black-hat-usa/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 18:02:32 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=314</guid>
		<description><![CDATA[Chris Weber speaks on &#8220;Unraveling Unicode: A Bag of Tricks for Bug Hunting&#8221; at Black Hat USA Paper: Unraveling Unicode (PDF) Slides: Unraveling Unicode Slides (PDF)]]></description>
			<content:encoded><![CDATA[<p>Chris Weber speaks on &#8220;Unraveling Unicode: A Bag of Tricks for Bug Hunting&#8221; at <a href="http://www.blackhat.com/html/bh-usa-09/bh-usa-09-speakers.html#Weber" title="Unraveling Unicode: A Bag of Tricks for Bug Hunting at Black Hat USA">Black Hat USA</a><br />
Paper: <a href="http://www.blackhat.com/presentations/bh-usa-09/WEBER/BHUSA09-Weber-UnicodeSecurityPreview-PAPER.pdf" title="Unraveling Unicode PDF">Unraveling Unicode (PDF)</a> <br />
Slides: <a href="http://www.blackhat.com/presentations/bh-usa-09/WEBER/BHUSA09-Weber-UnicodeSecurityPreview-SLIDES.pdf" title="Unraveling Unicode Slides (PDF)">Unraveling Unicode Slides (PDF)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/07/unraveling-unicode-a-bag-of-tricks-for-bug-hunting-at-black-hat-usa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unibomber tool for specialized XSS testing</title>
		<link>http://www.casaba.com/blog/2009/07/unibomber-tool-for-specialized-xss-testing/</link>
		<comments>http://www.casaba.com/blog/2009/07/unibomber-tool-for-specialized-xss-testing/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 01:04:31 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[John Hernandez has been working hard at Casaba to build a specialized testing tool that automates some of the unique techniques we use to find cross-sites scripting bugs (XSS). At Black Hat I&#039;m planning to demo what we have so far. It automates the testing process greatly, by auto-injecting a canary and ID into each [...]]]></description>
			<content:encoded><![CDATA[<p>John Hernandez has been working hard at Casaba to build a specialized testing tool that automates some of the unique techniques we use to find cross-sites scripting bugs (XSS).  At Black Hat I&#039;m planning to demo what we have so far.  It automates the testing process greatly, by auto-injecting a canary and ID into each input be it query string, HTTP header, or POST parameter.  By combining injection with &#039;output encoding&#039; detection, you get automation that assists pen-testers in finding vulnerability hotspots.</p>
<p>Because it basically bombs a Web-app with a slew of Unicode characters to find XSS bugs we named it the <strong>Unibomber</strong>.</p>
<p>Appended to the canary is a special character &#8211; special because it can transform into a &#039;dangerous&#039; character through normalization, casing, or best-fit mapping operations.  So we end up injecting these special characters all over the place and then detecting where they get transformed and displayed as output.</p>
<p>The beauty is that we can find both reflected and persistent XSS bugs this way.  It&#039;s not a one-click tool though, this is intended for use by an experienced person who knows how to find and exploit a clever XSS bug.  </p>
<p>Anyone who looks for XSS will likely find some good bugs with the Unibomber.  We sure have!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/07/unibomber-tool-for-specialized-xss-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watcher adds support for OWASP Application Security Verification Standard</title>
		<link>http://www.casaba.com/blog/2009/05/watcher-adds-support-for-owasp-application-security-verification-standard/</link>
		<comments>http://www.casaba.com/blog/2009/05/watcher-adds-support-for-owasp-application-security-verification-standard/#comments</comments>
		<pubDate>Tue, 12 May 2009 18:00:46 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=312</guid>
		<description><![CDATA[The Watcher web-app security tool, open source at CodePlex, now includes support for OWASP&#8217;s new Application Security Verification Standard.]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://websecuritytool.codeplex.com/" title="Watcher at CodePlex">Watcher web-app security tool, open source at CodePlex</a>, now includes support for OWASP&#8217;s new <a href="http://www.owasp.org/index.php/Category:OWASP_Application_Security_Verification_Standard_Project" title="OWASP Application Security Verification Standard">Application Security Verification Standard</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/05/watcher-adds-support-for-owasp-application-security-verification-standard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft SDL blog post about Watcher</title>
		<link>http://www.casaba.com/blog/2009/04/microsoft-sdl-blog-post-about-watcher/</link>
		<comments>http://www.casaba.com/blog/2009/04/microsoft-sdl-blog-post-about-watcher/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 20:22:37 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[SDL]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Watcher]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Microsoft mentioned Watcher&#039;s usefulness in Web-security testing and SDL requirements verification. We&#039;re working to make this tool better so please share your success stories, bugs or false positives with us.]]></description>
			<content:encoded><![CDATA[<p>Microsoft mentioned Watcher&#039;s usefulness in <a href="http://blogs.msdn.com/sdl/archive/2009/04/16/watcher-a-new-web-security-testing-tool.aspx#comments">Web-security testing and SDL requirements verification<a />.   We&#039;re working to make this tool better so please share your success stories, bugs or false positives with us.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/04/microsoft-sdl-blog-post-about-watcher/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watcher v1.1.0 released</title>
		<link>http://www.casaba.com/blog/2009/04/watcher-v1-1-0-released/</link>
		<comments>http://www.casaba.com/blog/2009/04/watcher-v1-1-0-released/#comments</comments>
		<pubDate>Sun, 12 Apr 2009 16:44:02 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Watcher]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[We&#039;ve made some significant improvements to the Watcher web security and compliance auditing tool in version 1.1.0. Some new checks have been added, bug fixes, and performance improvements. I wanted to point out that Watcher helps not only in testing and auditing Web applications, but it has checks to assess the security strength of the [...]]]></description>
			<content:encoded><![CDATA[<p>We&#039;ve made some significant improvements to the <a href="http://websecuritytool.codeplex.com/">Watcher web security and compliance auditing tool</a> in version 1.1.0.  Some new checks have been added, bug fixes, and performance improvements.  </p>
<p>I wanted to point out that Watcher helps not only in testing and auditing Web applications, but it has  checks to assess the security strength of the operational configurations as well, such as the SSL version being used.  We&#039;ve also added a check for SharePoint related assessment, and are working to add more Sharepoing security tests in the next version.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/04/watcher-v1-1-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Casaba helps red team operations at the 2nd Collegiate Cyber Defense Competition</title>
		<link>http://www.casaba.com/blog/2009/03/casaba-helps-red-team-operations-at-the-2nd-collegiate-cyber-defense-competition/</link>
		<comments>http://www.casaba.com/blog/2009/03/casaba-helps-red-team-operations-at-the-2nd-collegiate-cyber-defense-competition/#comments</comments>
		<pubDate>Sat, 28 Mar 2009 17:59:09 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=309</guid>
		<description><![CDATA[At the 2nd Collegiate Cyber Defense Competition student teams are presented with a pre-configured systems of a fictitious company that they are tasked to operate. The evil red team with the help of Casaba will attempt to vandalize and break into this network. The student teams need to defend against the attacks of this red [...]]]></description>
			<content:encoded><![CDATA[<p>At the <a href="http://ciac.ischool.washington.edu/ccdc.shtml" title="2nd Collegiate Cyber Defense Competition">2nd Collegiate Cyber Defense Competition</a> student teams are presented with a pre-configured systems of a fictitious company that they are tasked to operate. The evil red team with the help of Casaba will attempt to vandalize and break into this network. The student teams need to defend against the attacks of this red team.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/03/casaba-helps-red-team-operations-at-the-2nd-collegiate-cyber-defense-competition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eric Lawrence introduces Watcher tool at MIX09 Conference</title>
		<link>http://www.casaba.com/blog/2009/03/eric-lawrence-introduces-watcher-tool-at-mix09-conference/</link>
		<comments>http://www.casaba.com/blog/2009/03/eric-lawrence-introduces-watcher-tool-at-mix09-conference/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 05:23:42 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Watcher]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I&#039;m happy to say IE8 Security Program Manager and Fiddler author Eric Lawrence announced our Watcher tool at MIX09 today. Check out his talk at http://videos.visitmix.com/MIX09/T54F it&#039;s an eye opener for Web developers &#8211; introducing us to the new features of IE8 while also covering state-of-the-art secure development practices for today&#039;s Web applications. Unfortunately CodePlex [...]]]></description>
			<content:encoded><![CDATA[<p>I&#039;m happy to say IE8 Security Program Manager and Fiddler author Eric Lawrence announced our Watcher tool at MIX09 today.  Check out his talk at <a href="http://videos.visitmix.com/MIX09/T54F">http://videos.visitmix.com/MIX09/T54F</a> it&#039;s an eye opener for Web developers &#8211; introducing us to the new features of IE8 while also covering state-of-the-art secure development practices for today&#039;s Web applications.   </p>
<p>Unfortunately CodePlex went down today, even with Microsoft&#039;s new release of !exploitable at CanSecWest.  Anyhow we&#039;re working hard to to add new checks to Watcher and reduce false positives in existing ones.  So please grab <a href="http://websecuritytool.codeplex.com/">Watcher from Codeplex</a> and send us any feedback you want.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/03/eric-lawrence-introduces-watcher-tool-at-mix09-conference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploiting Unicode-enabled Software at CanSecWest</title>
		<link>http://www.casaba.com/blog/2009/03/exploiting-unicode-enabled-software-at-cansecwest/</link>
		<comments>http://www.casaba.com/blog/2009/03/exploiting-unicode-enabled-software-at-cansecwest/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 17:56:12 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=305</guid>
		<description><![CDATA[Chris Weber speaks on &#8220;Exploiting Unicode-enabled Software&#8221; at CanSecWest. Slides: Exploiting Unicode-enabled Software at CanSecWest (PDF)]]></description>
			<content:encoded><![CDATA[<p>Chris Weber speaks on &#8220;Exploiting Unicode-enabled Software&#8221; at <a href="http://www.cansecwest.com/" title="CanSecWest">CanSecWest</a>.</p>
<p>Slides: <a href="http://cansecwest.com/csw09/csw09-weber.pdf" title="Exploiting Unicode-enabled Software at CanSecWest">Exploiting Unicode-enabled Software at CanSecWest (PDF)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/03/exploiting-unicode-enabled-software-at-cansecwest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watcher: Web security testing tool and passive vulnerability scanner</title>
		<link>http://www.casaba.com/blog/2009/03/watcher-web-security-testing-tool-and-passive-vulnerability-scanner/</link>
		<comments>http://www.casaba.com/blog/2009/03/watcher-web-security-testing-tool-and-passive-vulnerability-scanner/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 17:57:18 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=307</guid>
		<description><![CDATA[Casaba releases Watcher for web-application security testing and compliance auditing. Watcher is open source on CodePlex.]]></description>
			<content:encoded><![CDATA[<p>Casaba releases <a href="http://www.casaba.com/products/watcher/" title="Watcher at Casaba">Watcher</a> for web-application security testing and compliance auditing. <a href="http://websecuritytool.codeplex.com/" title="Watcher on CodePlex">Watcher is open source on CodePlex</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/03/watcher-web-security-testing-tool-and-passive-vulnerability-scanner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Watcher security tool for web applications</title>
		<link>http://www.casaba.com/blog/2009/03/watcher-security-tool-for-web-applications/</link>
		<comments>http://www.casaba.com/blog/2009/03/watcher-security-tool-for-web-applications/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 04:06:15 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[Watcher]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Watcher is being released under an Open Source license. With over 30 checks in its first release, it helps you find issues in your web-apps fast and effortlessly. Watcher is a Fiddler plugin that passively audits a web application for a variety of security issues. It acts as an assistant to the developer, tester, or [...]]]></description>
			<content:encoded><![CDATA[<p>Watcher is being released under an Open Source license.  With over 30 checks in its first release, it helps you find issues in your web-apps fast and effortlessly.  Watcher is a Fiddler plugin that passively audits a web application for a variety of security issues. It acts as an assistant to the developer, tester, or pen-tester, by quickly identifying issues that commonly lead to security problems in web apps. Integrate it into your test passes to achieve more coverage of security testing goals.</p>
<p>Go get <a href="http://www.casabasecurity.com/content/tools">Watcher</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/03/watcher-security-tool-for-web-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploiting Unicode-enabled Software at SOURCE Boston</title>
		<link>http://www.casaba.com/blog/2009/03/exploiting-unicode-enabled-software-at-source-boston/</link>
		<comments>http://www.casaba.com/blog/2009/03/exploiting-unicode-enabled-software-at-source-boston/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 17:55:17 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=303</guid>
		<description><![CDATA[Chris Weber speaks on &#8220;Exploiting Unicode-enabled Software&#8221; at SOURCE Boston Conference.]]></description>
			<content:encoded><![CDATA[<p>Chris Weber speaks on &#8220;Exploiting Unicode-enabled Software&#8221; at <a href="http://www.sourceconference.com/" title="SOURCE Boston Conference">SOURCE Boston Conference</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/03/exploiting-unicode-enabled-software-at-source-boston/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Help talking to the non-security professionals</title>
		<link>http://www.casaba.com/blog/2009/01/help-talking-to-the-non-security-professionals/</link>
		<comments>http://www.casaba.com/blog/2009/01/help-talking-to-the-non-security-professionals/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 11:35:19 +0000</pubDate>
		<dc:creator>Samuel Bucholtz</dc:creator>
				<category><![CDATA[SDL]]></category>
		<category><![CDATA[Consulting]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Recently, I have been spending a lot of my time working with clients on SDL (Security Development Lifecycle). This is a new trend in the security industry and a welcome development in my opinion. In doing this SDL work, I spend a lot of my time working with developers, testers, and PMs who are not [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I have been spending a lot of my time working with clients on SDL (Security Development Lifecycle). This is a new trend in the security industry and a welcome development in my opinion. In doing this SDL work, I spend a lot of my time working with developers, testers, and PMs who are not security professionals. Discussing concepts like threat modeling, fuzz testing, response planning, and even security training they can easily get overwhelmed with all the complexity the SDL and computer security in general can entail. </p>
<p>I have found a few techniques that I would like to share to help smooth communication and help the professionals and non- profesionals to get their respective jobs done. </p>
<ol>
<li><strong>Talk slow.</strong> This one should be self evident. Discussing subject matter that is new or confusing to someone is only made more difficult if you talk fast. Listeners have no time to process the new ideas and are instead just trying to keep up. </li>
<li><strong>Be a dictionary.</strong> Computer Security contains a vast array of concepts and domain specific jargon. In security it is often difficult to adjust terminology to an audience, so instead, try to gauge the audience and go back and explain or define the words, acronyms, or concepts that they may not be familiar with. The critical point here is to do it immediately after use rather than waiting until the end of the conversation. By that point, it is usually too late and the definition may not be properly associated with the item. </li>
<li><strong>Ask questions.</strong> It is very important that you are constantly gauging your audiences comprehension. This does not mean using the Socratic method to lead them in their own exploration of ideas, but rather inquiry for the purposes of confirming that you have successfully conveyed meaning to them. Remember, that in almost all cases, incomprehension on their part is a failure on yours. Questions help to highlight to listeners what elements of the discussion you, yourself, consider important. Also, try asking questions from different angles. Asking oblique or tangentially related things can often spur a better understanding in the audience, just make sure it is not something that would appear out of left field to them. </li>
<li><strong>Do not accept nods.</strong> Similar to #3, you need to be able to tell when people really understand and can follow what you are saying. I have found many times when a person would nod as I explained a specific security concept to them or spit back the exact language I used, but when I try to get them to describe the implications or rephrase in their own words, it is evident that they are still confused. </li>
<li><strong>Reiterate. </strong>Repetition can be critical to ensuring that concepts &quot;sink in&quot;. Note, though, that I used the word reiterate. The reason for this is that you should change the way you say it and words you use when repeating the concept or idea. This can be one of the trickiest techniques, because it is easy to over do it and cause more harm than help. I find it works best when sprinkled into a long conversation, especially if the conversation keeps getting sidetracked by definitions, clarifications, or completely external items. </li>
<li><strong>Make lists.</strong> This is probably the favorite for most PMs out there. PMs love lists. There is nothing they want more than to break all this complicated, confusing security stuff into small, easily managable chunks. Lists also help people to take notes by calling out concepts that can be grouped or ordered together. A list of bullet points (even in a conversation) are usually more important than the text before or after. I am not and have never really been a PM, but I think this is part of he genius that makes a good PM. PMs usually have too many things to do and items to keep track of, the only way they can handle it all is to be insanely organized and maintain lists. Helping them or any other detail oriented note taker to do this makes your job easier as much as it does theirs. </li>
<li><strong>Clarify language.</strong> This is similar to #2, but is targeted at the way you discuss things rather that words you may use. Make sure relationsips between things are explicitly called out (ex. First a, second b rather than this&#8230;then that). Use active rather than passive forms of verbs and try to minimize wishy washy or otherwise indecisive language. Avoid implications, exaggerations, and make clear when somethin is a WAG (wild assed guess). This can be very challenging for people to do during a spoken conversation so I usually recommend you start by practicing over e-mail. Being careful and spending time picking out the right words and phrasing can double or triple the amount of time it takes to write an e-mail, however in the long run, the amount of time saved due to fewer misunderstandings and resulting errors will make it worth it. </li>
<li><strong>Anticipate.</strong> Finally, try to think ahead. As a security professional, you know the processes and outcomes far better that the people you are working with do. Try to divine what might confuse, hinder, or block the people you are working with and try to provide them answers or solutions before the need them. Remember that in most cases you are not a teacher and they are not working with you to learn by trial and error. Sending them off with a hint and letting them waste time trying to discover things on their own is not how tehy should be handled. Instead, inform them, point them at learning resources, or provide a solution and spend time explaining the reasoning behind it. Do you have any that I have missed?</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2009/01/help-talking-to-the-non-security-professionals/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>32nd Internationalization and Unicode Conference presentation on Exploiting Unicode-enabled Software</title>
		<link>http://www.casaba.com/blog/2008/09/32nd-internationalization-and-unicode-conference-presentation-on-exploiting-unicode-enabled-software/</link>
		<comments>http://www.casaba.com/blog/2008/09/32nd-internationalization-and-unicode-conference-presentation-on-exploiting-unicode-enabled-software/#comments</comments>
		<pubDate>Thu, 11 Sep 2008 18:37:18 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Unicode]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I&#39;m glad to have had the chance to present at the Unicode conference yesterday, and meet all the wonderful people there. You can download the presentation slides here for Exploiting Unicode-enabled software. &#160;]]></description>
			<content:encoded><![CDATA[<p>
I&#39;m glad to have had the chance to present at the Unicode conference yesterday, and meet all the wonderful people there.<br />
You can download the presentation slides here for <a href="http://www.casabasecurity.com/files/Exploiting%20Unicode-enabled%20Software.pdf">Exploiting Unicode-enabled software</a>.</p>
<p><img src="/images/exploit-unicode.jpg" alt="" title="exploiting-unicode" width="500" height="375" />
</p>
<p>
&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/09/32nd-internationalization-and-unicode-conference-presentation-on-exploiting-unicode-enabled-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exploiting Unicode-enabled Software at UIC32</title>
		<link>http://www.casaba.com/blog/2008/09/exploiting-unicode-enabled-software-at-uic32/</link>
		<comments>http://www.casaba.com/blog/2008/09/exploiting-unicode-enabled-software-at-uic32/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 17:54:23 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=301</guid>
		<description><![CDATA[Chris Weber speaks on &#8220;Exploiting Unicode-enabled Software&#8221; at the 32nd Internationalization &#038; Unicode Conference.]]></description>
			<content:encoded><![CDATA[<p>Chris Weber speaks on &#8220;<a href="http://www.unicodeconference.org/iuc32/program-d.htm#ses12_1" title="Exploiting Unicode-enabled Software at UIC32">Exploiting Unicode-enabled Software</a>&#8221; at the 32nd Internationalization &#038; Unicode Conference.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/09/exploiting-unicode-enabled-software-at-uic32/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generating test cases for Unicode-enabled software</title>
		<link>http://www.casaba.com/blog/2008/09/generating-test-cases-for-unicode-enabled-software/</link>
		<comments>http://www.casaba.com/blog/2008/09/generating-test-cases-for-unicode-enabled-software/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 07:00:00 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[test cases]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[When it comes to Unicode implementations, there’s a rich set of test cases to perform. Realizing it is the start. Automating it is the next step. At a high-level Unicode-related security bugs can be categorized into the following root-causes: Canonicalization Interpreting non-shortest form (e.g .UTF-8 encoding trickery) Other decoding issues Absorption (over-consumption) Over-consuming invalid byte [...]]]></description>
			<content:encoded><![CDATA[<p>When it comes to Unicode implementations, there’s a rich set of test<br />
cases to perform. Realizing it is the start. Automating it is the next<br />
step.</p>
<p>At a high-level Unicode-related security bugs can be categorized into the following root-causes:</p>
<p>Canonicalization</p>
<ul>
<li>Interpreting non-shortest form (e.g .UTF-8 encoding trickery)</li>
<li>Other decoding issues</li>
</ul>
<p>Absorption (over-consumption)</p>
<ul>
<li>Over-consuming invalid byte sequences or correcting rather than failing</li>
<li>When &lt;41 C2 C3 B1 42&gt;  becomes &lt;41 42&gt;</li>
</ul>
<p>Character deletion and swallowing</p>
<ul>
<li>“deletion of noncharacters” (UTR-36)</li>
<li>&lt;scr[U+FEFF]ipt&gt; becomes &lt;script&gt;</li>
<li>Use replacement characters instead!</li>
</ul>
<p>Interpreting Syntax replacements</p>
<ul>
<li>white space and line feeds</li>
<li>E.g. when U+180E acts like U+0020</li>
</ul>
<p>Best-fit mappings</p>
<ul>
<li>When σ becomes s</li>
<li>When ′ becomes ‘</li>
</ul>
<p>Buffer overruns</p>
<ul>
<li>Incorrect assumptions about string sizes (chars vs. bytes)</li>
<li>Improper width calculations</li>
</ul>
<p>Timing issues</p>
<ul>
<li>handling Unicode after security gates</li>
<li>Sometimes handling Unicode before a gate can be a problem too!  E.g. BOM handling</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/09/generating-test-cases-for-unicode-enabled-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unicode formatter characters lead to cross-site scripting in popular browsers</title>
		<link>http://www.casaba.com/blog/2008/09/unicode-formatter-characters-lead-to-cross-site-scripting-in-popular-browsers/</link>
		<comments>http://www.casaba.com/blog/2008/09/unicode-formatter-characters-lead-to-cross-site-scripting-in-popular-browsers/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 21:25:41 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[test cases]]></category>
		<category><![CDATA[vulnerability]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I&#039;ll be discussing some of the issues recently reported to Opera, Apple, and Mozilla at the 32nd Unicode Conference in San Jose next week. We discovered some issues with the way certain Unicode characters could be leveraged to enable cross-site scripting attacks in popular web browsers (aka User-Agents). These issues involve utilizing Unicode characters in [...]]]></description>
			<content:encoded><![CDATA[<p>I&#039;ll be discussing some of the issues recently reported to Opera, Apple, and Mozilla at the 32nd Unicode Conference in San Jose next week.  We discovered some issues with the way certain Unicode characters could be leveraged to enable cross-site scripting attacks in popular web browsers (aka User-Agents).  These issues involve utilizing Unicode characters in ways which might bypass most filters, IPS, and IDS systems.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/09/unicode-formatter-characters-lead-to-cross-site-scripting-in-popular-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco Type 7 is as bad as you can possibly get.</title>
		<link>http://www.casaba.com/blog/2008/08/cisco-type-7-is-as-bad-as-you-can-possibly-get/</link>
		<comments>http://www.casaba.com/blog/2008/08/cisco-type-7-is-as-bad-as-you-can-possibly-get/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 22:46:20 +0000</pubDate>
		<dc:creator>Samuel Bucholtz</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Cisco]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I always love learning cool new little features in the software I use. In this case, my coworker Ramsey came across a great Blog (http://blog.ioshints.info) on Cisco IOS and we picked up a new trick for decrypting Type 7 passwords. Cisco IOS has always supported a few encryption mechanisms for local passwords on the device. [...]]]></description>
			<content:encoded><![CDATA[<p>I always love learning cool new little features in the software I use. In this case, my coworker Ramsey came across a great Blog (<a href="http://blog.ioshints.info/">http://blog.ioshints.info</a>) on Cisco IOS and we picked up a new trick for decrypting Type 7 passwords. </p>
<p>Cisco IOS has always supported a few encryption mechanisms for local passwords on the device. The first is Type 7 which uses a reversible encryption, about as difficult as ROT13 to break. The second is Type 5, which uses an MD5 hash to make the password irreversible (it is vulnerable to dictionary attacks). I see Type 7 passwords used in cases where they are not required, more often than I would reasonably expect. To quickly and easily decrypt the password and demonstrate why it is such a bad idea I have found this cool little trick: </p>
<p>R1(config)#key chain decrypt</p>
<p>R1(config-keychain)#key 1</p>
<p>R1(config-keychain-key)#key-string 7 &lt;encrypted string&gt;</p>
<p>R1(config-keychain-key)#<strong>do show key chain decrypt</strong></p>
<p>&#160;</p>
<p>Another item people are often not aware of is Type 6 encryption. Type 6 encryption is reversible encryption like Type 7 but uses AES and supports a supplied salt. This allows for significantly better security on newer IOS versions that support it.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/08/cisco-type-7-is-as-bad-as-you-can-possibly-get/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let me see that certificate a little more closely. Part 1 &#8211; Validating the Server&#8217;s Certificate</title>
		<link>http://www.casaba.com/blog/2008/06/let-me-see-that-certificate-a-little-more-closely-part-1-validating-the-servers-certificate/</link>
		<comments>http://www.casaba.com/blog/2008/06/let-me-see-that-certificate-a-little-more-closely-part-1-validating-the-servers-certificate/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 01:42:04 +0000</pubDate>
		<dc:creator>Brian Lewis</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Certificate]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[If you are developing a client to a server service that communicates over SSL such as a Web Service then it is your job to ensure your server is the &#34;real deal&#34; and not some rouge server or man-in-the-middle. How do you do that? Validate the server&#39;s certificate. Make sure the certificate is for the [...]]]></description>
			<content:encoded><![CDATA[<p>If you are developing a client to a server service that communicates over SSL such as a Web Service then it is your job to ensure your server is the &quot;real deal&quot; and not some rouge server or man-in-the-middle.  How do you do that?  Validate the server&#39;s certificate.   Make sure the certificate is for the domain you are accessing, make sure the certificate chain is valid, and make sure the certificate is signed by a trusted certificate authority (CA).  Sound like a pain?  Well it isn&#39;t.  You get a lot for a little with the right API calls. </p>
<p>WinHttpReceiveResponse in C++ will return FALSE if the certificate has one of the following errors:</p>
<p><strong>WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED</strong></p>
<p>Certification<br />
revocation checking has been enabled, but the revocation check failed to verify<br />
whether a certificate has been revoked. The server used to check for revocation<br />
might be unreachable. </p>
<p><strong>WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT </strong></p>
<p>SSL certificate is invalid.</p>
<p><strong>WINHTTP_CALLBACK_STATUS_FLAG_CERT_REVOKED</strong></p>
<p>SSL certificate was revoked.</p>
<p><strong>WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CA</strong></p>
<p>The function is unfamiliar with the Certificate Authority that generated the server&#39;s certificate.</p>
<p><strong>WINHTTP_CALLBACK_STATUS_FLAG_CERT_CN_INVALID</strong></p>
<p>SSL certificate common name (host name field) is incorrect, for example, if you entered <a href="http://www.microsoft.com" title="www.microsoft.com">www.microsoft.com</a> and the common name on the certificate says <a href="http://www.msn.com" title="www.msn.com">www.msn.com</a>.</p>
<p><strong>WINHTTP_CALLBACK_STATUS_FLAG_CERT_DATE_INVALID</strong></p>
<p>SSL certificate date that was received from the server is bad. The certificate is expired.</p>
<p><strong>WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR</strong></p>
<p>The application experienced an internal error loading the SSL libraries.</p>
<p>However, <strong>WinHttpReceiveResponse</strong> does not return these errors directly as a call to GetLastError() will only return <strong>ERROR_WINHTTP_SECURE_FAILURE</strong> if there is a problem with the server&#39;s certificate.  You must use the CallBack <strong>WINHTTP_STATUS_CALLBACK</strong> to access the specific errors listed above.</p>
<p><code><br />
 public WINHTTP_STATUS_CALLBACK myOwnAsyncCallback( __in HINTERNET hInternet,<br />
	__in DWORD_PTR dwContext,<br />
	__in DWORD dwInternetStatus,<br />
	__in LPVOID lpvStatusInformation,<br />
	__in DWORD dwStatusInformationLength)<br />
	{<br />
		if (dwInternetStatus == WINHTTP_CALLBACK_STATUS_SECURE_FAILURE)<br />
		// We have a certificate issue but which one? Take action before each break. This function must be thread safe and reentrant.<br />
		switch(*(DWORD*)lpvStatusInformation)<br />
		{<br />
			case WINHTTP_CALLBACK_STATUS_FLAG_CERT_REV_FAILED:<br />
			break;<br />
			case WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CERT:<br />
			break;<br />
			case WINHTTP_CALLBACK_STATUS_FLAG_CERT_REVOKED:<br />
			break;<br />
			case WINHTTP_CALLBACK_STATUS_FLAG_INVALID_CA:<br />
			break;<br />
			case WINHTTP_CALLBACK_STATUS_FLAG_CERT_CN_INVALID:<br />
			break;<br />
			case WINHTTP_CALLBACK_STATUS_FLAG_CERT_DATE_INVALID:<br />
			break;<br />
			case WINHTTP_CALLBACK_STATUS_FLAG_SECURITY_CHANNEL_ERROR:<br />
			break;<br />
		}<br />
	}<br />
	HINTERNET hSession = WinHttpOpen(L"A WinHTTP Example Program/1.0",<br />
	WINHTTP_ACCESS_TYPE_DEFAULT_PROXY,<br />
	WINHTTP_NO_PROXY_NAME,<br />
	WINHTTP_NO_PROXY_BYPASS, 0);<br />
	WINHTTP_STATUS_CALLBACK isCallback = WinHttpSetStatusCallback( hSession, WINHTTP_STATUS_CALLBACK)myOwnAsyncCallback,WINHTTP_CALLBACK_FLAG_SECURE_FAILURE,<br />
	NULL);<br />
	//The rest of your code including call WinHttpReceiveResponse<br />
</code></p>
<p>For more information see<br />
<a href="http://msdn.microsoft.com/en-us/library/cc185684(VS.85).aspx">http://msdn.microsoft.com/en-us/library/cc185684(VS.85).aspx</a><br />
<a href="http://msdn.microsoft.com/en-us/library/aa383917(VS.85).aspx">http://msdn.microsoft.com/en-us/library/aa383917(VS.85).aspx</a><br />
<a href="http://msdn.microsoft.com/en-us/library/aa384266(VS.85).aspx">http://msdn.microsoft.com/en-us/library/aa384266(VS.85).aspx</a><br />
<a href="http://msdn.microsoft.com/en-us/library/aa384115(VS.85).aspx">http://msdn.microsoft.com/en-us/library/aa384115(VS.85).aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/06/let-me-see-that-certificate-a-little-more-closely-part-1-validating-the-servers-certificate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>useUnsafeHeaderParsing = what?</title>
		<link>http://www.casaba.com/blog/2008/06/useunsafeheaderparsing-what/</link>
		<comments>http://www.casaba.com/blog/2008/06/useunsafeheaderparsing-what/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 22:02:31 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[HTTP]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[As software security people we usually like input restrictions to be tight. With .Net&#39;s HttpWebRequestElement.UseUnsafeHeaderParsing Property you can loosen up the way HTTP requests get parsed. Setting this property ignores validation errors that occur during HTTP parsing. The documentation from MSDN makes it pretty clear. When this property is set to &#039;true&#039; then many HTTP [...]]]></description>
			<content:encoded><![CDATA[<p>
As software security people we usually like input restrictions to be tight.  With .Net&#39;s <a href="http://msdn.microsoft.com/en-us/library/system.net.configuration.httpwebrequestelement.useunsafeheaderparsing(VS.80).aspx" target="_blank">HttpWebRequestElement.UseUnsafeHeaderParsing</a> Property you can loosen up the way HTTP requests get parsed.
</p>
<p>
Setting this property ignores validation errors that occur during HTTP parsing.  The documentation from MSDN makes it pretty clear.  When this property is set to &#039;true&#039; then many HTTP RFC violations will be relaxed and ignored.
</p>
<blockquote style="font-family: Courier New;"><p>
When this property is set to false, the following validations are performed during HTTP parsing:</p>
<p>    *  In end-of-line code, use CRLF; using CR or LF alone is not allowed.<br />
    *  Headers names should not have spaces in them.<br />
    *  If multiple status lines exist, all additional status lines are treated as malformed header name/value pairs.<br />
    *  The status line must have a status description, in addition to a status code.<br />
    *  Header names cannot have non-ASCII chars in them. This validation is performed whether this property is set to true or false.</p>
<p>When a protocol violation occurs, a WebException exception is thrown with the status set to ServerProtocolViolation. If the UseUnsafeHeaderParsing property is set to true, validation errors are ignored.</p>
<p>Setting this property to true has security implications, so it should only be done if backward compatibility with a server is required.
</p>
</blockquote>
<p>Let&#039;s keep an eye out for this option when it&#039;s set either programmatically or through web.config.</p>
<p><code><br />
&lt;configuration&gt;<br />
    &lt;system.net&gt;<br />
        &lt;settings&gt;<br />
            &lt;httpWebRequest useUnsafeHeaderParsing=”true” /&gt;<br />
        &lt;/settings&gt;<br />
    &lt;/system.net&gt;<br />
&lt;/configuration&gt;<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/06/useunsafeheaderparsing-what/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell Grep</title>
		<link>http://www.casaba.com/blog/2008/06/powershell-grep/</link>
		<comments>http://www.casaba.com/blog/2008/06/powershell-grep/#comments</comments>
		<pubDate>Tue, 03 Jun 2008 23:23:08 +0000</pubDate>
		<dc:creator>John Hernandez</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Powershell]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[So, I spent a good couple of hours today trying to find a easy solution to the lack of Grep on windows. I&#039;ve tried using findstr but the output gave me a headache trying to parse it. So I decidied to use powershell, what a great tool by MS, once you get past the learning [...]]]></description>
			<content:encoded><![CDATA[<p>So, I spent a good couple of hours today trying to find a easy solution to the lack of Grep on windows. I&#039;ve tried using findstr but the output gave me a headache trying to parse it. So I decidied to use powershell, what a great tool by MS, once you get past the learning curve obviously. </p>
<p>Here is my code for grep the way i like it. I just created a PS1 file and added it to my &#8220;bin&#8221; dir&#8230; which is just a directory mapped to my path variable for command line programs. Anyways this looks through code files only based on the $filetypes&#8230; handy.. really it is&#8230; </p>
<p>$searchstr = $args[0]<br />
$searchdir = $args[1]</p>
<p>$filetypes =  &#8220;*.cpp&#8221;, &#8220;*.hpp&#8221;, &#8220;*.c&#8221;, &#8220;*.h&#8221;, &#8220;*.cxx&#8221;, &#8220;*.hxx&#8221;,  &#8220;*.cs&#8221;, &#8220;*.aspx&#8221;,&#8221;*.asmx&#8221;, &#8220;*.html&#8221;, &#8220;*.js&#8221;, &#8220;*.vbs&#8221;, &#8220;*.vb&#8221;, &#8220;*.xml&#8221;, &#8220;*.txt&#8221;</p>
<p>if($searchdir -eq &#8220;&#8221; )<br />
{<br />
$searchdir = &#8220;.\&#8221;<br />
}</p>
<p>get-childitem  $searchdir -include $filetypes -recurse | select-string -pattern $searchstr | Format-Table -property FileName, LineNumber, Line -Autosize</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/06/powershell-grep/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE Shortcuts for debugging 3rd party applications..</title>
		<link>http://www.casaba.com/blog/2008/05/ie-shortcuts-for-debugging-3rd-party-applications/</link>
		<comments>http://www.casaba.com/blog/2008/05/ie-shortcuts-for-debugging-3rd-party-applications/#comments</comments>
		<pubDate>Fri, 02 May 2008 21:33:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This is mostly a reminder for myself. But here are some useful shortcuts/tips for working in IE. CTRL-I : brings up the favorites menu, this is useful on those pop-ups that dont have upper menus to enable right clicking for viewing source&#8230; Bookmarklet for enabling right click: javascript:void(document.oncontextmenu=null) Bookmarklelt for enabling the Firebug Lite console: [...]]]></description>
			<content:encoded><![CDATA[<p>This is mostly a reminder for myself. But here are some useful shortcuts/tips for working in IE. </p>
<p>CTRL-I : brings up the favorites menu, this is useful on those pop-ups that dont have upper menus to enable right clicking for viewing source&#8230;</p>
<p>Bookmarklet for enabling right click: javascript:void(document.oncontextmenu=null)</p>
<p>Bookmarklelt for enabling the Firebug Lite console: <a href="http://remysharp.com/2007/03/13/firebug-in-ie-for-any-web-site/" title="http://remysharp.com/2007/03/13/firebug-in-ie-for-any-web-site/">http://remysharp.com/2007/03/13/firebug-in-ie-for-any-web-site/</a></p>
<p>Also another useful setting is setting in ie options that new windows open in tabs verse a pop up. This helps by<br />
allowing you to quickly/easily access bookmarklets/plug-ins like ie dev bar.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/05/ie-shortcuts-for-debugging-3rd-party-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>It all comes back to the basics</title>
		<link>http://www.casaba.com/blog/2008/04/it-all-comes-back-to-the-basics/</link>
		<comments>http://www.casaba.com/blog/2008/04/it-all-comes-back-to-the-basics/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 10:00:25 +0000</pubDate>
		<dc:creator>Samuel Bucholtz</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SDL]]></category>
		<category><![CDATA[Consulting]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Recently there has been a lot of talk in the security community about the Flash ActionScript exploit written by Mark Dowd (http://documents.iss.net/whitepapers/IBM_X-Force_WP_final.pdf). I will not go into a breakdown of the exploit as others have already done a great job of blogging about it. What I would like to discuss is two big takeaways that [...]]]></description>
			<content:encoded><![CDATA[<p>Recently there has been a lot of talk in the security community about the Flash ActionScript exploit written by Mark Dowd (<a href="http://documents.iss.net/whitepapers/IBM_X-Force_WP_final.pdf" title="http://documents.iss.net/whitepapers/IBM_X-Force_WP_final.pdf">http://documents.iss.net/whitepapers/IBM_X-Force_WP_final.pdf</a>). I will not go into a breakdown of the exploit as others have already done a great job of blogging about it. What I would like to discuss is two big takeaways that even programmers who are not &quot;uber-hackers&quot; can appreciate.</p>
<p>The first takeaway is the importance of understanding and implementing the fundamentals. The exploit above occurs because of a NULL dereference triggered by an out of memory return by malloc(). I remember in my first C programming class when I was working with a partner an a project and he was trying to properly implement malloc(). I had already been using C for a few years and always checked the return of a function. I could not figure out why he was not checking to make sure sufficient memory had been allocated. He gave me the excuse that it would require a lot of code to check the return value and that since the data structure was small the allocation would fail. Nonsense, as I demonstrated by filling up the 640K of standard memory. He then argued that we would be better off implementing XMS or EMS to access the other 3MB of &quot;high&quot; memory, a silly argument if ever there was one.</p>
<p> When non-security professionals describe what hackers do they often say that hackers look for ways to bypass  restrictions and go around roadblocks. This is a somewhat fair description, but what they may not know is that often hackers are merely taking advantage of mistakes or the faulty reasoning of programmers who tried to skip or work around something simple or basic that they felt would be too much work to implement properly. The original &quot;hacks&quot; were simply ways of getting things done quicker, easier, or more elegantly but sometimes there is a fundamental reason for doing things one way and the &quot;hack&quot; just gets you into hot water. Anyone who has ever picked up a C programming book and looked at the function info for malloc() knows that it is NOT guaranteed to return the memory requested. Obviously, it is a BAD idea to simply assume that it succeeded in allocating all the memory requested. Know your functions/methods and how to properly implement them.</p>
<p> The second takeaway for the average programmer is the need to integrate and leverage the latest in security functionality in your code from the ground up. What do I mean by this? Follow-up research on the exploit has shown that if DEP had been turned on and opted-in the exploit would not have worked. DEP marks portions of memory as NX (No Execute). Such areas in memory will trigger a processor fault if an attacker attempts to execute shellcode they have somehow loaded into such memory. Is DEP a panacea- No. But it provides a second layer of defense. Now you might say- DEP is a system setting that users or admins or Microsoft can turn on or off, there is nothing I can do as a programmer. This is not true. First of all, you need to write your application to make sure it works properly with DEP turned on. You need to test your application to verify this. You need to inform users so they know they can safely use DEP with your application. </p>
<p>A number of other features like ASLR (Address space layout randomization), /GS (canary based buffer overflow detection), etc. are provided now by Visual Studio and other compilers or by the latest versions of the Windows operating system.  Developers should be building their code to use these basic security tools that are in most cases so easily integrated. None of these features can prevent all security threats, but there are many applications out there using outdated compilers or failing to implementeven the simplest of automated defenses for lack of awareness or a fear of performance degradation. To the former- browse through just a few of the numerous security respurce out there and then review your compiler/linkers security related flags; to the latter- given the massive code bloat in this object oriented development world compared with the (good) old days of hand tuned assembly in a COM file what is a one or two percent more overhead <img src='http://www.casaba.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/04/it-all-comes-back-to-the-basics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How safe is the safecrt handling of formatting strings?</title>
		<link>http://www.casaba.com/blog/2008/04/how-safe-is-the-safecrt-handling-of-formatting-strings/</link>
		<comments>http://www.casaba.com/blog/2008/04/how-safe-is-the-safecrt-handling-of-formatting-strings/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 22:33:37 +0000</pubDate>
		<dc:creator>Jordan Tigani</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[One rule of thumb in c/c++ is that you should never let the user be in control of a formatting string. This has been recognized as a security bug for years, and one that has been mostly cleaned up since it is so easy to identify and fix. With visual studio 2005, Microsoft released a [...]]]></description>
			<content:encoded><![CDATA[<p>One rule of thumb in c/c++ is that you should never let the user be in control of a formatting string. This has been recognized as a security bug for years, and one that has been mostly cleaned up since it is so easy to identify and fix. With visual studio 2005, Microsoft released a safer version of the crt &#8212; functions that end with _s to tell you that they are  security enhanced. So let&#039;s say you are being a good security citizen by using the safe-crt &#8230;. can a format string vulnerability (where the user controls the format string) still be exploited?</p>
<p>The MSDN docs don&#039;t really have the answer. A cursory reading of the &#8220;security enhancements in the CRT&#8221; page as well as others may lead you to believe that format string vulnerabilities are a thing of the past. One example shows a call to &#039;sprintf_s(buf,_countof(buf), &#8220;%s&#8221;,NULL)&#039; and remarks that this results in a runtime error.  Looks like they do some kind runtime-validation. However, unless they added magic pixie dust to their compiler that sends cosmic rays from outer space to fix up malicious format strings at runtime, it isn&#039;t really possible to have strongly-typed printf-style format strings in C. </p>
<p>So let&#039;s investigate how far the parameter validation will get you. Here is a little sample program I wrote to send nasty format strings to sprintf_s:</p>
<p><code><br />
#include<br />
#define OUT_SIZE 0x1000<br />
int main(int argc, char** argv) {<br />
    char * out = new char[OUT_SIZE];<br />
    sprintf_s(out, OUT_SIZE, OUT_SIZE, argv[1]);<br />
    printf("%s\n", out);<br />
    return 0;<br />
}<br />
</code></p>
<p>So let&#039;s try this with a couple of format strings:<br />
<code><br />
Input: "%s"<br />
Output: Error: ("Buffer too small", 0)<br />
</code><br />
So far so good&#8230; but buffer too small?<br />
What about just dumping stack variables?<br />
<code><br />
Input:  "%p %p %p %p %p %p"<br />
Output: 00344FD0 00344FD0 0012FFB8 004019D3 00000002 00343728<br />
</code><br />
Interesting&#8230; so looks like this type checking is not so robust after all. We&#039;ve just dumped the stack.<br />
Let&#039;s see if we can crash the program. Looks like there is a 0000002 on the stack&#8230; that probably won&#039;t appreciate being dereferenced.<br />
<code><br />
Input:  "%p %p %p %p %s"</p>
<p></code><br />
Ok so <strong>we can crash the program</strong>. Can we do anything more interesting?<br />
Let&#039;s say there was some interesting data somewhere in the program. To simulate this, I&#039;ll put my bank account number on the stack with the following line of code at the beginning of &#8220;main&#8221;   &#8220;volatile char * bankAccount = &#8220;Account#123-456-7890&#8243;;&#8221; (the volatile helps convince the compiler not to throw it away since I don&#039;t use it).</p>
<p>Now when I call the function with the right input, I can dump my bank account number:</p>
<p><code>Input: test.exe "%p %s"<br />
Output: 00344FD0 Account#123-456-7890 00344FD0<br />
</code></p>
<p>Ok but nobody really cares about Denial-of-service and Information-disclosure. Those are sooooo pri-3. Can we use take over the machine? As everyone knows, the hacker&#039;s favorite format string character is &#039;%n&#039;. &#039;%n&#039; writes the number of bytes written so far to the param from the stack. Let&#039;s try a &#039;%n&#039;:<br />
<code><br />
Input: test.exe "%p %n"<br />
Output: Error: (state != ST_INVALID)<br />
</code></p>
<p>Blast! Foiled! It turns out Microsoft decided that %n was too much power, and that we mere mortals couldn&#039;t handle it. Good for them. There is an override, but it turns out to not be available using the Safe CRT. <strong>The moral of the story? </strong>The safe crt is a wonderful and powerful tool to help prevent buffer overruns. But there is no excuse for letting a user control a format string.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/04/how-safe-is-the-safecrt-handling-of-formatting-strings/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handling Unicode when marshalling from .Net to a platform invoke</title>
		<link>http://www.casaba.com/blog/2008/04/handling-unicode-when-marshalling-from-net-to-a-platform-invoke/</link>
		<comments>http://www.casaba.com/blog/2008/04/handling-unicode-when-marshalling-from-net-to-a-platform-invoke/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 05:09:56 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[By default, the .Net runtime will marshall a string (and files in a value type) as a LPStr to a platform invoke (p/invoke) function. By default the .Net framework and runtime handles strings as UTF-16. That&#39;s two bytes representing a single Unicode &#39;code point&#39;, and more familiar, a single character. An LPStr on the other [...]]]></description>
			<content:encoded><![CDATA[<p>By default, the .Net runtime will marshall a string (and files in a value type) as a LPStr to a platform invoke (p/invoke) function. By default the .Net framework and runtime handles strings as UTF-16.  That&#39;s two bytes representing a single Unicode &#39;code point&#39;, and more familiar, a single character. An LPStr on the other hand, is an ANSI character, so in order to convert, the runtime will perform a <strong>best-fit conversion</strong> to the classic windows-1252 code page.  This conversion is well-documented here:</p>
<p><a href="http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1252.txt">http://unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit1252.txt</a></p>
<p>This might not be so surprising to people in tune with Unicode, but it&#39;s can lead to huge security problems when security filters are at risk. For example, if you&#39;re performing HTML filtering or file canonicalization, you need to perform so <strong>after the conversion </strong>to LPStr.</p>
<p>This default marshalling behavior is documented at:  <a href="http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute(VS.71).aspx">http://msdn2.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute(VS.71).aspx</a></p>
<p>To properly and more safely <strong>deal with this</strong>, you can use the MarshallAsAttribute class to specify a <strong>LPWStr </strong>type instead of a LPStr.  For example:</p>
<p>	[MarshalAs(UnmanagedType.LPWStr)]</p>
<p>Because LPWStr is a pointer to a null-terminated array of Unicode characters, this ensures the Unicode code points are preserved across the marshalling.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/04/handling-unicode-when-marshalling-from-net-to-a-platform-invoke/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open redirects &#8211; what&#8217;s the problem?</title>
		<link>http://www.casaba.com/blog/2008/03/open-redirects-whats-the-problem/</link>
		<comments>http://www.casaba.com/blog/2008/03/open-redirects-whats-the-problem/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 16:16:01 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Code Review]]></category>
		<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Been getting this question a bit lately. First off, what&#039;s an open redirect? It&#039;s a function in your application which sends the user to some other location. The redirect could be a response from the server, such as an HTTP 301 or 302 response code, or a META redirect. The redirect can be delivered in [...]]]></description>
			<content:encoded><![CDATA[<p>Been getting this question a bit lately.  First off, what&#039;s an open redirect?  It&#039;s a function in your application which sends the user to some other location.  The redirect could be a response from the server, such as an HTTP 301 or 302 response code, or a META redirect.  The redirect can be delivered in several forms, the important part is that when an attacker can control the redirect location, they can exploit it for nefarious purposes &#8211; usually this means spam or phishing attacks.</p>
<p>For example, your application takes a request from the user, maybe it&#039;s a GET request for a certain page.  Included in the request is a value indicating the location where the user should be redirected once they&#039;ve finished on the page.  So, the user requests a page like:</p>
<p><code>http://somesite.tld/page.aspx?name=value&amp;returnUrl=http://somesite.tld/referringpage.aspx</code></p>
<p>As you can see, the <strong>returnUrl </strong>takes a value of the redirect location.  Then your code acts on it somewhere by redirecting the user with something like:<br />
<code><br />
Response.Redirect(returnUrl);<br />
</code></p>
<p><strong>Spammers and phishers</strong> love this, it gives them <strong>good camouflage</strong>.  For example:</p>
<p><code>http://somesite.tld/page.aspx?name=value&amp;returnUrl=http://evil.tld/installMalware.bad</code></p>
<p>Now imagine the spammer has crafted up a nice email that looks like it originates from somesite.tld, includes all the logos, fonts, etc.  They coerce the victim into clicking this link by saying something like &#8220;your account needs immediate attention&#8221; or &#8220;you&#039;ve won 500 points&#8221;.  User clicks the link, gets redirected to evil.tld, and may not realize that the domain has switched before they say <strong>Yes</strong> to install the thing that the spammer wants them to download.</p>
<p>Tricky, right.  In fact this is a favorite of spam, malware, and phish, next to the old XSS bug.</p>
<p><strong>What&#039;s the solution</strong><br />
Well, simply, don&#039;t redirect openly, rather, implement a SafeRedirect() function that looks something like:</p>
<p><code><br />
public static SafeRedirect(string url) {<br />
// check that protocol is either http:// https:// ftp:// or other specific protos you want to allow<br />
// check that domain is in fact yourdomain.tld<br />
// If these checks pass, then you can go ahead<br />
Response.Redirect(returnUrl);<br />
// If the checks fail, you can try to clean up the URL, but probably best to just fail and redirect to a safe landing page<br />
}<br />
</code><br />
That&#039;s about all there is too it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/03/open-redirects-whats-the-problem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using ASP.Net session handling with secure sites (set the secure flag)</title>
		<link>http://www.casaba.com/blog/2008/02/using-asp-net-session-handling-with-secure-sites-set-the-secure-flag/</link>
		<comments>http://www.casaba.com/blog/2008/02/using-asp-net-session-handling-with-secure-sites-set-the-secure-flag/#comments</comments>
		<pubDate>Mon, 04 Feb 2008 07:04:42 +0000</pubDate>
		<dc:creator>Samuel Bucholtz</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[cookies]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[One of the common problems we see with many web applications is reliance on ASP.Net sessionID without understanding the security ramifications. ASP.Net provides web developers with a powerful means of tracking user state and identity with very little coding. Rather than creating your own custom authentication cookie, handling the trickiness of forms auth or mapping [...]]]></description>
			<content:encoded><![CDATA[<p>One of the common problems we see with many web applications is reliance on ASP.Net sessionID without understanding the security ramifications. ASP.Net provides web developers with a powerful means of tracking user state and identity with very little coding. Rather than creating your own custom authentication cookie, handling the trickiness of forms auth or mapping your cookie to a Windows identity, password policy implementation, not to mention creating server objects to store the state for a given user, ASP.net does it all for you. </p>
<p>ASP.Net offers two methods of tracking session state- URL or cookie. URL based methods are used in cases where it is expected that some users will have disabled cookies and still need a server-side session to track state. This has become less common as more and more of the web relies on cookies. In addition the URLs look ugly and are considered unacceptableby many usability gurus. </p>
<p>The second method is a cookie sent as a header to the server. This cookie is sent over HTTP or HTTPS and is used by ASP.net to link an incoming request to the server-side state. So you are running your site on SSL, where is the problem? By default, the SessionID is just a cookie the browser sends it when making any response to the domain. If you go to <a href="https://yourapp/application" title="https://yourapp/application">https://yourapp/application</a>, you will be sent a cookie over SSL that I cannot see. If I e-mail you a link to click for <a href="http://yourapp/application" title="http://yourapp/application">http://yourapp/application</a>, I will see the cookie sent over HTTP as long as your server responds on port 80. </p>
<p>What you want to do is set the &#039;secure&#039; flag on the cookie.  You have many options for doing this: <strong>adsutil set w3svc/1/AspKeepSessionIDSecure 1</strong> will tell ASP.net to mark the session cookie as Secure. When a cookie is marked as secure it will not be sent by the web browser unless the connection to the server is over https. You must be aware that the user will now have no session state if they browse to the site using http your application will need to redirect http requests to https in order to access the session state. </p>
<p>Is the ASP.Net session ID the only cookie I can protect in this way? No. You can use a web.config configuration to customize the security of all your cookies (<a href="http://msdn2.microsoft.com/en-us/library/ms228262.aspx" title="http://msdn2.microsoft.com/en-us/library/ms228262.aspx">http://msdn2.microsoft.com/en-us/library/ms228262.aspx</a>). You will also be able to set cookies to be HttpOnly which adds its own element of security and is supported by newer browsers. </p>
<p>Finally, you can set both the secure flag and the HttpOnly flag for any other cookies you set programmatically through ASP.Net with <a href="http://msdn2.microsoft.com/en-us/library/ms228262.aspx" title="http://msdn2.microsoft.com/en-us/library/ms228262.aspx">http://msdn2.microsoft.com/en-us/library/ms228262.aspx</a>.</p>
<p>A few other things to remember- </p>
<p>ASP.Net sessions expire after 20 minutes UNLESS a new request is seen. Otherwise they can remain until the server is recycled. </p>
<p>SessionIDs can be reused. When stored as a cookie the sessionID will go to any machine hosting the same parent domain. They will NOT have the server-side state though unless some clustering or back-end logic handles sharing state across servers. If you want to ensure that reuse does not happen, rather than using Session.Abandon you must overwrite the ASP.Net session cookie with an empty cookie value. To properly end a session or force a user to start a new one use Session.Abandon. </p>
<p>For more information checkout &#8211; <a href="http://msdn2.microsoft.com/en-us/library/ms972969.aspx" title="http://msdn2.microsoft.com/en-us/library/ms972969.aspx">http://msdn2.microsoft.com/en-us/library/ms972969.aspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/02/using-asp-net-session-handling-with-secure-sites-set-the-secure-flag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Secure Coding Standards</title>
		<link>http://www.casaba.com/blog/2008/01/new-secure-coding-standards/</link>
		<comments>http://www.casaba.com/blog/2008/01/new-secure-coding-standards/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 07:15:36 +0000</pubDate>
		<dc:creator>Samuel Bucholtz</dc:creator>
				<category><![CDATA[SDL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This has probably been a long time coming, but CERT has announced that they will be hosting a wiki containing secure coding practices for C and C++. This codification of numerous industry best practices and rules of thumb into a single referable source will make the lives of consultants easier when performing code reviews. From [...]]]></description>
			<content:encoded><![CDATA[<p>This has probably been a long time coming, but CERT has announced that they will be hosting a wiki containing secure coding practices for C and C++.  This codification of numerous industry best practices and rules of thumb into a single referable source will make the lives of consultants easier when performing code reviews. From Robert C. Seacord of CERT:</p>
<p>	The CERT/Coordination Center at the Software Engineering Institute at Carnegie Mellon University has lead a community effort to develop secure coding standards for the C and C++ programming languages. This work is being performed on the secure coding wiki at<br />
	<a href="http://www.securecoding.cert.org" title="www.securecoding.cert.org">www.securecoding.cert.org</a>.   In particular, we have made significant<br />
	progress on the CERT C Programming Language Secure Coding Standard since work first begun over a year and half ago and our progress as been reviewed by the ISO/IEC WG14 international standardization working group for the programming language C at both the London and Kona meetings.</p>
<p>This has probably been a long time coming, and I will be interested to see what, if any, review tools come out to compare a code base against the standard.</p>
<p>Links: </p>
<p>C &#8211; <a href="https://www.securecoding.cert.org/confluence/display/seccode/CERT+C+Secure+Coding+Standard" title="https://www.securecoding.cert.org/confluence/display/seccode/CERT+C+Secure+Coding+Standard">https://www.securecoding.cert.org/confluence/display/seccode/CERT+C+Secu&#8230;</a></p>
<p>C++ &#8211; <a href="https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=637" title="https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=637">https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageI&#8230;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/01/new-secure-coding-standards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When looking at a privacy policy&#8230;</title>
		<link>http://www.casaba.com/blog/2008/01/when-looking-at-a-privacy-policy/</link>
		<comments>http://www.casaba.com/blog/2008/01/when-looking-at-a-privacy-policy/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 20:18:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Privacy]]></category>
		<category><![CDATA[policy]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Ten things in a privacy policy that should make your spidey sense go off&#8230; 1. &#34;We may use logs to analyze trends, administer the Site, track user movement in the aggregate, and gather broad demographic information for aggregate use. We may associate this information with your Personal Information to resolve technical issues and support security [...]]]></description>
			<content:encoded><![CDATA[<p>Ten things in a privacy policy that should make your spidey sense go off&#8230; </p>
<p>1. &quot;We may use logs to analyze trends, administer the Site, track user movement in the aggregate, and gather broad demographic information for aggregate use. We may associate this information with your Personal Information to resolve technical issues and support security for our users.&quot;</p>
<p>What exactly is the company gathering in those logs? Who has access to these logs? Do third parties analyze the data and if so what do they do with it? </p>
<p>&#160;</p>
<p>2. &quot;We may share, in aggregate form, information collected from surveys with advertisers, partners, affiliates and the general public, but will not share survey information containing personally identifiable information with any third party without your prior consent.&quot;</p>
<p>Make darn well sure you understand how and where you give consent to allowing PII to third party sites.  Does the company use auto opt-ins, do you opt-out by default, is it a combination or are you not even given the chance to opt-out? </p>
<p>&#160;</p>
<p>3. &quot;We link cookies to your unique registration number and use them to enhance and personalize your experience on the Site. We also use cookies to deliver information and fresh content specific to your interests.&quot; </p>
<p>There is no mention of third party cookies&#8230; are third party cookies used and if so, how does that affect your privacy? </p>
<p>&#160;</p>
<p>4. “We only share Your Information with others when we have your permission or under the types of circumstances described in this Privacy Policy.” </p>
<p>Read the rest of the Privacy Policy carefully to understand the circumstances where your information could be shared with others </p>
<p>&#160;</p>
<p>5. “Upon removal of membership from the Site, we may retain Your Information for a period of time in our internal databases and systems.”</p>
<p>Not a particularly specific timeframe&#8230; how long?  For what purpose is this information being retained? </p>
<p>&#160;</p>
<p>6. “You should be aware that despite our efforts, factors beyond our control may result in disclosure of Your Information. Accordingly, we are not in a position to guarantee that Your Information will be secure under all circumstances.” </p>
<p>So what circumstances are they responsible for?  Is that information outlined specifically or is this a carte blanche for deniability?  What exactly is a factor beyond their control?  Be skeptical and ask questions. </p>
<p>&#160;</p>
<p>7.”We may update this policy from time to time as our information practices are modified or changed.  It is strongly suggested that you regularly visit this privacy policy for updates to its contents.” </p>
<p>Better policy would dictate the company notifies its customers whenever a change to the policy is made.</p>
<p>&#160;</p>
<p>8. “We may, without your consent, access and disclose Your Information, any communications sent or received by you, and any other information that we may have about you or your account if&#8230;” </p>
<p>For what? Requests by the government?  Actions that appear illegal?  A threat is made?  How comfortable are you with who they detailed could request or be provided this information?  Is there any ambiguity to the list?  Is there actually a list provided? </p>
<p>&#160;</p>
<p>9. “We may share Your Information with third parties that are subject to privacy policies that protect your personally identifiable information from disclosure to other third parties in a similar manner to our privacy policy.” </p>
<p>What does a similar manner mean?  If they cannot disclose the exact privacy policy these third parties are using, you cannot be assured they are using your information in a manner you would agree to. </p>
<p>&#160;</p>
<p>10. We and our third party advertisers may use web beacons to compile aggregate statistics about which advertisements and promotions users have seen and how users responded to them. </p>
<p>Beacons can also be referred to as web bugs, 1&#215;1 gifs, clear gifs, tracking bugs, and tracking pixels.  Are these beacons associated to individuals and how does the company handle this information?  As mentioned before, are third parties beholden to a privacy policy and if so, what is it? </p>
<p>&#160;</p>
<p>It&#39;s pretty simple&#8230; always read the privacy policy.  Be skeptical, ask questions, read between the lines and walk away from a site that sinks below your &quot;I don&#39;t feel so good about what this company is all about&quot; threshold.  Be wary of privacy policies and terms of use that make you jump around from one document to another or from one paragraph to another in a non linear manner.  Refuse to accept ambiguity.  Write to the company.  An electronics firm in Brooklyn selling a camera for 1/2 of what everyone else is selling it for is probably performing a bait and switch and probably doesn&#39;t care about your PII… use your brain.  Remember, you CAN fight back with your wallet.  You don&#39;t like how the company protects your data then don&#39;t reward them with your patronage and let others know.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/01/when-looking-at-a-privacy-policy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft Releases the sources to the .Net framework</title>
		<link>http://www.casaba.com/blog/2008/01/microsoft-releases-the-sources-to-the-net-framework/</link>
		<comments>http://www.casaba.com/blog/2008/01/microsoft-releases-the-sources-to-the-net-framework/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 10:59:55 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I suppose this is news to a lot of people. http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-&#8230; The easy access to the source should help people. Even if it helps them use someone elses library. I&#039;ll get back to that thought in a second. Of course the Intermediate Language (IL) can be looked at with it&#039;s rich meta data with ILDASM. [...]]]></description>
			<content:encoded><![CDATA[<p>I suppose this is news to a lot of people.  <a href="http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx" title="http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-source-code-now-available.aspx">http://weblogs.asp.net/scottgu/archive/2008/01/16/net-framework-library-&#8230;</a>  The easy access to the source should help people.  Even if it helps them use someone elses library.  I&#039;ll get back to that thought in a second.</p>
<p>Of course the Intermediate Language (IL) can be looked at with it&#039;s rich meta data with ILDASM.  It&#039;s kind of odd looking at &#8220;machine&#8221; intructions for a virtual machine.  As far as I can tell there&#039;s close to no documentation about their OP codes or a language reference.  The one (and only) great book I&#039;ve found is &#8230;Expert .NET 2.0 IL Assembler<br />
by Serge Lidin, S. Lidin</p>
<p>The much easier way to wander around is <a href="http://www.aisto.com/roeder/dotnet/"> Reflector</a>.  You&#039;ll want the file disassembler add-in (let&#039;s you save all the files in an assembly).</p>
<p>I&#039;ve wandered around in the framework a good deal and for the most part it isn&#039;t &#8230;.mmmmm&#8230;. productive.  Some beanhead professor once upon a time decided that everything possible should be private.  I&#039;m not sure what this accomplishes except that it kills all kinds of code reuse.  For example you want the listbox control to handle hotkeys or whatever just a tad differently for your application.  You should just be able to overload the &#8220;broken&#8221; part of .Net.  No can do, private.  Don&#039;t get me wrong, on occasion you can redo some function.  You borrow the code in Reflector, modify the part that doesn&#039;t work for you, and then you have to figure out how to get it&#039;s 4 uses of private calls fixed.  Copy the whole object you say!  Good idea.  Now you have 4 other internal objects to copy.  Lame lame lame.  It&#039;s a big ole spider web.</p>
<p>The best cheat is to add yourself a CustomAttribute listing your assembly as a a &#8220;friend&#8221;.  Of course this makes the signature invalid, so not exactly distributable.  You could really cheat and sign your own version!  Ahah.                  Who knows what&#039;s next?  Mmmhmm, you have to drag all the other Microsoft Internal Friends with you.  It&#039;s a tar baby I tell ya.</p>
<p>Who want&#039;s to talk about COM and application integration now?  Makes you love those little itty bitty tools that don&#039;t depend on a thing.  I wish thee were more.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/01/microsoft-releases-the-sources-to-the-net-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Whatever happened to?</title>
		<link>http://www.casaba.com/blog/2008/01/whatever-happened-to/</link>
		<comments>http://www.casaba.com/blog/2008/01/whatever-happened-to/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 20:23:59 +0000</pubDate>
		<dc:creator>Samuel Bucholtz</dc:creator>
				<category><![CDATA[Security Testing]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[One of the most useful sites on the Internet was the Ports Database at http://www.portsdb.org Unfortunately it went missing over a year ago and has not returned. The best alternative I have found is using the IANA list at http://www.iana.org/assignments/port-numbers and doing a manual search. Not ideal, but it works. Maybe we will put a [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most useful sites on the Internet was the Ports Database at <a href="http://www.portsdb.org" title="http://www.portsdb.org">http://www.portsdb.org</a></p>
<p>Unfortunately it went missing over a year ago and has not returned. The best alternative I have found is using the IANA list at <a href="http://www.iana.org/assignments/port-numbers" title="http://www.iana.org/assignments/port-numbers">http://www.iana.org/assignments/port-numbers</a> and doing a manual search. Not ideal, but it works. Maybe we will put a little database up on this site in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/01/whatever-happened-to/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>P3P compliancy search engine</title>
		<link>http://www.casaba.com/blog/2008/01/p3p-compliancy-search-engine/</link>
		<comments>http://www.casaba.com/blog/2008/01/p3p-compliancy-search-engine/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 20:19:32 +0000</pubDate>
		<dc:creator>Noah Glassberg</dc:creator>
				<category><![CDATA[Privacy]]></category>
		<category><![CDATA[P3P]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[While the Privacy Finder Privacy Policy search engine only works for an estimated 15% of the top 5000 websites, it is a useful tool to find websites that comply with a stated privacy preference level (low, medium, high or custom) based on a P3P (Platform for Privacy Preferences Project) standard for creating machine readable policies. [...]]]></description>
			<content:encoded><![CDATA[<p>While the Privacy Finder Privacy Policy search engine only works for an estimated 15% of the top 5000 websites, it is a useful tool to find websites that comply with a stated privacy preference level (low, medium, high or custom) based on a P3P (Platform for Privacy Preferences Project) standard for creating machine readable policies. </p>
<p>You chose the search engine the Privacy Finder will use; put your search term in the dialog box, select your Privacy Preference Threshold Level and the results of the search are provided.  If the search comes back with a website that has a P3P compliant privacy policy, a &#8220;privacy meter&#8221; is shown.  The number of green boxes in the &#8220;privacy meter&#8221; shows how closely the privacy policy matches up with the privacy preference level set when doing the search.  A link next to the search results brings another page neatly and succinctly showing why the privacy policy does or does not match the preference level and another link to the sites entire policy.</p>
<p>The P3P standard has been around since 2002, but it hasn&#039;t really caught on with the web community at large for a number of reasons:</p>
<p>-Some argue it&#039;s too complex<br />
-Non code compliance does not necessarily mean poor privacy standards for a company<br />
-There are currently no laws which require a company to comply specifically with a privacy policy<br />
-Poor support from the web browser community</p>
<p>These issues do not remove the need for companies to provide clearer explanations of how it handles a customer’s information and P3P, while not perfect certainly is better than no standard.  What privacy finder does is present the compliant privacy policy to the consumer in an easy to read and standardized output, giving consumers more information to make more informed choices.</p>
<p>For more information:<br />
<a href="http://www.privacyfinder.org/" title="http://www.privacyfinder.org/">http://www.privacyfinder.org/</a><br />
<a href="http://www.w3.org/P3P/" title="http://www.w3.org/P3P/">http://www.w3.org/P3P/</a><br />
<a href="http://cups.cs.cmu.edu/" title="http://cups.cs.cmu.edu/">http://cups.cs.cmu.edu/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/01/p3p-compliancy-search-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New risks for old credentials</title>
		<link>http://www.casaba.com/blog/2008/01/new-risks-for-old-credentials/</link>
		<comments>http://www.casaba.com/blog/2008/01/new-risks-for-old-credentials/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 20:16:56 +0000</pubDate>
		<dc:creator>Samuel Bucholtz</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[Tivo]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I was playing around with my Tivo this weekend and realized that many of the new features being offered on Tivo are handy but leave valuable information stored on your Tivo. How so? Well, Tivo now offers Amazon Unbox downloads, Yahoo Weather/Traffic, etc. All of these services require you to store your credentials on the [...]]]></description>
			<content:encoded><![CDATA[<p>I was playing around with my Tivo this weekend and realized that many of the new features being offered on Tivo are handy but leave valuable information stored on your Tivo.</p>
<p>How so?</p>
<p>Well, Tivo now offers Amazon Unbox downloads, Yahoo Weather/Traffic, etc. All of these services require you to store your credentials on the device or on Tivo&#039;s website. Imagine what might happen if an attacker can break into the device and gather such information. With an Amazon account an attacker has access to any stored credit cards for purchases on the site. Even if an attacker cannot hack into your private network and break into the Tivo, what happens when the Tivo is put into the trash at the end of its life?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/01/new-risks-for-old-credentials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Visual Studio 2008 CRT bug</title>
		<link>http://www.casaba.com/blog/2008/01/visual-studio-2008-crt-bug/</link>
		<comments>http://www.casaba.com/blog/2008/01/visual-studio-2008-crt-bug/#comments</comments>
		<pubDate>Wed, 16 Jan 2008 17:19:16 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[bug]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I run into this &#8220;issue&#8221; alot compiling this open source project or that open source project (winpcap, cygwin, delegate, snort, nmap. It&#039;s a fun MACRO problem. I love MACROs. &#60;/sarc&#62; Here&#039;s what your compiler will give you. 12&#62;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(358) : error C3163: &#039;_vsnprintf&#039;: attributes inconsistent with previous declaration 12&#62; C:\Program Files [...]]]></description>
			<content:encoded><![CDATA[<p>I run into this &#8220;issue&#8221; alot compiling this open source project or that open source project (winpcap, cygwin, delegate, snort, nmap.  It&#039;s a fun MACRO problem.  I love MACROs.  &lt;/sarc&gt;</p>
<p>Here&#039;s what your compiler will give you.</p>
<p><code><br />
 12&gt;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(358) : error C3163: &#039;_vsnprintf&#039;: attributes inconsistent with previous declaration<br />
 12&gt;        C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\include\stdio.h(350) : see declaration of &#039;_vsnprintf&#039;<br />
 12&gt;Generating Code...<br />
</code></p>
<p>Now this looks like a no brainer, I mean the two declarations are 8 lines apart!  So I stare for a while.  (Looks the same to me).   Hmmmm.  Then I try following a few MACRO&#039;s, often futile if you don&#039;t have browser symbols built yet.  Perhaps I have some crazy path with my includes!?  I only have 12 SDKs or something installed.  So I turn on /showIncludes (how did it take 20yrs to add this option?)  Looks good again&#8230;..</p>
<p>Crap time for the Big Guns &#8212;  If you love MACRO programming you know what&#039;s next.  Turn on the C++ listing output.  The listing output is what the compiler really compiles are the preprocessor has had it&#039;s merry way with the code.  2MB of the finest night time reading you&#039;ll ever find.  Per source file of course.  I was kinda dreading trying to find the function after all it&#039;s beautification had been stripped.</p>
<p>I&#039;ve read a lot of code over the years.  I&#039;m not even sure what this is&#8230;much less what it would preprocess out to.</p>
<p><code><br />
__DEFINE_CPP_OVERLOAD_STANDARD_NFUNC_0_2_ARGLIST_EX(int, __RETURN_POLICY_SAME, _CRTIMP, _snprintf, _vsnprintf, _Pre_notnull_ _Post_maybez_ char, _Out_cap_(_Count) _Post_maybez_, char, _Dest, _In_ size_t, _Count, _In_z_ _Printf_format_string_ const char *, _Format)<br />
</code></p>
<p>I digress&#8230;</p>
<p>It just compiles when you turn on the listing output.</p>
<p>I&#039;ll type it more slowly this time, in case that didn&#039;t sink in.  The compiler switch, that just spits out more information, changed things just enough to have everything compile.  Neato, unless that sort of thing keeps you up at night.</p>
<p>btw, the fix, if you&#039;ve been reading this far, is to not #define vsnprintf in _your_ project.  The CRT must redefine it once or thrice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/01/visual-studio-2008-crt-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to apply domain restrictions to a browser plugin (ActiveX or XPCOM)</title>
		<link>http://www.casaba.com/blog/2008/01/how-to-apply-domain-restrictions-to-a-browser-plugin-activex-or-xpcom/</link>
		<comments>http://www.casaba.com/blog/2008/01/how-to-apply-domain-restrictions-to-a-browser-plugin-activex-or-xpcom/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 06:43:13 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[ActiveX]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[XPCOM]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[For Internet Explorer, there&#39;s Microsoft&#39;s Sitelock. For Mozilla, I&#39;m not sure what there is&#8230; In that case, we&#39;ve been working on some solutions that could hold up cross-browser on a Windows platform. Sitelock takes a solid approach, check out the code and you&#39;ll see it implements the IObjectSafetySiteLockImpl, replacing the ATL IObjectSafety interface. What am [...]]]></description>
			<content:encoded><![CDATA[<p>
<span style="background-color: #ffffff">For Internet Explorer, there&#39;s Microsoft&#39;s <a href="http://www.microsoft.com/Downloads/details.aspx?FamilyID=43cd7e1e-5719-45c0-88d9-ec9ea7fefbcb&amp;displaylang=en">Sitelock</a>. For Mozilla, I&#39;m not sure what there is&#8230; In that case, we&#39;ve been working on some solutions that could hold up cross-browser on a Windows platform. Sitelock takes a solid approach, check out the code and you&#39;ll see it implements the IObjectSafetySiteLockImpl, replacing the ATL IObjectSafety interface. What am I talking about? Well sometimes, when you develop a browser plugin like an ActiveX control for IE or an XPCOM object for Mozilla, you only want it to load and run from a few trusted domains. The plugin/control runs potentially powerful code after all, executing in the user&#39;s context. For example, you&#39;re a large social networking site, and your new control helps synchronize offline and online data for the user. Well first off, you want to make sure it&#39;s secure as possible:</span>
</p>
<ol>
<li><span style="background-color: #ffffff">code flaws have been identified and addressed (buffer overflows, leaks, etc.)</span></li>
<li><span style="background-color: #ffffff">repurposing threats have been identified and mitigated (the control should not do anything more than it needs, and should be very careful when performing file, registry, or network operations)</span></li>
</ol>
<p>
<span style="background-color: #ffffff">To gain a higher level of assurance that this control won&#39;t be exploited, you take more steps to <strong>restrict the domains which are allowed to call it</strong>.</span>
</p>
<p>
<span style="background-color: #ffffff">So without Sitelock for Mozilla, we&#39;re in search of an alternative solution that will work across both IE and Mozilla. We know a few things available for the cross-browser domain restriction solution:</span>
</p>
<ul>
<li><span style="background-color: #ffffff">we can use C/C++</span></li>
<li><span style="background-color: #ffffff">we have access to the DOM</span></li>
<li><span style="background-color: #ffffff">we have access to COM+</span></li>
<li><span style="background-color: #ffffff">we&#39;d like access to WININET but that&#39;s too far down the stack</span></li>
</ul>
<p>
<span style="background-color: #ffffff">Right now, we&#39;re primarily interested in <strong>getting</strong> the <strong>true domain</strong> which is loading and calling the plugin. How can we gaurantee this? We try getting it from the DOM&#39;s <strong>document.domain</strong> property, but know that t</span><span style="background-color: #ffffff">he document.domain property has historically been a source of security vulnerability in all major browsers. There have even recently been ways to spoof the address bar, or the domain property using JavaScript and other means, and there likely will in the future. For example:</span>
</p>
<p>
<span style="background-color: #ffffff">FireFox<br />
<a href="http://www.thespanner.co.uk/2007/11/14/spoofing-firefox-protected-object">http://www.thespanner.co.uk/2007/11/14/spoofing-firefox-protected-object</a></span>
</p>
<p>
<span style="background-color: #ffffff">IE 6/7. <br />
<a href="http://www.0x000000.com/hacks/crossdomain/crossdomain.html">http://www.0&#215;000000.com/hacks/crossdomain/crossdomain.html</a> </span>
</p>
<p>
<span style="background-color: #ffffff">Safari/Windows <br />
<a href="http://nvd.nist.gov/nvd.cfm?cvename=CVE-2007-3514">http://nvd.nist.gov/nvd.cfm?cvename=CVE-2007-3514</a></span>
</p>
<p>
<span style="background-color: #ffffff">After some research we&#39;re testing some other options. Right now our best bet might be looking like:</span>
</p>
<p><span style="background-color: #ffffff"></p>
<ul>
<li>using <span style="font-size: 11pt; font-family: &#039;Calibri&#039;,&#039;sans-serif&#039;"><span style="color: #000000">IWebBrowser2::get_LocationURL() for Internet Explorer</span></span></li>
<li><span style="font-size: 11pt; font-family: &#039;Calibri&#039;,&#039;sans-serif&#039;"><span style="color: #000000">using <span style="font-size: 11pt; font-family: &#039;Calibri&#039;,&#039;sans-serif&#039;">window.location.href for Mozilla</span></span></span></li>
<li><span style="font-size: 11pt; font-family: &#039;Calibri&#039;,&#039;sans-serif&#039;"><span style="color: #000000"><span style="font-size: 11pt; font-family: &#039;Calibri&#039;,&#039;sans-serif&#039;">InternetCrackUrl() to parse the hostname</span></span></span></li>
<p>After some testing we don&#39;t see the document.domain type issues present in window.location.href, so it seems to be holding up short some unknown browser-flaw.
</ul>
<ul>
	IWebBrowser2::getLocationURL() seems okay but I did find the following issue with get_LocationURL at <a href="http://support.microsoft.com/kb/272095">http://support.microsoft.com/kb/272095</a>.
</ul>
<ul>
	~Chris Weber
</ul>
<p></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2008/01/how-to-apply-domain-restrictions-to-a-browser-plugin-activex-or-xpcom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Command and Control Structures in Malware: From Handler/Agent to P2P</title>
		<link>http://www.casaba.com/blog/2007/12/command-and-control-structures-in-malware-from-handleragent-to-p2p/</link>
		<comments>http://www.casaba.com/blog/2007/12/command-and-control-structures-in-malware-from-handleragent-to-p2p/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 23:37:38 +0000</pubDate>
		<dc:creator>John Hernandez</dc:creator>
				<category><![CDATA[Malware]]></category>
		<category><![CDATA[botnet]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Good article by David Dittrich and Sven Dietrich in ;login: magazine which I was able to contribute to by doing a lot of the reverse engineering of the Nugache trojan. The main focus of the article is the evolution of bot networks. Focusing on the details of the command and control structures of various types [...]]]></description>
			<content:encoded><![CDATA[<p>Good article by David Dittrich and Sven Dietrich in ;login: magazine which I was able to contribute to by doing a lot of the reverse engineering of the Nugache trojan. The main focus of the article is the evolution of bot networks. Focusing on the details of the command and control structures of various types of bot networks. </p>
<p><a href="http://www.usenix.org/publications/login/2007-12/index.html">Command and Control Structures in Malware: From Handler/Agent to P2P</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2007/12/command-and-control-structures-in-malware-from-handleragent-to-p2p/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analysis of the Storm and Nugache Trojans: P2P Is Here</title>
		<link>http://www.casaba.com/blog/2007/12/analysis-of-the-storm-and-nugache-trojans-p2p-is-here/</link>
		<comments>http://www.casaba.com/blog/2007/12/analysis-of-the-storm-and-nugache-trojans-p2p-is-here/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 23:33:09 +0000</pubDate>
		<dc:creator>John Hernandez</dc:creator>
				<category><![CDATA[Malware]]></category>
		<category><![CDATA[botnet]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[This is an article that I worked on with Sam stover which covers some of the high level concepts that were introduced by next generation peer-to-peer bot networks. In it we dissect the some of the details of the Nugache and Storm trojans. Check it out: Analysis of the Storm and Nugache Trojans: P2P Is [...]]]></description>
			<content:encoded><![CDATA[<p>This is an article that I worked on with Sam stover which covers some of the high level concepts that were introduced by next generation peer-to-peer bot networks.  In it we dissect the some of the details of the Nugache and Storm trojans.</p>
<p>Check it out:<br />
<a href="http://www.usenix.org/publications/login/2007-12/index.html">Analysis of the Storm and Nugache Trojans: P2P Is Here </a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2007/12/analysis-of-the-storm-and-nugache-trojans-p2p-is-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analysis of the Storm and Nugache Trojans: P2P Is Here</title>
		<link>http://www.casaba.com/blog/2007/12/analysis-of-the-storm-and-nugache-trojans-p2p-is-here-2/</link>
		<comments>http://www.casaba.com/blog/2007/12/analysis-of-the-storm-and-nugache-trojans-p2p-is-here-2/#comments</comments>
		<pubDate>Sat, 01 Dec 2007 17:53:02 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=297</guid>
		<description><![CDATA[John Hernandez and other member&#8217;s work on the Nugache botnet &#8220;Analysis of the Storm and Nugache Trojans: P2P Is Here&#8221; in ;login: The USENIX Magazine December 2007, Volume 32, Number 6 Paper: Analysis of the Storm and Nugache Trojans: P2P Is Here (PDF)]]></description>
			<content:encoded><![CDATA[<p>John Hernandez and other member&#8217;s work on the Nugache botnet &#8220;Analysis of the Storm and Nugache Trojans: P2P Is Here&#8221; in <a href="http://www.usenix.org/publications/login/2007-12/index.html" title=";login: The USENIX Magazine December 2007, Volume 32, Number 6">;login: The USENIX Magazine December 2007, Volume 32, Number 6</a></p>
<p>Paper: <a href="http://www.usenix.org/publications/login/2007-12/pdfs/stover.pdf" title="Analysis of the Storm and Nugache Trojans: P2P Is Here">Analysis of the Storm and Nugache Trojans: P2P Is Here (PDF)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2007/12/analysis-of-the-storm-and-nugache-trojans-p2p-is-here-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I18N input validation whitelist filter with System.Globalization and GetUnicodeCategory</title>
		<link>http://www.casaba.com/blog/2007/04/i18n-input-validation-whitelist-filter-with-system-globalization-and-getunicodecategory/</link>
		<comments>http://www.casaba.com/blog/2007/04/i18n-input-validation-whitelist-filter-with-system-globalization-and-getunicodecategory/#comments</comments>
		<pubDate>Tue, 24 Apr 2007 05:33:20 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Unicode]]></category>
		<category><![CDATA[whitelist]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Maybe you’re building internationalized code and wondering how to build a whitelist filter that will support all the different character sets your planning to support. If you support more than ten, especially some of the larger east Asian sets, this might seem like an unwieldy or tricky process. Well luckily it’s easier than most people [...]]]></description>
			<content:encoded><![CDATA[<p>Maybe you’re building internationalized code and wondering how to build a whitelist filter that will support all the different character sets your planning to support. If you support more than ten, especially some of the larger east Asian sets, this might seem like an unwieldy or tricky process.<br />
Well luckily it’s easier than most people would think. Building a good input validation filter can be simplified with .Net’s <a linkindex="84" href="http://msdn2.microsoft.com/en-us/library/system.globalization.charunicodeinfo.getunicodecategory.aspx">GetUnicodeCategory</a>. But use the method from the <strong>System.Globalization</strong> namespace as the other one in System.Char looks like it may become the subordinate. </p>
<p>With <strong>GetUnicodeCategory </strong>you can simply build a <strong>whitelist </strong>supporting the character <em><strong>categories </strong></em>you want to allow. So get away from thinking you have to write a regEx filter and list out all the character ranges you want to allow in each character set, it’s much simpler than that! </p>
<p>The Unicode standard assigns ever character to one of about <strong>31 categories</strong>. They make sense too, for example Other Control charactes (Cc) , Lowercase Letter (Ll), Uppercase Letter (Lu), Math Symbol (Sm). So for example you might want to only allow letters, numbers, and punctuation in your whitelist. This could be achieved with the following snippet: </p>
<p><code><br />
char cUntrustedInput; // the untrusted user-input<br />
UnicodeCategory cInputTest = CharUnicodeInfo.GetUnicodeCategory(cUntrustedInput);<br />
if (cTestCategory == UnicodeCategory.LowercaseLetter ||<br />
cTestCategory == UnicodeCategory.UppercaseLetter ||<br />
cTestCategory == UnicodeCategory.DecimalDigitNumber ||<br />
cTestCategory == UnicodeCategory.TitlecaseLetter ||<br />
cTestCategory == UnicodeCategory.OtherLetter ||<br />
cTestCategory == UnicodeCategory.NonSpacingMark ||<br />
cTestCategory == UnicodeCategory.DashPunctuation ||<br />
cTestCategory == UnicodeCategory.ConnectorPunctuation)<br />
{<br />
// character looks safe, continue<br />
}<br />
else<br />
{<br />
// character is not allowed, fail<br />
}<br />
</code></p>
<p>Not too bad eh.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2007/04/i18n-input-validation-whitelist-filter-with-system-globalization-and-getunicodecategory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Access to .Net System.dll internal functions</title>
		<link>http://www.casaba.com/blog/2007/02/access-to-net-system-dll-internal-functions/</link>
		<comments>http://www.casaba.com/blog/2007/02/access-to-net-system-dll-internal-functions/#comments</comments>
		<pubDate>Thu, 22 Feb 2007 08:00:00 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Occasionally you will discover a nice class or function you would like to use. I stumbled across [mscorcfg]Microsoft.CLRAdmin.Fusion.AddAssemblytoGac(string strAssembly). Oddly enough there&#039;s no way to add an assembly to the gac from .Net code. This would be just great for MSBuild tasks, or even installing. If you try and use this class or function you [...]]]></description>
			<content:encoded><![CDATA[<p>Occasionally you will discover a nice class or function you would like to use.  I stumbled across [mscorcfg]Microsoft.CLRAdmin.Fusion.AddAssemblytoGac(string strAssembly).  Oddly enough there&#039;s no way to add an assembly to the gac from .Net code.  This would be just great for MSBuild tasks, or even installing.</p>
<p>If you try and use this class or function you get this result.</p>
<p><code><br />
c:\dev\test\private test.cs(10,9) : error CS0122: &#039;Microsoft.CLRAdmin.Fusion&#039; is inaccessible due to its protection level<br />
</code></p>
<p>Turns out using this function is pretty easy in theory.  .Net only checks permissions at link time.  You could do get around this the hard way by using ILAsm, or Reflection in C#.</p>
<p>Here&#039;s how you would do this using Reflection.</p>
<p><code></p>
<p>public static Int32 AddAssemblyToGac(string strAssembly)<br />
{<br />
  object[] args = newobject[] { strAssembly };<br />
  BindingFlags bindingFlags = (BindingFlags)314;<br />
  return ((Int32)(FusionType.InvokeMember("AddAssemblytoGac", bindingFlags, null, null, args)));<br />
}</p>
<p></code></p>
<p>Well that just opens up about a million possibilities.  Just try and &#8220;fix&#8221; one class from the ASP.NET framework and you have to drag in 12 million interfaces.  Now you are set, just use the same one&#039;s that it was using.  This is going to save me tons of time.  There&#039;s no way I&#039;m writing a million Reflection proxy interfaces.  Nevermind the fact that you can just call the interface using IL.  There just has to be a good way to do this from C#.  Worse case we could lie/cheat to the compiler.</p>
<p>The C# team has added a nice Attribute for us to do this.</p>
<p>[InternalsVisibleTo("AndrewsAssembly, PublicKeyToken=0b00fde735121dcc")]</p>
<p>You can read up on it viewing <a href="http://msdn2.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.aspx">InternalsVisibleToAttribute</a>.</p>
<p>So ILDasm System.Web.dll, or your favorite assembly, and recompile adding this CustomAttribute.  Compile your assembly and you are off and running.</p>
<p>Here&#039;s a view from Lutz Roeder&#039;s Reflector of my test app using an internal System.Web enum.</p>
<p><a href="http://bp3.blogger.com/_QvA8PCZOesc/Rd3TILXksmI/AAAAAAAAAAM/sXw5k1BlREY/s1600-h/test.GIF"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2007/02/access-to-net-system-dll-internal-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Services denial of service attacks &#8211; XmlTextReader</title>
		<link>http://www.casaba.com/blog/2007/02/web-services-denial-of-service-attacks-xmltextreader/</link>
		<comments>http://www.casaba.com/blog/2007/02/web-services-denial-of-service-attacks-xmltextreader/#comments</comments>
		<pubDate>Mon, 19 Feb 2007 18:10:00 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[DoS]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Most Web Services I look at are built using the .NET Framework and ASP.NET. Today we’re seeing more with ASP.NET’s AJAX extensions but that’s a different story. Many developers choose to implement SOAP and XML as part of their WS solution, and in doing so can inadvertently open the application server up to DoS issues. [...]]]></description>
			<content:encoded><![CDATA[<p>Most Web Services I look at are built using the .NET Framework and ASP.NET. Today we’re seeing more with ASP.NET’s AJAX extensions but that’s a different story. Many developers choose to implement SOAP and XML as part of their WS solution, and in doing so can inadvertently open the application server up to DoS issues.</p>
<p>First there’s XML. When developers choose to implement <strong>XmlTextReader </strong>or <strong>XmlReader </strong>from the .NET Framework, they need to understand the behaviors of these classes. MSDN documents this quite well. I will usually do a quick code review to find implementations of these objects, because the issues can be identified a little faster through code than through testing.</p>
<p><strong>XmlTextReader </strong>defaults to allowing external DTD’s to be specified. This leads to a whole enchilda of issues, and gives attackers a nice bit of control over the host server. Be sure to set the <em><strong>ProhibitDTD </strong></em>property equal to true. Furthermore, there’s no strict schema validation unless the developer implements one.SOAP is fine, but developers need to implement a custom SOAP extension to enforce strict schema validation. Otherwise it gets pretty easy for an attacker to abuse the WS by embedding things like:</p>
<ul>
<li>large payloads</li>
<li>large number of elements</li>
<li>nested elements</li>
<li>malformed data</li>
</ul>
<p>To name a few… Without strict validation, I’ve seen web services easily abused. For example, by sending a few large requests, it becomes trivial to consume memory on the host server which eventually leads to resource starvation. To learn more about implementing a custom SOAP Extension to tackle this problem, read the MSDN article:</p>
<p><a linkindex="49" href="http://msdn.microsoft.com/msdnmag/issues/03/07/XMLSchemaValidation/">http://msdn.microsoft.com/msdnmag/issues/03/07/XMLSchemaValidation/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2007/02/web-services-denial-of-service-attacks-xmltextreader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some good .Net debugging info</title>
		<link>http://www.casaba.com/blog/2007/02/some-good-net-debugging-info/</link>
		<comments>http://www.casaba.com/blog/2007/02/some-good-net-debugging-info/#comments</comments>
		<pubDate>Mon, 12 Feb 2007 08:00:00 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Visual Studio 2005/2008 debugging with sos.dll The blog seems to have gone cold, so copying here for good luck. http://blogs.msdn.com/vancem/archive/2006/09/05/742062.aspx Vance Morrison&#039;s Weblog Vance Morrison is currently an Architect on the .NET Runtime Team, specializing in performance issues with the runtime or managed code in general. Digging deeper into managed code with Visual Studio: Using [...]]]></description>
			<content:encoded><![CDATA[<p>Visual Studio 2005/2008 debugging with sos.dll<br />
The blog seems to have gone cold, so copying here for good luck.<br />
<a href="http://blogs.msdn.com/vancem/archive/2006/09/05/742062.aspx">http://blogs.msdn.com/vancem/archive/2006/09/05/742062.aspx</a></p>
<p>        <a id="ctl00___ctl00___ctl00_ctl00_bcr_bth___BlogTitle" class="headermaintitle" href="http://blogs.msdn.com/vancem/archive/2006/09/05/742062.aspx" bound="true">Vance Morrison&#039;s Weblog</a></p>
<p>        Vance Morrison is currently an Architect on the .NET Runtime Team, specializing in performance issues with the runtime or managed code in general.</p>
<p>                Digging deeper into managed code with Visual Studio: Using SOS </p>
<p>I have let my blog laps for too long. &nbsp;&nbsp; I am back to blogging. &nbsp; I realized reciently that we have simply not written down many interesting facts about how the runtime actually works.&nbsp; I want to fix this. &nbsp; Coming up in future blogs I am going to be doing a bit of a &#039;architectural overview&#039; which describe the differences between managed and unmanaged code, but before I do that I realized that I have not even finished a blog entry I started in March.</p>
<p>In my blog <a href="http://blogs.msdn.com/vancem/archive/2006/02/20/535807.aspx" bound="true">How to use Visual Studio to investigate code generation questions in managed code</a>, I talk about the how to configure Visual Studio so that you can actually look at optimized code in the debugger (which sadly is not as trivial as you would like), and showed how to look at the disassembly of managed code. &nbsp; &nbsp;Unfortunately manage code is hard to read without a guide, and so in this blog I will show you some very useful tips for reading managed assembly code.</p>
<p>In this blog entry I will show you the instructions ACTUALLY need to get executed to do something as simple as assigning a string to field of a class.  Note that I am assuming a familiarity with X86 assembly code. If you are the type who never wants to read assembly code, you should stop reading now, because most of this blog is a step-by-step explanation of it.</p>
<p>I have attached the file InspectingManageCode.zip, which contains a (trivial), project that I used for this example.&nbsp; You are STRONLY encouraged to open it (you can browse it the main file is Program.cs).&nbsp; Copy the files (simply drag the &#039;InspectingManagedCode directory inside the ZIP to a directory of your choosing), launch the InspecingManagedCode.sln file and run the example.&nbsp;  &nbsp;While the project is already set to build and run optimized code, you will still need to turn off ‘just my code’ and turn on JIT optimization as described in my previous blog to follow along.</p>
<p>The code in the attached example is pretty trivial.<br />
class Program<br />
{<br />
&nbsp; &nbsp; string myString;<br />
&nbsp; &nbsp; private Program()<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; myString = &#8220;foo&#8221;;<br />
&nbsp; &nbsp; }<br />
&nbsp; &nbsp; static void Main(string[] args)<br />
&nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; Program p = new Program();<br />
&nbsp; &nbsp;}<br />
}</p>
<p>If you were to follow the instructions in the <a href="http://blogs.msdn.com/vancem/archive/2006/02/20/535807.aspx" bound="true">previous blog </a>to see what code was generated for the body of ‘Main’ you would find the following code.</p>
<p>00000000&nbsp; push &nbsp; &nbsp; &nbsp;&nbsp;esi<br />
00000001&nbsp; mov &nbsp; &nbsp; &nbsp;&nbsp; ecx,9181F4h<br />
00000006&nbsp; call &nbsp; &nbsp; &nbsp;&nbsp;FFCB1264<br />
0000000b&nbsp; mov &nbsp; &nbsp; &nbsp;&nbsp; esi,eax<br />
0000000d&nbsp; mov &nbsp; &nbsp; &nbsp; &nbsp; eax,dword ptr ds:[0227307Ch]<br />
00000013&nbsp; lea &nbsp; &nbsp; &nbsp; &nbsp; edx,[esi+4]<br />
00000016&nbsp; call &nbsp; &nbsp; &nbsp;&nbsp; 79222B78<br />
0000001b&nbsp; pop &nbsp; &nbsp; &nbsp; &nbsp; esi<br />
0000001c&nbsp; ret</p>
<p>At first glance this code has little similarity to the source code: the original source has a call the constructor ‘Program’ and the assembly code has two calls to strange hex addresses.&nbsp; There are also references to magical numbers like 9181F4H and 0227307CH. &nbsp; In this case the disassembly has not proven to be very valuable. &nbsp;&nbsp; What can we do? &nbsp;&nbsp; </p>
<p>Sadly if we try to peer into these CALL instructions we cannot, the debugger comes back with the very unhelpful message ‘There is no code at the specified  location’. &nbsp; Actually Visual Studio is LIEING to you. There really is code there, but it simply will not show you.  I will show you techniques to get around this.</p>
<p>The key to unlocking mysteries of managed code, is a debug helper called SOS.DLL (it is a dll that is shipped with the runtime).  The DLL is what is called a ‘debugger extension’.  Basically it implements functionality that is useful in a debugger implementing<br />
                        functions that are useful for debugging code associated with it (in this case the<br />
                        runtime).&nbsp; &nbsp;Other bloggers have<br />
                        also commented on the use of this DLL (do a web search of SOS.DLL for more).</p>
<p>                    In Visual Studio, you load SOS.DLL by<br />
                        opening the immediate window (Ctrl-D I) and typing</p>
<p>                        .load SOS.dll</p>
<p>                    If you do this you may get the message</p>
<p>                        SOS not available while Managed only debugging.&nbsp;<br />
                        To load SOS, enable unmanaged debugging in your project properties.</p>
<p>                    This message is actually reasonably<br />
                        helpful.&nbsp; By stopping<br />
                        the debugger (Shift F5) going to Solution Explorer (Right hand pane), right clicking<br />
                        on the InspectingManagedCode project file, and selecting Properties, you will get<br />
                        the properties pane for the project.&nbsp;<br />
                        If you select the ‘Debug’ tab on the left side you will find 3 check boxes<br />
                        at the bottom, one of which is labeled ‘Enable unmanaged code debugging’&nbsp; If you check this, you put the debugger<br />
                        into a mode where it can debug both mananged and unmanaged code, (which means you<br />
                        can then use SOS.DLL). &nbsp;&nbsp;<br />
                        I have already done this on the InspectingManagedCode project, but you will<br />
                        have to repeat this any time you need to use SOS.<br />
                            &nbsp; (Sadly the instructions for setting the debugger mode are different<br />
                        for C++).&nbsp; &nbsp; Note that running<br />
                        the debugger to debug both managed and unmanaged code will slow the debugger down<br />
                        a bit (it loads the symbols for all the unmanaged DLLS), so you probably only want<br />
                        do this on projects like this one where you want to use SOS.DLL.&nbsp; </p>
<p>                    Now you should be able to set a breakpoint<br />
                        in Main(), run the program (F5), and go to the immediate window (CTRL-D I) and type</p>
<p>                        .load SOS.dll</p>
<p>                    And get the message</p>
<p>                        extension C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\sos.dll loaded.</p>
<p>                    If you are curious the SOS.DLL has reasonably<br />
                        good help, if you type the command</p>
<p>                        !Help</p>
<p>                    It will give you a list of commands,<br />
                        and you can get help on individual commands by specifying the name eg.</p>
<p>                        !Help u</p>
<p>                    It will give you help on the ‘u’ (unassembled)<br />
                        command. &nbsp;&nbsp;<br />
                        All SOS commands need to be prefixed by a ! character so that the Visual Studio<br />
                        Debugger knows that it is an SOS command and not an immediate value to be interpreted<br />
                        (the normal meaning of text typed in the immediate window).</p>
<p>                    The unassemble SOS command is the command<br />
                        we are interested in. &nbsp;<br />
                        It will disassemble a managed routine, but do a much better job than Visual Studio<br />
                        presently does. &nbsp;<br />
                        Unfortunately, we need the address of the routine we want disassemble, and Visual<br />
                        Studio goes to some length to hide this information.&nbsp;<br />
                        If you look at the disassembly for the code (CTRL-ALT-D), you will see that<br />
                        the address of the routine is never given, only the offset from the beginning of<br />
                        the method.&nbsp; </p>
<p>                    The way around this is to use the ‘Registers<br />
                        window’ (Ctrl-D R).&nbsp;<br />
                        I happen to like to put this window just above the immediate window and shrink it<br />
                        so that only the two lines that actually show values are showing.&nbsp;<br />
                                &nbsp;One of the registers is ‘EIP’ which stands for Extended Instruction<br />
                        Pointer’.&nbsp; It is<br />
                        the address of the current instruction pointer.<br />
                            &nbsp; In my particular invokaction EIP has the value of 00DE0071, so<br />
                        I can do the command</p>
<p>                        !u 00DE0071</p>
<p>                    Which will disassemble the ENTIRE routine<br />
                        that the address 00DE0071 lives in.&nbsp;<br />
                        I like to right click in the immediate window and select ‘Clear All’ before<br />
                        I do this so the only thing in that window is the disassembly. &nbsp; On my machine I get the result</p>
<p>                        Normal JIT generated code</p>
<p>                        Program.Main(System.String[])</p>
<p>                        Begin 00de0070, size 1d</p>
<p>                        00DE0070 56 &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; push<br />
                                &nbsp; &nbsp;&nbsp; &nbsp;<br />
                                esi</p>
<p>                        &gt;&gt;&gt; 00DE0071 B904309100<br />
                            &nbsp; &nbsp; &nbsp; mov<br />
                                &nbsp; &nbsp; &nbsp; &nbsp; ecx,913004h</p>
<p>                        00DE0076 E8A11FB2FF &nbsp; &nbsp;<br />
                            &nbsp; call &nbsp; &nbsp;<br />
                                &nbsp;&nbsp; 0090201C (JitHelp: CORINFO_HELP_NEWSFAST)</p>
<p>                        00DE007B 8BF0 &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; &nbsp; mov<br />
                                &nbsp; &nbsp; &nbsp; &nbsp; esi,eax</p>
<p>                        00DE007D 8B053C302B02 &nbsp; &nbsp;<br />
                        mov &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; eax,dword ptr ds:[022B303Ch]</p>
<p>                        00DE0083 8D5604 &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; lea &nbsp;<br />
                                &nbsp; &nbsp; &nbsp; edx,[esi+4]</p>
<p>                        00DE0086 E8A5380979 &nbsp; &nbsp;<br />
                            &nbsp; call &nbsp; &nbsp;<br />
                                &nbsp;&nbsp; 79E73930</p>
<p>                        00DE008B 5E &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; pop<br />
                                &nbsp; &nbsp; &nbsp; &nbsp; esi</p>
<p>                        00DE008C C3 &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; ret</p>
<p>                    It is not unlike the version the Visual<br />
                        Studio produced, but there are differences</p>
<p>                            1. &nbsp; &nbsp;&nbsp;<br />
                            You will note that the ‘call instruction<br />
                                is annoted with ‘JitHelp: CORINFO_HELP_NEWFAST’, which makes it at least a bit clearer<br />
                                that this helper is used to create a New object (and is the fast version, we have<br />
                                many variations).</p>
<p>                            2. &nbsp; &nbsp;&nbsp;<br />
                            It printed the whole routine that 00DE0071<br />
                                lives in and prints a &gt;&gt;&gt;&nbsp;<br />
                                on the instruction corresponding to the 00DE0071 address.&nbsp; </p>
<p>                            3. &nbsp; &nbsp;&nbsp;<br />
                            While it did not print the name for<br />
                                the ‘call 79E73930’, notice that the HEX value is different than the value in the<br />
                                Visual Studio Disassembly (79222B78).&nbsp;<br />
                                The value in the&nbsp;<br />
                                VS disassembly is simply WRONG (it is bug no one bothered to fix).&nbsp; </p>
<p>                    So let’s take a look at the first two<br />
                        instructions.</p>
<p>                        00DE0071 B904309100 &nbsp; &nbsp;<br />
                            &nbsp; mov &nbsp; &nbsp;<br />
                                &nbsp; &nbsp; ecx,913004h</p>
<p>                        00DE0076 E8A11FB2FF &nbsp; &nbsp;<br />
                            &nbsp; call &nbsp; &nbsp;<br />
                                &nbsp;&nbsp; 0090201C (JitHelp: CORINFO_HELP_NEWSFAST)</p>
<p>                    I mentioned that this helper call creates<br />
                        a new object from the GC heap. To do so it needs to know that type of the object<br />
                        to be created. This is what the magic number 913004 does.&nbsp; Internally in the runtime types are<br />
                        described by a structure called a MethodTable, and 913004 is the address of the<br />
                        MethodTable to create.&nbsp;<br />
                        We can find out what type 913004 corresponds to by using the !DumpMT (dump Method<br />
                        Table) SOS command.&nbsp; </p>
<p>                        !DumpMT 913004h</p>
<p>                    Produces the output</p>
<p>                        EClass: 00911254</p>
<p>                        Module: 00912c14</p>
<p>                    Name: Program</p>
<p>                        mdToken: 02000002&nbsp;<br />
                        (C:\Documents and Settings\vancem\My Documents\Visual Studio 2005\Projects\InspectingManagedCode\bin\Release\InspectingManagedCode.exe)</p>
<p>                        BaseSize: 0xc</p>
<p>                        ComponentSize: 0&#215;0</p>
<p>                        Number of IFaces in IFaceMap: 0</p>
<p>                        Slots in VTable: 6</p>
<p>                    The only output of this that is interesting<br />
                        at this point is the ‘Name’ field, which as you can see, indicates that 913004 cooresponds<br />
                        to the ‘Program’ type. &nbsp;<br />
                        Thus these first two instructions create a program object. &nbsp; This program object comes back from<br />
                        the helper with all its fields zeroed, so the next instructions in the program are<br />
                        the body of the constructor (the Program() constructor has been inlined into the<br />
                        body of Main().&nbsp; </p>
<p>                    The next instructions</p>
<p>                        00DE007B 8BF0 &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; &nbsp; mov<br />
                                &nbsp; &nbsp; &nbsp; &nbsp; esi,eax</p>
<p>                        00DE007D 8B053C302B02 &nbsp; &nbsp;<br />
                        mov &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; eax,dword ptr ds:[022B303Ch]</p>
<p>                        00DE0083 8D5604 &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; lea &nbsp;<br />
                                &nbsp; &nbsp; &nbsp; edx,[esi+4]</p>
<p>                        00DE0086 E8A5380979 &nbsp; &nbsp;<br />
                            &nbsp; call &nbsp; &nbsp;<br />
                                &nbsp;&nbsp; 79E73930</p>
<p>                    Basically implement the statement ‘myString<br />
                            = &#8220;foo&#8221;’ The helper returns a pointer into the<br />
                                uninitialized object in the EAX register.&nbsp;<br />
                                The mov saves this into the ESI register.&nbsp;<br />
                                EAX is then loaded with what is at the address 022B303Ch.&nbsp; This happens to be the string “foo”<br />
                                (more on how it go there in a later blog).<br />
                                    &nbsp; You can confirm this by going to the disassembly code, setting<br />
                                a breakpoing right after the eax,dword ptr ds:[022B303Ch] instruction and looking<br />
                                at the value of the EAX register in the ‘registers’ window.&nbsp;<br />
                                        &nbsp;In my example it happens to be the value 012B1D44. &nbsp; You can then use the command</p>
<p>                        !DumpObj 012B1D44</p>
<p>                    Which will dump the managed object at<br />
                        this address.&nbsp; This<br />
                        will print .</p>
<p>                        DumpObj 012B1D44</p>
<p>                    Name: System.String</p>
<p>                        MethodTable: 790fa3e0</p>
<p>                        EEClass: 790fa340</p>
<p>                        Size: 24(0&#215;18) bytes</p>
<p>                        &nbsp;(C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll)</p>
<p>                    String: foo</p>
<p>                        Fields:</p>
<p>                        &nbsp; &nbsp; &nbsp;<br />
                        MT &nbsp;&nbsp; Field &nbsp; Offset &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
                            Type VT &nbsp; &nbsp;<br />
                        Attr &nbsp;&nbsp; Value<br />
                        Name</p>
<p>                        790fed1c&nbsp; 4000096 &nbsp; &nbsp; &nbsp;&nbsp;<br />
                        4 &nbsp; &nbsp; &nbsp; &nbsp;<br />
                        System.Int32&nbsp; 0<br />
                        instance &nbsp; &nbsp; &nbsp;&nbsp;<br />
                        4 m_arrayLength</p>
<p>                        790fed1c&nbsp; 4000097 &nbsp; &nbsp; &nbsp;&nbsp;<br />
                        8 &nbsp; &nbsp; &nbsp; &nbsp;<br />
                        System.Int32&nbsp; 0<br />
                        instance &nbsp; &nbsp; &nbsp;&nbsp;<br />
                        3 m_stringLength</p>
<p>                        790fbefc&nbsp; 4000098 &nbsp; &nbsp; &nbsp;&nbsp;<br />
                        c &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
                        System.Char&nbsp;<br />
                        0 instance &nbsp; &nbsp; &nbsp;<br />
                        66 m_firstChar</p>
<p>                        790fa3e0&nbsp; 4000099 &nbsp; &nbsp; &nbsp; 10 &nbsp; &nbsp; &nbsp;&nbsp;<br />
                        System.String&nbsp; 0 &nbsp; shared &nbsp; static Empty</p>
<p>                        &nbsp; &nbsp; &gt;&gt;<br />
                        Domain:Value&nbsp; 0014c550:790d6584<br />
                        &lt;&lt;</p>
<p>                        79124670&nbsp; 400009a &nbsp; &nbsp; &nbsp; 14 &nbsp; &nbsp; &nbsp;&nbsp;<br />
                        System.Char[]&nbsp; 0 &nbsp; shared &nbsp; static WhitespaceChars</p>
<p>                        &nbsp; &nbsp; &gt;&gt;<br />
                        Domain:Value&nbsp; 0014c550:012b186c<br />
                        &lt;&lt; Basically</p>
<p>                            &nbsp;Again, most of the output is uninteresting at this point, except<br />
                        the Name field (which says its a string), and the ‘String’ field (which shows the<br />
                        string value is ‘foo’).&nbsp;<br />
                        So we have confirmed that this instruction loads up the address of the ‘foo’ string<br />
                        into the EAX register.&nbsp;<br />
                        &nbsp;What is left is</p>
<p>                        00DE0083 8D5604 &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; lea &nbsp;<br />
                                &nbsp; &nbsp; &nbsp; edx,[esi+4]</p>
<p>                        00DE0086 E8A5380979 &nbsp; &nbsp;<br />
                            &nbsp; call &nbsp; &nbsp;<br />
                                &nbsp;&nbsp; 79E73930</p>
<p>                    The first instruction ‘LEA’ may not<br />
                        be familiar to you.&nbsp;<br />
                        It is Load Effective Address (LEA).&nbsp;<br />
                        Basically it works just like a MOV instruction, but instead of moving what<br />
                        was AT the memory specified, it loads the ADDRESS of the memory. &nbsp; Another way of looking at this is to<br />
                        imagine a MOV instruction with the [] dropped (which represent memory fetching).&nbsp; Thus</p>
<p>                        00DE0083 8D5604 &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; lea &nbsp;<br />
                                &nbsp; &nbsp; &nbsp; edx,[esi+4]</p>
<p>                    Can be thought of as</p>
<p>                        00DE0083 8D5604 &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; mov &nbsp;<br />
                                &nbsp; &nbsp; &nbsp; edx, esi+4</p>
<p>                    That is it adds 4 to ESI and places<br />
                        it in EDX. &nbsp; Now<br />
                        remember ESI points at our newly created ‘Program’ object. &nbsp; We could find out all the fields of<br />
                        this object by dumping it,&nbsp;<br />
                        In my debugger ESI has the value of 012B1D5C so I can do</p>
<p>                        !DumpObj 012B1D5C</p>
<p>                    And get</p>
<p>                    Name: Program</p>
<p>                        MethodTable: 00913004</p>
<p>                        EEClass: 00911254</p>
<p>                    Size: 12(0xc) bytes</p>
<p>                        &nbsp;(C:\Documents and<br />
                        Settings\vancem\My Documents\Visual Studio 2005\Projects\InspectingManagedCode\bin\Release\InspectingManagedCode.exe)</p>
<p>                        Fields:</p>
<p>                        &nbsp; &nbsp; &nbsp;<br />
                        MT &nbsp;&nbsp; Field &nbsp; Offset &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
                            Type VT &nbsp; &nbsp;<br />
                        Attr &nbsp;&nbsp; Value<br />
                        Name</p>
<p>                        790fa3e0&nbsp; 4000001 &nbsp; &nbsp; &nbsp;<br />
                                    &nbsp;4 &nbsp; &nbsp;<br />
                                        &nbsp;&nbsp; System.String&nbsp;<br />
                        0 instance 00000000 myString</p>
<p>                    Which tells us that ESI points at a<br />
                        ‘Program’ object and that the total size of the object is 12 (more on that in a<br />
                        later blog), and that at offset 4 there is a field calls ‘myString’ of type System.String<br />
                        that currently has the value of 0 (null).<br />
                            &nbsp; </p>
<p>                    So now we can make a pretty good guess<br />
                        that the LEA instruction is setting EDX to the address of the ‘myString’ field of<br />
                        the program object.&nbsp;<br />
                        EAX has been set to the ‘Foo’ String, and next comes the mysterious</p>
<p>                        00DE0086 E8A5380979 &nbsp; &nbsp;<br />
                            &nbsp; call &nbsp; &nbsp;<br />
                                &nbsp;&nbsp; 79E73930</p>
<p>                    Ideally SOS would have annotated this<br />
                        helper. &nbsp; It is<br />
                        what we call a ‘WriteBarrier’. &nbsp;<br />
                        More on exactly what a write barrier is later,<br />
                            &nbsp;but for now the important thing to know is that ALL updates to<br />
                        OBJECT REFERENCES that live in the GC heap need to be done by calling a write barrier<br />
                        helper. &nbsp;&nbsp;<br />
                        Since the Program object lives in the heap, and we are updating a object reference<br />
                        pointer inside it we need to use the write barrier.<br />
                            &nbsp; </p>
<p>                    The runtime actually has many write<br />
                        barriers.&nbsp; All the<br />
                        write barriers have an unusual calling convention.&nbsp;<br />
                        They all take the address to be updated in the EDX register. &nbsp; Then depending on the write barrier,<br />
                        they take the value to update in some other register (this particular write barrier<br />
                        is the most commonly used, and takes its argument in the EAX register). &nbsp;&nbsp; Logically all the write barrier<br />
                        does is do (*EDX = EAX)&nbsp;<br />
                        (that is update what EDX points at to be the value in EAX).</p>
<p>                    That is about it for this example&nbsp; The only instructions<br />
                        &nbsp;we did not cover<br />
                        are the PUSH ESI, and POP ESI at the beginning and end of the routine.&nbsp; As anyone who deals with assembly code<br />
                        this is simply saving and restoring ESI since we used it in the routine itself.&nbsp; </p>
<p>                    To recap here are the instructions that<br />
                        actually got executed in the ‘Main’ program and what they do.&nbsp; </p>
<p>                    push &nbsp; &nbsp;<br />
                        &nbsp;&nbsp; esi &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; // save ESI<br />
                        mov &nbsp; &nbsp; &nbsp; &nbsp; ecx,913004h<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
                        // ECX = MethodTable(Program)<br />
                        call &nbsp; &nbsp; &nbsp;&nbsp; 0090201C<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp;&nbsp; // EAX = New Object (Program)<br />
                        mov &nbsp; &nbsp; &nbsp; &nbsp; esi,eax<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; // ESI = this (new object)<br />
                        mov &nbsp; &nbsp; &nbsp; &nbsp; eax,dword ptr ds:[022B303Ch] &nbsp; &nbsp;&nbsp; // EAX = “foo”<br />
                        lea &nbsp; &nbsp; &nbsp; &nbsp; edx,[esi+4]<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; // EDX = &amp;this.myString<br />
                        call &nbsp; &nbsp; &nbsp;&nbsp; 79E73930<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp;&nbsp; // this.myString = EAX (“foo”)<br />
                        pop &nbsp; &nbsp; &nbsp; &nbsp; esi<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // restore ESI<br />
                        ret &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
                            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
                        // return.</p>
<p>                        &nbsp;</p>
<p>                    We just understood very deaply EXACTLY<br />
                        what happens when a particular piece of managed code executes.&nbsp;<br />
                                &nbsp;Hopefully that wasn’t so bad.<br />
                                    &nbsp; &nbsp; Next time we will dig a bit into this WriteBarrier<br />
                        is and exactly what it does (how expensive is it?).<br />
                            &nbsp; We will also dig into exactly what went on inside the ‘New’ helper.&nbsp; &nbsp; In later blogs I will go into<br />
                        how exactly other run time features get converted to native code.&nbsp; </p>
<p>                        &nbsp;</p>
<p>                    I hope you are enjoying this peek under<br />
                        the hood of the .NET Runtime.&nbsp;</p>
<p>                    &nbsp;</p>
<p>                Published Tuesday, September 05, 2006 7:55 PM by <a id="ctl00___ctl00___ctl00_ctl00_bcr_ctl00___Entry___AuthorLink" href="/user/Profile.aspx?UserID=3800" bound="true">vancem</a></p>
<p>                        Filed under: <a href="/vancem/archive/tags/Tools/default.aspx" bound="true" rel="tag">Tools</a></p>
<p>                Attachment(s): <a id="ctl00___ctl00___ctl00_ctl00_bcr_ctl00___Entry___Attachment___DownLoadLink" href="/vancem/attachment/742062.ashx" bound="true">InspectingManagedCode.zip</a></p>
<p>                Comments</p>
<p>                            &nbsp;</p>
<p>                                <a id="ctl00___ctl00___ctl00_ctl00_bcr_ctl00___Comments___Comments_ctl01_NameLink" href="/utility/Redirect.aspx?U=http%3a%2f%2fbarrkel.blogspot.com%2f" bound="true" title="barrkel">barrkel</a> said:</p>
<p>                                Great info! Thanks.</p>
<p>                                BTW, when using windbg + sos to debug, what breakpoint (native: bp / bu) is best<br />
                                to set in order to use managed breakpoints (thus both !name2ee and !bpmd probably<br />
                                needed)? With a breakpoint on loading of mscorwks or calling of various CLR functions,<br />
                                when is the CLR booted up enough so that !name2ee etc. can work?</p>
<p>                                September 6, 2006 4:14 AM</p>
<p>                            &nbsp;</p>
<p>                                <a id="ctl00___ctl00___ctl00_ctl00_bcr_ctl00___Comments___Comments_ctl02_NameLink" href="/utility/Redirect.aspx?U=http%3a%2f%2fblogs.msdn.com%2fvancem" bound="true" title="vancem">vancem</a> said:</p>
<p>                                The subject of using SOS in windbg will be the subject of a future blog, however,<br />
                                I can quickly answer your question. &nbsp; &nbsp;</p>
<p>                                The !bpmd (Breakpoint MethodDescriptor), is a command that will set a breakpoint<br />
                                on a managed method by name. &nbsp; For example in the example the command</p>
<p>                                &nbsp; &nbsp;!bpmd &nbsp;InspectingManagedCode.exe Program.Main</p>
<p>                                Will set a breakpoint in the ‘Main’ routine of the example program in the ZIP file.<br />
                                &nbsp; Note that UNLIKE the !name2ee SOS command (which looks up a method, or class<br />
                                by name), the method being referenced in the !BPMD command does NOT need to be loaded<br />
                                to work (it sets a ‘deferred’ breakpoint).</p>
<p>                                &nbsp;</p>
<p>                                However to use ANY SOS command, you need to load SOS, and it turns out that SOS<br />
                                needs the .NET runtime dlls ‘mscorwks.dll’ to be loaded before it can load. &nbsp;<br />
                                There are a variety of techniques you can use. &nbsp; &nbsp;The one I use is</p>
<p>                                &nbsp; &nbsp;bu mscorwks!EEStartup</p>
<p>                                This sets a breakpoint at the ‘EEStartup’ method in the .NET runtime DLL ‘mscorwks.<br />
                                &nbsp; When this breakpoint hits you can do the command</p>
<p>                                &nbsp; &nbsp;.loadby sos mscorwks</p>
<p>                                Which tells windbg to load the sos.dll by searching the in the directory where mscorwks<br />
                                lives. &nbsp;Once loaded you can execute a ! bpmd &nbsp;command.</p>
<p>                                Finally if you need !name2ee to work and the module is not yet loaded, you should<br />
                                set a breakpoint (using !bpmd &nbsp;command), in the module of interest, run to<br />
                                that breakpoint (now it is loaded), and then do the !name2ee command. &nbsp;</p>
<p>                                September 6, 2006 12:46 PM</p>
<p>            &nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2007/02/some-good-net-debugging-info/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>To fuzz or not to fuzz web services…</title>
		<link>http://www.casaba.com/blog/2007/01/to-fuzz-or-not-to-fuzz-web-services%e2%80%a6/</link>
		<comments>http://www.casaba.com/blog/2007/01/to-fuzz-or-not-to-fuzz-web-services%e2%80%a6/#comments</comments>
		<pubDate>Sat, 13 Jan 2007 08:00:00 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[fuzzing]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Is it worth the time to run input fuzzing tests against web services? When engaging a client for a security review I’m often the one to pose this question. Sure, why not… right? Well honestly there’s a more precise way to answer this question. First we really need to understand the goals of the security [...]]]></description>
			<content:encoded><![CDATA[<p>Is it worth the time to run input fuzzing tests against web services? When engaging a client for a security review I’m often the one to pose this question. Sure, <strong>why not</strong>… right? Well honestly there’s a more precise way to answer this question. First we really need to understand the <strong>goals </strong>of the security review, so a few questions are in order.</p>
<ol>
<li>Has <strong>threat modeling </strong>been done or is this my job?</li>
<li>How much <strong>time and budget </strong>do we have for a security review?</li>
<li>How complex are the web services? e.g. how many parameters do they take and in what format</li>
<li>Are the web services written in managed code?</li>
<li>Is user-input passed to unmanaged code?</li>
</ol>
<p>Let’s take these answers from a common scenario:</p>
<ol>
<li>Yes threat modeling is complete</li>
<li>We have about 2 or 3 weeks that you can use to test</li>
<li>Very complex, they use WS-Security, take hundreds of parameters, some encrypted, using custom formats, SOAP, as well as embedded XML blobs</li>
<li>Yes, they’re written in C# using the .NET Framework</li>
<li>Some specific elements of user-input are handled by unmanaged code modules</li>
</ol>
<p>Some things not obvious in these questions are:</p>
<ul>
<li>that the client is highly interested in finding Denial of Service (<strong>DoS</strong>) issues</li>
<li>that millions of people will be using these Web Services whether they know it or not</li>
<li>that no input fuzzing has been done to date</li>
</ul>
<p>With 2-3 weeks we could get a lot done in a security review focused just one the web services. It’s becoming clear that fuzzing input would be a <strong>worthwhile </strong>venture. We’ll likely turn up some DoS issues, possibly some unmanaged code issues as well. Since we have a decent timeframe, we’ll be checking for the following issues, not all of which fuzzing is good for:</p>
<ul>
<li>elevation of privilege (<strong>EoP</strong>)</li>
<li><strong>repurposing </strong>attacks</li>
<li>cross-site scripting (yes, even web services in some cases)</li>
<li>information disclosure</li>
<li>session replay</li>
<li>SQL Injection</li>
<li>DTD attacks</li>
<li>XML validation</li>
<li>script injection</li>
<li>repudiation</li>
<li>denial of service</li>
<li>buffer overrun</li>
</ul>
<p>Fuzzing will help with some of these, so at this point the answer is yes, let’s do it. We’ll also be doing some <strong>code review</strong>, which is great for identifying issues such as DoS, XML validation, and DTD attacks quickly. And we’ll be studying the specs and architecture along the way to keep a clear <strong>understanding </strong>of the system and help identify repurposing attacks, which will be tested for confirmation.</p>
<p>Ok let’s go!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2007/01/to-fuzz-or-not-to-fuzz-web-services%e2%80%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Explorer whitespace-as-comment hack to bypass input filters</title>
		<link>http://www.casaba.com/blog/2007/01/internet-explorer-whitespace-as-comment-hack-to-bypass-input-filters/</link>
		<comments>http://www.casaba.com/blog/2007/01/internet-explorer-whitespace-as-comment-hack-to-bypass-input-filters/#comments</comments>
		<pubDate>Thu, 11 Jan 2007 08:00:00 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[When testing for XSS (cross-site scripting) issues, you often need to bypass filters and perform different sorts of encodings and other trickery. To be a good tester you also need to know how the browsers you’re concerned with behave differently. In Internet Explorer 6.0 there’s a behavior that’s allowed seemingly impassible input validation filters to [...]]]></description>
			<content:encoded><![CDATA[<p>When testing for XSS (cross-site scripting) issues, you often need to bypass filters and perform different sorts of encodings and other trickery. To be a good tester you also need to know how the browsers you’re concerned with behave differently. In Internet Explorer 6.0 there’s a behavior that’s allowed seemingly impassible input validation filters to be bypassed. Note that the issue is not the browser’s fault, it’s the fault of an improperly designed input validation mechanism on the server. Okay to illustrate the point.</p>
<p>You’re testing a web app that has an input field. Some script tags are allowed but &lt;img src=”something”&gt; is not. By replacing the whitespace with a comment, your code is accepted. When returned to the browser, IE 6.x, the comment is interpreted as whitespace and the code is executed fine. Test it out:</p>
<p>	<code>//Start HTML<br />
	&lt;html&gt;<br />
	&lt;body&gt;<br />
	&lt;img/*comment*/src=”javascript:alert(’img tag’)”&gt;<br />
	&lt;/body&gt;<br />
	&lt;/html&gt;<br />
	//End HTML</code></p>
<p>This trick can be useful for more than just bypassing filters…</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2007/01/internet-explorer-whitespace-as-comment-hack-to-bypass-input-filters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS 6.0 %uNNNN unicode notation in the URL</title>
		<link>http://www.casaba.com/blog/2007/01/iis-6-0-unnnn-unicode-notation-in-the-url/</link>
		<comments>http://www.casaba.com/blog/2007/01/iis-6-0-unnnn-unicode-notation-in-the-url/#comments</comments>
		<pubDate>Wed, 10 Jan 2007 08:00:00 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I do a lot of web app pen testing. Character encoding is always an important part of many input validation test cases. Some people don’t realize that IIS takes straight unicode notation in the URL by default. So you can pass in unicode characters just by typing the proper notation in ASCII on the URL. [...]]]></description>
			<content:encoded><![CDATA[<p>I do a lot of web app pen testing. Character encoding is always an important part of many input validation test cases. Some people don’t realize that IIS takes straight unicode notation in the URL by default. So you can pass in unicode characters just by typing the proper notation in ASCII on the URL. For example the following URL’s encode an “s”, a double quote, the Cyrillic small letter “о” which looks a lot like an “o”.</p>
<p><a href="http://somesite.iis/query=unicode-character-%u0073" title="http://somesite.iis/query=unicode-character-%u0073">http://somesite.iis/query=unicode-character-%u0073</a><br />
<a href="http://somesite.iis/query=unicode-character-%u0022" title="http://somesite.iis/query=unicode-character-%u0022">http://somesite.iis/query=unicode-character-%u0022</a><br />
<a href="http://somesite.iis/query=unicode-character-%u043E" title="http://somesite.iis/query=unicode-character-%u043E">http://somesite.iis/query=unicode-character-%u043E</a></p>
<p>This is controlled by the following registry key and is enabled by default:</p>
<p><strong>HKLM\System\CurrentControlSet\Services\HTTP\Parameters</strong><em>\PercentUAllowed </em></p>
<p>A Boolean value. If non-zero, Http.sys accepts the %uNNNN notation in request URLs.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2007/01/iis-6-0-unnnn-unicode-notation-in-the-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSIDL &#8211; Shell constants, enumerations, and flags</title>
		<link>http://www.casaba.com/blog/2006/12/csidl-shell-constants-enumerations-and-flags/</link>
		<comments>http://www.casaba.com/blog/2006/12/csidl-shell-constants-enumerations-and-flags/#comments</comments>
		<pubDate>Tue, 26 Dec 2006 08:00:00 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[CSIDL]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[I worked on an application which had a couple of requirements: Allow users access to their local drive content within a defined scope (e.g. either the entire drive, or the My Documents folder only) Prevent users from accessing files outside of the defined scope. So they shouldn’t be able to access network drives, USB keys, [...]]]></description>
			<content:encoded><![CDATA[<p>I worked on an application which had a couple of requirements:</p>
<ol>
<li>Allow users access to their local drive content within a defined <strong>scope </strong>(e.g. either the entire drive, or the My Documents folder only)</li>
<li>Prevent users from accessing files outside of the defined <strong>scope</strong>. So they shouldn’t be able to access network drives, USB keys, etc.</li>
</ol>
<p>To acheive this, the shell constants were used, as defined in the Windows SDK.<br />
<a set="yes" linkindex="62" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp" title="CSIDL">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp </a></p>
<p>This worked well, and after we looked at the code we actually ran a battery of tests to confirm. So for example we tried the following types of canonicalizations:</p>
<ul>
<li>\\host\share\file</li>
<li>\\?\folder\file</li>
<li>\\10.10.10.10\share\file</li>
<li>\\.\folder\file</li>
</ul>
<p>We kept going, and tried breaking out of the local scope as well:</p>
<ul>
<li>..\..\..\..\boot.ini</li>
<li>../../../../boot.ini</li>
<li>..%2fboot.ini</li>
</ul>
<p>And all that sort of stuff. Using the CSIDL constants proved successful, and we could see this through debugging. Everything we entered was merely relative to the constant value, there was no way to change it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2006/12/csidl-shell-constants-enumerations-and-flags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ViewStateUserKey to prevent XSRF (CSRF or cross-site request forgery) in ASP.NET</title>
		<link>http://www.casaba.com/blog/2006/09/viewstateuserkey-to-prevent-xsrf-csrf-or-cross-site-request-forgery-in-asp-net/</link>
		<comments>http://www.casaba.com/blog/2006/09/viewstateuserkey-to-prevent-xsrf-csrf-or-cross-site-request-forgery-in-asp-net/#comments</comments>
		<pubDate>Sat, 30 Sep 2006 07:00:00 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Security Testing]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[CSRF]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[ViewStateUserKey has been around for many years and is an easy solution to prevent the infamous XSRF or cross-site request forgery class of attack. It’s documented: http://msdn2.microsoft.com/en-us/library/system.web.ui.page.viewstateuserkey.aspx ViewStateUserKey mitigates XSRF by including a unique identifier in the user’s request. This protection mechanism has been available for many years when Microsoft identified the one-click attack, now [...]]]></description>
			<content:encoded><![CDATA[<p>ViewStateUserKey has been around for many years and is an easy solution to prevent the infamous XSRF or cross-site request forgery class of attack.</p>
<p>It’s documented:</p>
<p><a set="yes" linkindex="68" href="http://msdn2.microsoft.com/en-us/library/system.web.ui.page.viewstateuserkey.aspx" title="XSRF mitigation">http://msdn2.microsoft.com/en-us/library/system.web.ui.page.viewstateuserkey.aspx</a></p>
<p>ViewStateUserKey mitigates XSRF by including a unique identifier in the user’s request.</p>
<p>This protection mechanism has been available for many years when Microsoft identified the one-click attack, now more commonly referred to as XSRF.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2006/09/viewstateuserkey-to-prevent-xsrf-csrf-or-cross-site-request-forgery-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hunting Security Bugs</title>
		<link>http://www.casaba.com/blog/2006/06/hunting-security-bugs/</link>
		<comments>http://www.casaba.com/blog/2006/06/hunting-security-bugs/#comments</comments>
		<pubDate>Fri, 09 Jun 2006 17:48:01 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=291</guid>
		<description><![CDATA[Chris Weber is technical editor of &#8220;Hunting Security Bugs&#8221; authored by the Microsoft Office Security Test Team.]]></description>
			<content:encoded><![CDATA[<p>Chris Weber is technical editor of &#8220;<a href="http://www.amazon.com/gp/product/073562187X?ie=UTF8&#038;tag=ancicoin-20&#038;linkCode=as2&#038;camp=211189&#038;creative=374929&#038;creativeASIN=073562187X" title="Hunting Security Bugs">Hunting Security Bugs</a>&#8221; authored by the Microsoft Office Security Test Team.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2006/06/hunting-security-bugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hacking Exposed Web Applications</title>
		<link>http://www.casaba.com/blog/2006/06/hacking-exposed-web-applications/</link>
		<comments>http://www.casaba.com/blog/2006/06/hacking-exposed-web-applications/#comments</comments>
		<pubDate>Mon, 05 Jun 2006 17:50:13 +0000</pubDate>
		<dc:creator>Chris Weber</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.casaba.com/blog/?p=293</guid>
		<description><![CDATA[Samuel Bucholtz is contributing author of &#8220;Hacking Exposed Web Applications, Second Edition&#8220;]]></description>
			<content:encoded><![CDATA[<p>Samuel Bucholtz is contributing author of &#8220;<a href="http://www.amazon.com/gp/product/0072262990?ie=UTF8&#038;tag=ancicoin-20&#038;linkCode=as2&#038;camp=211189&#038;creative=374929&#038;creativeASIN=0072262990" title="Hacking Exposed Web Applications, Second Edition">Hacking Exposed Web Applications, Second Edition</a>&#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.casaba.com/blog/2006/06/hacking-exposed-web-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

