<?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 &#187; Security Testing</title>
	<atom:link href="http://www.casaba.com/blog/category/security-testing/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>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>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>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 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('p171code3'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1713"><td class="code" id="p171code3"><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('p171code4'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1714"><td class="code" id="p171code4"><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>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 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>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>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>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>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>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>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>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>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>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>
	</channel>
</rss>

