<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
  <channel>
    <title><![CDATA[[SecurityRatty] tag: functions]]></title>
    <link>http://securityratty.com/tag/functions</link>
    <description></description>
    <pubDate>Fri, 17 Oct 2008 07:38:02 +0000</pubDate>
    <generator>iRatty Engine</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <item>
      <title><![CDATA[Anti-Debugging Series - Part I]]></title>
      <link>http://securityratty.com/article/5dc5d012cfad6c070272eeb8f4c0dc2b</link>
      <guid>http://securityratty.com/article/5dc5d012cfad6c070272eeb8f4c0dc2b</guid>
      <description><![CDATA[For those that dont 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...]]></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>
      <pubDate>Tue, 02 Dec 2008 17:56:25 +0000</pubDate>
      <category domain="http://securityratty.com/tag/process execution breaks">process execution breaks</category>
      <category domain="http://securityratty.com/tag/execution">execution</category>
      <category domain="http://securityratty.com/tag/process">process</category>
      <category domain="http://securityratty.com/tag/methods query process">methods query process</category>
      <category domain="http://securityratty.com/tag/hardware breakpoint">hardware breakpoint</category>
      <category domain="http://securityratty.com/tag/hardware">hardware</category>
      <category domain="http://securityratty.com/tag/process information">process information</category>
      <category domain="http://securityratty.com/tag/target process">target process</category>
      <category domain="http://securityratty.com/tag/methods">methods</category>
      <source url="http://www.veracode.com/blog/2008/12/anti-debugging-series-part-i/">Anti-Debugging Series - Part I</source>
    </item>
    <item>
      <title><![CDATA[America's Next Top Hash Function Begins]]></title>
      <link>http://securityratty.com/article/782d55dd167bb0c5193cd7724d7e2313</link>
      <guid>http://securityratty.com/article/782d55dd167bb0c5193cd7724d7e2313</guid>
      <description><![CDATA[You might not have realized it, but the next great battle of cryptography began this month. It's not a political battle over export laws or key escrow or NSA eavesdropping, but an academic battle over...]]></description>
      <content:encoded><![CDATA[<p>You might not have realized it, but the next great battle of cryptography began this month. It's not a political battle over export laws or key escrow or NSA eavesdropping, but an academic battle over who gets to be the creator of the next hash standard.</p>

<p>Hash functions are the most commonly used cryptographic primitive, and the most poorly understood. You can think of them as fingerprint functions: They take an arbitrary long data stream and return a fixed length, and effectively unique, string. The security comes from the fact that while it's easy to generate the fingerprint from a file, it's infeasible to go the other way and generate a file given a fingerprint. </p>

<p>Originally created to make digital signatures more efficient, hashes are now used to secure the very fundamentals of our information infrastructure: in password logins, secure web connections, encryption key management, virus and malware scanning, and almost every cryptographic protocol in current use. Without cryptographic hash functions, the internet would simply not work. At the same time, there isn't a good theory of hash functions. Unlike encryption algorithms, there are no secret keys involved; this makes it harder to mathematically define exactly what hash functions are.
</p>

<p>
The National Institute of Standards and Technology, NIST, is <a href="http://csrc.nist.gov/groups/ST/hash/sha-3/index.html">holding a competition</a> to replace the SHA family of hash functions. "SHA" stands for "Secure Hash Algorithm." It was developed by the NSA in 1993 to replace the commercial MD4 and MD5 algorithms, and has been updated several times since then. All the SHA algorithms are very similar, and have been <a href="http://www.schneier.com/blog/archives/2005/02/cryptanalysis_o.html">increasingly under attack</a>, so NIST <a href="http://www.schneier.com/blog/archives/2005/10/nist_hash_works_1.html">wants to replace them</a>.</p>

<p>The competition is important because, unlike other technological standards, committee design &#151; balancing the interests of diverse constituents &#151; isn't conducive to good security. Security is best when it's designed by expert teams and then subjected to public review. And cryptography is best when it's chosen by competition.</p>

<p>In 1997, NIST held a <a href="http://en.wikipedia.org/wiki/Advanced_Encryption_Standard_process">competition</a> for a <a href="http://csrc.nist.gov/archive/aes/index.html">block cipher</a> to replace DES. Fifteen candidates and three-and-a-half years later, Rijndael became the new Advanced Encryption Standard &#151; AES. NIST is doing the same thing for what it's calling SHA-3 (not, for some unexplained reason, the Advanced Hash Standard or AHS).</p>

<p>The deadline was October 31, and NIST received 64 submissions. This isn't surprising &#151; I <a href="http://www.schneier.com/blog/archives/2008/10/the_skein_hash.html">predicted</a> 80 &#151; as most of the 15 AES submitters were professors, whose students at the time have become professors themselves, with their own students. (If NIST does a stream cipher competition in another ten years, they should expect about 256 submissions.) These submissions came from academia, from industry, and from hobbyists. <cite><a href="http://www.cio.com/article/461164/Amateurs_and_Pros_Vie_to_Build_New_Crypto_Standard">CIO magazine</a></cite> recently interviewed one of the submitters, who is 15. Twenty-eight submissions have been made <a href="http://ehash.iaik.tugraz.at/wiki/The_SHA-3_Zoo">public</a> by the submitters, and six of those have been broken.  </p>

<p>NIST is going through all the submissions right now, making sure they are complete and proper. Their goal is to publish all accepted submissions by the end of November, in advance of the <a href="http://csrc.nist.gov/groups/ST/hash/timeline.html">First Hash Function Candidate Conference</a>, to be held in Belgium right after the <a href="https://www.cosic.esat.kuleuven.be/fse2009/index.shtml">Fast Software Encryption workshop</a> in February.  </p>

<p>The group expects to quickly make a first cut of algorithms &#151; hopefully to about a dozen &#151; and give the community a year of cryptanalysis before making a second cut in 2010. After another year of cryptanalysis, NIST will choose a winner in 2011. Expect a final standard by 2012.</p>

<p>My advice for software developers is to let the process run its course. While it's tempting to use the new cool algorithms in your designs, it's far too soon to trust any of them. This process is likely to result in all sorts of new research results in hash function security, and some real cryptanalytic surprises.  Give the community a few years to figure out which ones are good and which aren't.</p>

<p>I've previously called this sort of thing a cryptographic demolition derby: The last one left standing wins. But that's only partially true. Certainly all the groups will spend the next few years trying to cryptanalyze each other, but in the end there will be a bunch of unbroken algorithms. NIST will select one based on performance and features.</p>

<p>NIST has stated that the goal of this process is not to choose the best standard but to choose a good standard. I think that's smart; in this process, the best is the enemy of the good. While there's no rush to choose a new standard &#151; the SHA-2 algorithms will remain secure for the foreseeable future &#151; we don't want to analyze the candidates forever.</p>

<p>Personally, I was part of a group of eight cryptographers that submitted <a href="http://www.schneier.com/skein.html">Skein</a> to the competition. A decade ago, writing <a href="http://www.schneier.com/twofish.html">Twofish</a> and participating in the AES process was the most fun I had ever had in cryptography. These next few years promise to be even more fun.</p>

<p>---</p>

<p><i>Bruce Schneier is chief security technology officer of BT. His new book is </i>Schneier on Security<i>.</i></p><br style="clear: both;"/>
  <img alt="" style="border: 0; height:1px; width:1px;" border="0" src="http://www.pheedo.com/img.phdo?i=3fb55453a3600c210940457d550e67ec" height="1" width="1"/>
<img src="http://www.pheedo.com/feeds/tracker.php?i=3fb55453a3600c210940457d550e67ec" style="display: none;" border="0" height="1" width="1" alt=""/><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/wired/politics/privacy?a=AfuoN"><img src="http://feeds.feedburner.com/~f/wired/politics/privacy?i=AfuoN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/wired/politics/privacy?a=1WcCn"><img src="http://feeds.feedburner.com/~f/wired/politics/privacy?i=1WcCn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/wired/politics/privacy?a=dcuSn"><img src="http://feeds.feedburner.com/~f/wired/politics/privacy?i=dcuSn" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/wired/politics/privacy?a=6jt5N"><img src="http://feeds.feedburner.com/~f/wired/politics/privacy?i=6jt5N" border="0"></img></a>
 <a href="http://feeds.wired.com/~f/wired/politics/security?a=yYWDN"><img src="http://feeds.wired.com/~f/wired/politics/security?i=yYWDN" border="0"></img></a> <a href="http://feeds.wired.com/~f/wired/politics/security?a=yrdIn"><img src="http://feeds.wired.com/~f/wired/politics/security?i=yrdIn" border="0"></img></a> <a href="http://feeds.wired.com/~f/wired/politics/security?a=CF0Rn"><img src="http://feeds.wired.com/~f/wired/politics/security?i=CF0Rn" border="0"></img></a> <a href="http://feeds.wired.com/~f/wired/politics/security?a=l83kN"><img src="http://feeds.wired.com/~f/wired/politics/security?i=l83kN" border="0"></img></a> </div><img src="http://feeds.feedburner.com/~r/wired/politics/privacy/~4/459059854" height="1" width="1"/><img src="http://feeds.wired.com/~r/wired/politics/security/~4/459059855" height="1" width="1"/>]]></content:encoded>
      <pubDate>Wed, 19 Nov 2008 23:00:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/hash function">hash function</category>
      <category domain="http://securityratty.com/tag/sha">sha</category>
      <category domain="http://securityratty.com/tag/sha-3">sha-3</category>
      <category domain="http://securityratty.com/tag/algorithms">algorithms</category>
      <category domain="http://securityratty.com/tag/cool algorithms">cool algorithms</category>
      <category domain="http://securityratty.com/tag/sha family">sha family</category>
      <category domain="http://securityratty.com/tag/nist held">nist held</category>
      <category domain="http://securityratty.com/tag/unlike encryption algorithms">unlike encryption algorithms</category>
      <category domain="http://securityratty.com/tag/nist">nist</category>
      <source url="http://feeds.wired.com/~r/wired/politics/security/~3/459059855/securitymatters_1120">America's Next Top Hash Function Begins</source>
    </item>
    <item>
      <title><![CDATA[National Security Perspectives A Post-Election Insider View]]></title>
      <link>http://securityratty.com/article/caa8257ee971993e58e1b834379f8c71</link>
      <guid>http://securityratty.com/article/caa8257ee971993e58e1b834379f8c71</guid>
      <description><![CDATA[Recently I participated in an event entitled National Security Perspectives held at the famous Congressional Country Club in Maryland . The featured panelists had impressive credentials from the NSA ,...]]></description>
      <content:encoded><![CDATA[<p>Recently I participated in an event entitled National Security Perspectives held at the famous <a href="http://www.ccclub.org/" target="_blank">Congressional Country Club in Maryland</a>. The featured panelists had impressive credentials from the <a href="http://www.nsa.gov/" target="_blank">NSA</a>, <a href="http://www.dhs.gov/" target="_blank">DHS</a> and the <a href="https://www.cia.gov/" target="_blank">CIA</a>. The topics of discussion ranged from Current Geopolitical Threats and Evolving Technology Demands to predictions about the New Administrations Intelligence, Defense and Homeland Security focus.</p>
<p>The panelists were:<br />
<a href="http://en.wikipedia.org/wiki/National_Security_Agency" target="_blank">William P. Crowell</a> – former Deputy Director of the National Security Agency<br />
<a href="http://www.whitehouse.gov/government/m_jackson-bio.html" target="_blank">Michael P. Jackson</a> – Deputy Secretary, Department of Homeland Security<br />
<a href="http://en.wikipedia.org/wiki/Jose_Rodriguez_(intelligence)" target="_blank">Jose A. Rodriguez, Jr</a>. – former Director CIA, National Clandestine Service &amp; CIA, DCI Counterterrorist Center</p>
<p>Overall, it was a very nicely arranged event on a brisk fall evening with about 100 CXO attendees; mostly large but some small government contractors and a few product companies like ScienceLogic that conduct business with military, intelligence and the public sector.</p>
<p>No surprise, given the financial crisis the economy is suffering from that the panelists said we also have a <a href="http://obsidianwings.blogs.com/obsidian_wings/2008/11/defictits-actua.html" target="_blank">crisis coming on the Federal budget front</a>. This will put enormous pressure on the way Administration thinks, and how and where to spend the $$.</p>
<p>Obama’s tone regarding the issues he will be confronting in the world during the election was encouraging. Make the world more non-partisan and take on the threats that we have in front of us head-on!</p>
<p>The panel was very upfront about current threats. William Crowell said,</p>
<blockquote><p>“It is highly imprudent to believe that there will not be another 9-11. We have to fund and support the work to stop other attacks. We can only mitigate risk but we can’t eliminate risk. We have to try to absorb the sense of urgency and wake up every day looking at the intelligence screens as if 9-11 happened within the last couple of months.”</p></blockquote>
<p>He added,</p>
<blockquote><p>“They (the intelligence community) need the innovation, sense of commitment and urgency that comes from the private sector – a sense of mutual commitment to that mission.”</p></blockquote>
<p>Predicted Priorities for investment for DHS:</p>
<ol>
<li>Cyber attack as the top issue</li>
<li>Nuclear threats including dirty bomb</li>
<li>Chemical and biological attacks</li>
<li>Explosive attacks against critical infrastructure with maximum # of lives and or financial disruption / loss.</li>
<li>Large scale natural disasters – hurricane + earthquakes</li>
<li>Border penetration - identity management and border management issues</li>
</ol>
<p>An <a href="http://www.barackobama.com/index.php" target="_blank">Obama administration</a> will spend dollars around these threat vectors. They will want to spend $$ to help state and local governments. Grants to state and local governments should significantly increase with the Obama administration, so think about how you will increase your focus on the state and local government spending initiatives.</p>
<p><a href="http://lawprofessors.typepad.com/immigration/2008/11/pressure-on-oba.html" target="_blank">Secure border investments</a> – the panelists believe that the new administration will feel compelled to invest here. Michael P. Jackson bluntly said, “You have to make investments in border tools to get meaningful immigration reform.”</p>
<p>Panelists agreed that the 1<sup>st</sup> year will be an intense period of scrutiny about fundamental directions. We can’t afford it all at DHS; it is dramatically under budgeted. At TSA/DOT and then at DHS, we spent about $4 Billion on technology investments since 9-11; those investments are now reaching the end of the original service life.</p>
<p>One gripe from the panel that I found humorous: “We don’t have a group of people who think like entrepreneurs.” It is insane how long things last when you buy things in the government. As an example, we are still replacing vacuum tubes in some of the very old FAA gear… this is well beyond what any reasonable person would think these initial investments should/would last.</p>
<p>Final Thoughts:<br />
I actually think that the Obama Administration will be quite favorable to COTS software products, SaaS offerings, and creative financing initiatives from the private sector. The government just won’t have the capital budget to do everything it wants to accomplish. I would say if you look at how intelligently and aggressively <a href="http://www.concurringopinions.com/archives/2008/11/obama_and_techn.html" target="_blank">Obama used technology</a> to assist his campaign, the odds are good that this new breed of IT talent (which is already really comfortable with SaaS products, blogs, wiki’s, hosted/outsourced Cloud solutions… this team really understands the latest technology trends) will quickly work to bring these new IT paradigms to the Federal marketplace. Clearly the private sector can help the Government achieve more with lower capital budgets – beginning to provide services rather than transaction-based selling. Another clear idea is to think about leasing as a better way to work with the government which going forward will have increased budgets restrictions.</p>
<p>They will likely be in confrontation with members of Congress that won’t change fast enough, however the future of our nation’s ability to fight terror lies in becoming more efficient and effective. It requires the government be flexible enough to figure out what <a href="http://blogs.techrepublic.com.com/hiner/?p=880" target="_blank">jobs and IT functions to outsource</a> in a nimble and smart way. My prediction: this is great news for Service Providers. Overall the next 4 years should be great for our business as well as the Managed Service Provider/SaaS industry!</p>
<p><em><span style="color: #333333;"> </span></em></p>
]]></content:encoded>
      <pubDate>Tue, 18 Nov 2008 11:13:25 +0000</pubDate>
      <category domain="http://securityratty.com/tag/secure border investments">secure border investments</category>
      <category domain="http://securityratty.com/tag/investments">investments</category>
      <category domain="http://securityratty.com/tag/government contractors">government contractors</category>
      <category domain="http://securityratty.com/tag/government">government</category>
      <category domain="http://securityratty.com/tag/threats">threats</category>
      <category domain="http://securityratty.com/tag/government achieve">government achieve</category>
      <category domain="http://securityratty.com/tag/initial investments shouldwould">initial investments shouldwould</category>
      <category domain="http://securityratty.com/tag/obama administration">obama administration</category>
      <category domain="http://securityratty.com/tag/current threats">current threats</category>
      <source url="http://blog.sciencelogic.com/national-security-perspectives-a-post-election-insider-view/11/2008">National Security Perspectives A Post-Election Insider View</source>
    </item>
    <item>
      <title><![CDATA[Will Code Malware for Financial Incentives]]></title>
      <link>http://securityratty.com/article/30eebfa1383ce3a671879e2f1f0af37d</link>
      <guid>http://securityratty.com/article/30eebfa1383ce3a671879e2f1f0af37d</guid>
      <description><![CDATA[A couple of hundred dollars can indeed get you state of the art undetectable piece of malware with post-purchase service in the form of automatic lower detection rate for sure, but what happens when...]]></description>
      <content:encoded><![CDATA[<div style="text-align: left;"></div><div class="separator" style="clear: both; text-align: center;"></div><div class="separator" style="clear: both; text-align: center;"></div><div style="text-align: left;"></div><div class="separator" style="clear: both; text-align: center;"></div><a href="http://4.bp.blogspot.com/_wICHhTiQmrA/SSLQOaWm71I/AAAAAAAACdM/nHHgxqAJn-4/s1600-h/malware_hire_sample_1.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/_wICHhTiQmrA/SSLQOaWm71I/AAAAAAAACdM/nHHgxqAJn-4/s200/malware_hire_sample_1.JPG" /></a>A couple of hundred dollars can indeed get you state of the art <a href="http://ddanchev.blogspot.com/2008/07/coding-spyware-and-malware-for-hire.html">undetectable piece of malware with post-purchase service</a> in the form of automatic lower detection rate for sure, but what happens when the vendors of such releases start vertically integrating just like everyone else, and start offering OS-independent spamming, flooding, modifications and tweaking of popular crimeware kits in the very same fashion? The quality assurance process gets centralized into the hands of experienced programmers that have been developing cybercrime facilitating tools for years.<br />
<br />
<div style="text-align: left;"></div><div class="separator" style="clear: both; text-align: center;"></div><a href="http://3.bp.blogspot.com/_wICHhTiQmrA/SSLcUHXGAoI/AAAAAAAACdU/wnzsUHFHSrg/s1600-h/malware_hire_sample_2.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://3.bp.blogspot.com/_wICHhTiQmrA/SSLcUHXGAoI/AAAAAAAACdU/wnzsUHFHSrg/s200/malware_hire_sample_2.JPG" /></a>It's interesting to monitor the pricing schemes that they implement. For instance, the modularity of a particular malware, that is the additional functions that a buyer may want or not want, increase or decrease the price respectively. Others, tend to leave the price open topic by only mentioning the starting price for their services and they increasing it again in open topic fashion.<br />
<br />
Let's take look at some recently advertised (translated) "malware coding for hire" propositions, highlighting some of the latest developments in their pricing strategies :<br />
<br />
<div style="text-align: left;"></div><div class="separator" style="clear: both; text-align: center;"></div><a href="http://4.bp.blogspot.com/_wICHhTiQmrA/SSMEwnRgU6I/AAAAAAAACdc/bFEBpsTalQQ/s1600-h/malware_hire_sample_3.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://4.bp.blogspot.com/_wICHhTiQmrA/SSMEwnRgU6I/AAAAAAAACdc/bFEBpsTalQQ/s200/malware_hire_sample_3.JPG" /></a><b>Proposition 1</b> : <br />
"<i>Programs and scripts under the following categories are accepted : </i><br />
<i>grabbers; spamming tools for forums, spamming tools for social networking sites, modifications of admin panels for (popular crimeware kits), phishing pages</i><br />
<br />
<i>Platform: software running on MAC OS to Windows  </i><br />
<i>Multitasking: have the capacity to work on multiple projects</i><br />
<i>Speed and responsibility: at the highest level  </i><br />
<i>Pre-payment for new customers: 50% of the whole price, 30% pre-pay of the whole price for repreated customers  </i><br />
<i>Support: Paid  </i><br />
<i>Rates: starting from 100 euros</i><br />
<br />
<div style="text-align: left;"></div><div class="separator" style="clear: both; text-align: center;"></div><div style="text-align: left;"></div><div class="separator" style="clear: both; text-align: center;"></div><a href="http://1.bp.blogspot.com/_wICHhTiQmrA/SSMGg5E49_I/AAAAAAAACds/lWtlV3eYu4s/s1600-h/malware_hire_sample_4.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/_wICHhTiQmrA/SSMGg5E49_I/AAAAAAAACds/lWtlV3eYu4s/s200/malware_hire_sample_4.JPG" /></a><i>If, after speaking ultimate price, you decide to add to your order something else - the price change. Prepare the job immediately, which will understand what to do and how much it will cost you, if you have any suggestions for a price, then lays them immediately and not after the work is completed. If you order something that requires parsing your logs, and their continued use, you agree to provide "a significant portion of the logs, so that after putting the project did not raise misunderstandings due to the fact that some logs are no longer "fresh", because of their "uniqueness". In this case, for the finalization of the project will be charged an additional fee.</i>"<br />
<br />
<div style="text-align: left;"></div><div class="separator" style="clear: both; text-align: center;"></div><a href="http://2.bp.blogspot.com/_wICHhTiQmrA/SSMKeg8y5SI/AAAAAAAACd0/ekeV4Us8PwY/s1600-h/malware_hire_sample_5.JPG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://2.bp.blogspot.com/_wICHhTiQmrA/SSMKeg8y5SI/AAAAAAAACd0/ekeV4Us8PwY/s200/malware_hire_sample_5.JPG" /></a>This is an example of an "open topic pricing scheme" with the vendor offering the possibility to code the malware or the tool for any price above 100 euro based on what he perceives as features included within worth the price.<br />
<br />
<b>Proposition 2</b>:<br />
"<i>Starting price for my malware is 250 EUR. Additional modules like P2P features, source code for a particular module go for an additional 50 EUR. If you're paying in another currency the price is 200 GBP or 395 dollars. I sell only ten copies of the builder so hurry up. The trading process is simple - a password protected file with the malware is sent to you so you can see the files inside. You then sent the money and I mail you back the password. If you don't like this way you lose.&nbsp;</i><br />
<br />
<i>I can also offer you another deal, I will share the complete source code in exchange to access to a botnet with at least 4000 infected hosts because I don't have time to play around with me bot right now.</i> <br />
<br />
This proposition is particularly interesting because the seller is introducing basic understanding of exchange rates, but most of all because he's in fact offering a direct bargain in the form of access to a botnet in exchange for a complete source code of his malware bot. Both propositions are also great examples that vendors engage by keeping their current and potential customers up-to-date with <a href="http://ddanchev.blogspot.com/2008/04/botnet-masters-to-do-list.html">TODO lists of features to come</a> next to the usual CHANGELOGS, and, of course,&nbsp; establish trust by allowing potential customers to take a peek at the source code of the malware they're about to purchase.<br />
<br />
<b>Related posts:</b><br />
<a href="http://ddanchev.blogspot.com/2008/07/coding-spyware-and-malware-for-hire.html">Coding Spyware and Malware for Hire </a><br />
<a href="http://ddanchev.blogspot.com/2007/03/underground-economys-supply-of-goods.html">The Underground Economy's Supply of Goods and Services</a><br />
<a href="http://ddanchev.blogspot.com/2007/10/dynamics-of-malware-industry.html">The Dynamics of the Malware Industry - Proprietary Malware Tools</a><br />
<a href="http://ddanchev.blogspot.com/2008/06/using-market-forces-to-disrupt-botnets.html">Using Market Forces to Disrupt Botnets</a><br />
<a href="http://ddanchev.blogspot.com/2007/10/multiple-firewalls-bypassing.html">Multiple Firewalls Bypassing Verification on Demand</a><br />
<a href="http://ddanchev.blogspot.com/2007/10/managed-spamming-appliances-future-of.html">Managed Spamming Appliances - The Future of Spam</a><br />
<a href="http://ddanchev.blogspot.com/2008/02/localizing-cybercrime-cultural.html">Localizing Cybercrime - Cultural Diversity on Demand</a><br />
<a href="http://ddanchev.blogspot.com/2008/01/e-crime-and-socioeconomic-factors.html">E-crime and Socioeconomic Factors</a><br />
<a href="http://ddanchev.blogspot.com/2007/12/russias-fsb-vs-cybercrime.html">Russia's FSB vs Cybercrime</a><br />
<a href="http://ddanchev.blogspot.com/2007/08/malware-as-web-service.html">Malware as a Web Service</a><br />
<a href="http://ddanchev.blogspot.com/2007/09/localizing-open-source-malware.html">Localizing Open Source Malware</a><br />
<a href="http://ddanchev.blogspot.com/2008/04/quality-and-assurance-in-malware.html">Quality and Assurance in Malware Attacks</a><br />
<a href="http://ddanchev.blogspot.com/2006/09/benchmarking-and-optimising-malware.html">Benchmarking and Optimising Malware</a><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?a=a8huN"><img src="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?i=a8huN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?a=sEoBN"><img src="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?i=sEoBN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?a=Rj24n"><img src="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?i=Rj24n" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?a=W4aen"><img src="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?i=W4aen" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?a=7YAqN"><img src="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?i=7YAqN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?a=rEDhN"><img src="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?i=rEDhN" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?a=rpNUn"><img src="http://feeds.feedburner.com/~f/DanchoDanchevOnSecurityAndNewMedia?i=rpNUn" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/DanchoDanchevOnSecurityAndNewMedia/~4/457569401" height="1" width="1"/>]]></content:encoded>
      <pubDate>Tue, 18 Nov 2008 10:57:55 +0000</pubDate>
      <category domain="http://securityratty.com/tag/malware">malware</category>
      <category domain="http://securityratty.com/tag/code">code</category>
      <category domain="http://securityratty.com/tag/source malware">source malware</category>
      <category domain="http://securityratty.com/tag/malware attacks">malware attacks</category>
      <category domain="http://securityratty.com/tag/malware bot">malware bot</category>
      <category domain="http://securityratty.com/tag/proprietary malware tools">proprietary malware tools</category>
      <category domain="http://securityratty.com/tag/source code">source code</category>
      <category domain="http://securityratty.com/tag/complete source code">complete source code</category>
      <category domain="http://securityratty.com/tag/tools">tools</category>
      <source url="http://feeds.feedburner.com/~r/DanchoDanchevOnSecurityAndNewMedia/~3/457569401/will-code-malware-for-financial.html">Will Code Malware for Financial Incentives</source>
    </item>
    <item>
      <title><![CDATA[Risk or Security Management: What's In a Term?]]></title>
      <link>http://securityratty.com/article/0136fe88d711ff0de5b473f4a5b2d0c4</link>
      <guid>http://securityratty.com/article/0136fe88d711ff0de5b473f4a5b2d0c4</guid>
      <description><![CDATA[When Gartner security and risk analysts give presentations, write research or talk to clients, we often get criticized for using the terms security and risk management interchangeably. This is deemed...]]></description>
      <content:encoded><![CDATA[When Gartner security and risk analysts give presentations, write research or talk to clients, we often get criticized for using the terms security and risk management interchangeably. This is deemed to be confusing by the audience as they try to articulate a clear differentiation between these terms. Indeed, in large sections of our client base, vigorous debate is being held on defining, differentiating and positioning information security vs. information risk management.<br />
<br />
Well, maybe such a clear differentiation is not always required. Maybe security and risk management is so intertwined that continuously trying to separate them becomes counterproductive. Let's try to look at this objectively: I can make a clear argument that security is an integral part of risk management. But I can make a similarly cogent argument that risk management is an integral part of security management. The definition is largely in the eye of the beholder. It is contextual and situational. Maybe security and risk management are not the two sides of the same coin - maybe these disciplines are so integrated that they ARE the coin. The business is interested in the coin, not the pictures embossed on either side of it.<br />
<br />
I am not arguing that the security and risk management are one and the same. They are indeed discrete disciplines with different functions and activities. And from an organizational perspective, is it important the different roles are named appropriately to the responsibilities of the individuals concerned. But let's be frank, does your business really care whether you call yourself a security manager or a risk manager? All they want is for (both of?) you to help them manage your information security and IT risks appropriately.<br />
<br />
Risk management and security management. It's not either/or. Black or white. So here is my call: Let's spend less time debating and arguing the differences, and more time on using and maturing these extremely important, completely interrelated disciplines.]]></content:encoded>
      <pubDate>Tue, 11 Nov 2008 11:59:18 +0000</pubDate>
      <category domain="http://securityratty.com/tag/security">security</category>
      <category domain="http://securityratty.com/tag/risk management">risk management</category>
      <category domain="http://securityratty.com/tag/risk management interchangeably">risk management interchangeably</category>
      <category domain="http://securityratty.com/tag/information security">information security</category>
      <category domain="http://securityratty.com/tag/security management">security management</category>
      <category domain="http://securityratty.com/tag/terms">terms</category>
      <category domain="http://securityratty.com/tag/information risk management">information risk management</category>
      <category domain="http://securityratty.com/tag/terms security">terms security</category>
      <category domain="http://securityratty.com/tag/gartner security">gartner security</category>
      <source url="http://blog.gartner.com/blog/security.php?x=0&amp;itemid=4041">Risk or Security Management: What's In a Term?</source>
    </item>
    <item>
      <title><![CDATA[Keeping America Safe from Terrorism by Monitoring Distillery Webcams]]></title>
      <link>http://securityratty.com/article/97364c3b71b32b3988fc75fe4bcaf94a</link>
      <guid>http://securityratty.com/article/97364c3b71b32b3988fc75fe4bcaf94a</guid>
      <description><![CDATA[Really : We had an email recently from an observer &quot;curious as to why the webcam that was inside the shop/bar is no longer there, or at least, functional&quot;. The email was from the Defense Threat...]]></description>
      <content:encoded><![CDATA[<p><a href="http://www.bruichladdich.com/wmd_story.htm">Really</a>:</p>

<blockquote>We had an email recently from an observer "curious as to why the webcam that was inside the shop/bar is no longer there, or at least, functional". The email was from the Defense Threat Reduction Agency in the United States.

<p>When we replied that it was simply a short term technical problem, we asked why on earth they could be interested in the comings and goings of a small Distillery off the West Coast of Scotland. Were there secret manoeuvres taking place in Loch Indaal, or even a threat of terrorists infiltrating the mainland via Islay?</p>

<p>The answer we received was even more surreal. Evidently the mission of the DTRA is to safeguard the US and its allies from weapons of mass destruction -chemical, biological, radiological, nuclear and high explosives.   The department which contacted the Distillery deals with the implementation of the Chemical Weapons Convention, going to sites to verify treaty compliance.  Funnily enough chemical weapon processes look very similar to the distilling process and as part of training there is a visit to a brewery for familiarization with reactors, batch processors and evaporators.  As they said, it just goes to show how "tweaks" to the process flow or equipment, can create something very pleasant (whisky) or deadly (chemical weapons).</p>

<p>As they say: "In the post-Cold War environment, a unified, consistent approach to deterring, reducing and countering weapons of mass destruction is essential to maintaining our national security. Under DTRA, Department of Defense resources, expertise and capabilities are combined to ensure the United States remains ready and able to address the present and future WMD threat. We perform four essential functions to accomplish our mission: combat support, technology development, threat control and threat reduction. These functions form the basis for how we are organized and our daily activities. Together, they enable us to reduce the physical and psychological terror of weapons of mass destruction, thereby enhancing the security of the world's citizens. At the dawn of the 21st century, no other task is as challenging or demanding".</blockquote></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/schneier/fulltext?a=pHqMM"><img src="http://feeds.feedburner.com/~f/schneier/fulltext?i=pHqMM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/schneier/fulltext?a=KbK3M"><img src="http://feeds.feedburner.com/~f/schneier/fulltext?i=KbK3M" border="0"></img></a>
</div>]]></content:encoded>
      <pubDate>Fri, 31 Oct 2008 08:15:49 +0000</pubDate>
      <category domain="http://securityratty.com/tag/chemical weapons convention">chemical weapons convention</category>
      <category domain="http://securityratty.com/tag/chemical weapons">chemical weapons</category>
      <category domain="http://securityratty.com/tag/weapons">weapons</category>
      <category domain="http://securityratty.com/tag/threat">threat</category>
      <category domain="http://securityratty.com/tag/future wmd threat">future wmd threat</category>
      <category domain="http://securityratty.com/tag/mass destruction -chemical">mass destruction -chemical</category>
      <category domain="http://securityratty.com/tag/mass destruction">mass destruction</category>
      <category domain="http://securityratty.com/tag/distillery">distillery</category>
      <category domain="http://securityratty.com/tag/threat control">threat control</category>
      <source url="http://www.schneier.com/blog/archives/2008/10/keeping_america.html">Keeping America Safe from Terrorism by Monitoring Distillery Webcams</source>
    </item>
    <item>
      <title><![CDATA[The Skein Hash Function]]></title>
      <link>http://securityratty.com/article/c65ce3834e7790e113fa9e1fd1504568</link>
      <guid>http://securityratty.com/article/c65ce3834e7790e113fa9e1fd1504568</guid>
      <description><![CDATA[NIST is holding a competition to replace the SHA family of hash functions, which have been increasingly under attack . (I wrote about an early NIST hash workshop here
Skein is our submission (myself...]]></description>
      <content:encoded><![CDATA[<p>NIST is <a href="http://csrc.nist.gov/groups/ST/hash/sha-3/index.html">holding a competition</a> to replace the SHA family of hash functions, which have been <a href="http://www.schneier.com/blog/archives/2005/02/cryptanalysis_o.html">increasingly under attack</a>.  (I wrote about an early NIST hash workshop <a href="http://www.schneier.com/blog/archives/2005/10/nist_hash_works_1.html">here</a>.)</p>

<p>Skein is our submission (myself and seven others: <a href="http://en.wikipedia.org/wiki/Niels_Ferguson">Niels Ferguson</a>, <a href="http://th.informatik.uni-mannheim.de/People/Lucks/">Stefan Lucks</a>, <a href="http://www.hifn.com/executiveTeam.aspx?id=182">Doug Whiting</a>, <a href="http://www-cse.ucsd.edu/~mihir/">Mihir Bellare</a>, <a href="http://www.cs.washington.edu/homes/yoshi/">Tadayoshi Kohno</a>, <a href="http://www.pgp.com/about_pgp_corporation/management.html">Jon Callas</a>, and Jesse Walker).  <a href="http://www.schneier.com/skein.pdf">Here's</a> the paper:</p>

<blockquote><strong>Executive Summary</strong>

<p>Skein is a new family of cryptographic hash functions.  Its design combines speed, security, simplicity, and a great deal of flexibility in a modular package that is easy to analyze.</p>

<p>Skein is fast.  Skein-512 -- our primary proposal -- hashes data at 6.1 clock cycles per byte on a 64-bit CPU.  This means that on a 3.1 GHz x64 Core 2 Duo CPU, Skein hashes data at 500 MBytes/second per core -- almost twice as fast as SHA-512 and three times faster than SHA-256.  An optional hash-tree mode speeds up parallelizable implementations even more.  Skein is fast for short messages, too; Skein-512 hashes short messages in about 1000 clock cycles.</p>

<p>Skein is secure.  Its conservative design is based on the Threefish block cipher.  Our current best attack on Threefish-512 is on 25 of 72 rounds, for a safety factor of 2.9. For comparison, at a similar stage in the standardization process, the AES encryption algorithm had an attack on 6 of 10 rounds, for a safety factor of only 1.7.  Additionally, Skein has a number of provably secure properties, greatly increasing confidence in the algorithm.</p>

<p>Skein is simple.  Using only three primitive operations, the Skein compression function can be easily understood and remembered.  The rest of the algorithm is a straightforward iteration of this function.</p>

<p>Skein is flexible.  Skein is defined for three different internal state sizes -- 256 bits, 512 bits, and 1024 bits -- and any output size.  This allows Skein to be a drop-in replacement for the entire SHA family of hash functions.  A completely optional and extendable argument system makes Skein an efficient tool to use for a very large number of functions: a PRNG, a stream cipher, a key derivation function, authentication without the overhead of HMAC, and a personalization capability.  All these features can be implemented with very low overhead.  Together with the Threefish large-block cipher at Skein core, this design provides a full set of symmetric cryptographic primitives suitable for most modern applications.</p>

<p>Skein is efficient on a variety of platforms, both hardware and software.  Skein-512 can be implemented in about 200 bytes of state.  Small devices, such as 8-bit smart cards, can implement Skein-256 using about 100 bytes of memory.  Larger devices can implement the larger versions of Skein to achieve faster speeds.</p>

<p>Skein was designed by a team of highly experienced cryptographic experts from academia and industry, with expertise in cryptography, security analysis, software, chip design, and implementation of real-world cryptographic systems.  This breadth of knowledge allowed them to create a balanced design that works well in all environments.</blockquote></p>

<p><a href="http://www.schneier.com/code/skein_NIST_CD_101308.zip">Here's</a> source code, text vectors, and the like for Skein.  Watch the <a href="http://www.schneier.com/skein.html">Skein website</a> for any updates -- new code, new results, new implementations, the proofs.</p>

<p>NIST's deadline is Friday.  It seems as if everyone -- including many amateurs -- is working on a hash function, and I predict that NIST will receive at least 80 submissions.  (Compare this to the 21 submissions NIST received -- five were rejected as not being complete --  for the AES competition in 1998.)  I expect people to start posting their submissions over the weekend.  (Ron Rivest already <a href="http://people.csail.mit.edu/rivest/Rivest-TheMD6HashFunction.ppt">presented</a> MD6 at Crypto in August.)  Probably the best place to watch for new hash functions is <a href="http://planeta.terra.com.br/informatica/paulobarreto/hflounge.html">here</a>; I'll try to keep a listing of the submissions myself.</p>

<p>The selection process will take around four years.  I've previously called this sort of thing a cryptographic demolition derby -- last one left standing wins -- but that's only half true.  Certainly all the groups will spend the next couple of years trying to cryptanalyze each other, but in the end there will be a bunch of unbroken algorithms; NIST will select one based on performance and features.</p>

<p>NIST has stated that the goal of this process is not to choose the best standard but to choose a good standard.  I think that's smart of them; in this process, "best" is the enemy of "good."  My advice is this: immediately sort them based on performance and features.  Ask the cryptographic community to focus its attention on the top dozen, rather than spread its attention across all 80 -- although I also expect that most of the amateur submissions will be rejected by NIST for not being "complete and proper."  Otherwise, people will break the easy ones and the better ones will go unanalyzed.</p><div class="feedflare">
<a href="http://feeds.feedburner.com/~f/schneier/fulltext?a=RsFiM"><img src="http://feeds.feedburner.com/~f/schneier/fulltext?i=RsFiM" border="0"></img></a> <a href="http://feeds.feedburner.com/~f/schneier/fulltext?a=VuObM"><img src="http://feeds.feedburner.com/~f/schneier/fulltext?i=VuObM" border="0"></img></a>
</div>]]></content:encoded>
      <pubDate>Wed, 29 Oct 2008 01:35:29 +0000</pubDate>
      <category domain="http://securityratty.com/tag/skein">skein</category>
      <category domain="http://securityratty.com/tag/hash function">hash function</category>
      <category domain="http://securityratty.com/tag/function">function</category>
      <category domain="http://securityratty.com/tag/implement skein-256">implement skein-256</category>
      <category domain="http://securityratty.com/tag/implement">implement</category>
      <category domain="http://securityratty.com/tag/skein hashes data">skein hashes data</category>
      <category domain="http://securityratty.com/tag/skein website">skein website</category>
      <category domain="http://securityratty.com/tag/hashes data">hashes data</category>
      <category domain="http://securityratty.com/tag/key derivation function">key derivation function</category>
      <source url="http://www.schneier.com/blog/archives/2008/10/the_skein_hash.html">The Skein Hash Function</source>
    </item>
    <item>
      <title><![CDATA[MS08-067 and the SDL]]></title>
      <link>http://securityratty.com/article/df5eba2c21ebdf631d2dd9fbe82532ab</link>
      <guid>http://securityratty.com/article/df5eba2c21ebdf631d2dd9fbe82532ab</guid>
      <description><![CDATA[Hi, Michael here
No doubt you are aware of the out-of-band security bulletin issued by the Microsoft Security Response Center today, and like all security vulnerabilities, this is a vulnerability we...]]></description>
      <content:encoded><![CDATA[<P mce_keep="true">Hi, Michael here.</P>
<P>No doubt you are aware of the out-of-band security bulletin issued by the <A href="http://www.microsoft.com/technet/security/Bulletin/MS08-067.mspx" mce_href="http://www.microsoft.com/technet/security/Bulletin/MS08-067.mspx">Microsoft Security Response Center</A> today, and like all security vulnerabilities, this is a vulnerability we can learn from and, if necessary, can use to shape future versions of the Security Development Lifecycle (SDL).</P>
<P>Before I get into some of the details, it's important to understand that the SDL is designed as a multi-pronged security process to help systemically reduce security vulnerabilities. In theory, if one facet of the SDL process fails to prevent or catch a bug, then some other facet should prevent or catch the bug. The SDL also mandates the use of security defenses, because we know full well that the SDL process will never catch all security bugs. As we have said many times, the goal of the SDL is to "Reduce vulnerabilities, and reduce the severity of what's missed."</P>
<P>In this post, I want to focus on the SDL-required code analysis, code review, fuzzing and compiler and operating system defenses and how they fared.</P>
<H3>Code Analysis and Review</H3>
<P>I want to start by analyzing the code to understand why we did not find this bug through manual code review nor through the use of our static analysis tools. First, the code in question is reasonably complex code to canonicalize path names; for example, strip out ‘..' characters and such to arrive at the simplest possible directory name. The bug is a stack-based buffer overflow inside a loop; finding buffer overruns in loops, especially complex loops, is difficult to detect with a high degree of probability without producing many false positives. At a later date I will publish more of the source code for the function. </P>
<P>The loop inside the function walks along an incoming string to determine if a character in the path might be a dot, dot-dot, slash or backslash and if it is then applies canonicalization algorithms.</P>
<P>The irony of the bug is it occurs while calling a bounded function call:</P>
<BLOCKQUOTE>
<P>_tcscpy_s(previousLastSlash, pBufferEnd - previousLastSlash, ptr + 2);</P></BLOCKQUOTE>
<P>This function is a macro that expands to <A href="http://msdn.microsoft.com/en-us/library/td1esda9(VS.80).aspx" mce_href="http://msdn.microsoft.com/en-us/library/td1esda9(VS.80).aspx">wcscpy_s</A>(dest, len, source); technically, the bug is not in the call to wcscpy_s, but it's in the way the arguments are calculated. As I alluded to, all three arguments are highly dynamic and constantly updated within the while() loop. There is a great deal of pointer arithmetic in this loop. Without going into all the gory attack details, given a specific path, and after the while() loop has been passed through a few times, the pointer, previousLastSlash, gets clobbered. </P>
<P>In my opinion, hand reviewing this code and successfully finding this bug would require a great deal of skill and luck. So what about tools?&nbsp; It's very difficult to design an algorithm which can analyze C or C++ code for these sorts of errors.&nbsp; The possible variable states grows very, very quickly.&nbsp; It's even more difficult to take such algorithms and scale them to non-trivial code bases. This is made more complex as the function accepts a highly variable argument, it's not like the argument is the value 1, 2 or 3! Our present toolset does not catch this bug. </P>
<P>Ok, now I'm really going out on a limb with this next section.</P>
<P>Over the last year or so I've noticed that the security vulnerabilities across Microsoft, but most noticeably in Windows have become bugs of a class I call "onesey - twosies" in other words, one-off bugs. There is a good side and a bad side to this. First the good news; I think perhaps we have removed a good number of the low-hanging security vulnerabilities from many of our products, especially the newer code. The bad news is, we'll continue to have vulnerabilities because you cannot train a developer to hunt for unique bugs, and creating tools to find such bugs is also hard to do without incurring an incredible volume of false positives. With all that said, I will add detail about one-off bugs to our internal education; I think it's important to make people aware that even with great tools and great security-savvy engineers, there are still bugs that are very hard to find.</P>
<H3>Fuzz Testing</H3>
<P>I'll be blunt; our fuzz tests did not catch this and they should have. So we are going back to our fuzzing algorithms and libraries to update them accordingly. For what it's worth, we constantly update our fuzz testing heuristics and rules, so this bug is not unique.</P>
<H3>Defenses</H3>
<P>If you want the full details of the defenses, and how they come into play on Windows Vista and Windows Server 2008, I urge you to read teh SVRD team's in-depth <A href="http://blogs.technet.com/swi/" mce_href="http://blogs.technet.com/swi/">analysis</A>&nbsp;once it is posted.</P>
<P>A big focus of the SDL is to define and require defenses because we have no allusions about finding or preventing all security vulnerabilities by attempting to get the code right all the time, because no-one can do that. No one. &nbsp;See my comment above about one-off bugs! </P>
<P>Let's look at each SDL mandated requirement and how they fared in light of this vulnerability.</P>
<H4>-GS</H4>
<P>The -GS story is not so simple. A lot of code is executed before a cookie check is made and the attacker can control the overflow because the overflow starts at an offset before the stack buffer, rather than at the stack buffer itself. So the attacker can overwrite other frames on the call stack, corresponding to functions that return before a cookie check is made. That's a long way of saying that -GS was not meant to prevent this type of scenarios.</P>
<H4>ASLR and NX</H4>
<P>The code fully complies with the SDL, and is linked with /DYNAMICBASE and /NXCOMPAT on Windows Vista and Windows Server 2008. There are great defenses when used together, and reduce the chance of a successful attack substantially. Also, the stack offset is randomized too, making a deterministic attack even more unlikely.</P>
<H4>Service Restart Policy</H4>
<P>By default the affected service is marked to restart only twice after a crash on Windows Vista and Windows Server 2008, which means the attacker has only two attempts to get the attack right. Prior to Windows Vista, the attacker has unlimited attempts because the service restarts indefinitely. </P>
<H4>Authentication</H4>
<P>Thanks to mandatory integrity control (MIC) settings (which comes courtesy of UAC) the networking endpoint that leads to the vulnerable code requires authentication on Windows Vista and Windows Server 2008 by default. Prior to Windows Vista, the end point is always anonymous, so anyone can attack it, so long as the attacker can traverse the firewall. This is a great example of SDL's focus on attack surface reduction; requiring authentication means the number of attackers that can access the entry point is dramatically reduced.</P>
<H4>Firewall</H4>
<P>We enabled the firewall by default in Windows XP SP2 and later, this was a direct learning from the Blaster worm. By default, ports 139 and 445 are not opened to the Internet on Windows XP SP2, Windows Vista and Windows Server 2008. </P>
<H3>Summary</H3>
<P>The $64,000 question we ask ourselves when we issue any bulletin is "did SDL fail?" and the answer in this case is categorically "No!" No because as I said earlier the goal of the SDL is "Reduce vulnerabilities, and reduce the severity of what you miss." Windows Vista and Windows Server 2008 customers are protected by the defenses in the operating system that have been crafted in part by the SDL. The development team who built the affected component compiled and linked with the appropriate settings as described in "<A href="http://msdn.microsoft.com/en-us/library/bb430720.aspx" mce_href="http://msdn.microsoft.com/en-us/library/bb430720.aspx">Windows Vista ISV Security</A>" and <A href="http://www.microsoft.com/mspress/books/10723.aspx" mce_href="http://www.microsoft.com/mspress/books/10723.aspx">Writing Secure Code for Windows Vista</A> so that their service is protected by the operating system. </P>
<P>The team did not poke holes through the firewall unnecessarily, in accordance with the SDL.</P>
<P>The team reduced their attack surface, in accordance with the SDL, by requiring authenticated connections rather than anonymous connections by default.</P>
<P>We know that the SDL-mandated -GS has very strict heuristics so some functions are not protected by a stack cookie, but in this case, there is no buffer on the stack, so there will be no cookie. We know this. There are no plans to remedy this in the short term. </P>
<P>Fuzzing missed the bug, so we will update our fuzz testing heuristics, but we continually update our fuzzing heuristics anyway. </P>
<P>In short, based on what we know right now, Windows Vista and Windows Server 2008 customers are protected because of the SDL-mandated defenses in the operating system, and because the development team adhered to the letter of the SDL to take advantage of those defenses.</P>
<P>Chalk one up for Windows Vista and later and the SDL!</P>
<P>As usual, questions and comments are very welcome.</P><img src="http://blogs.msdn.com/aggbug.aspx?PostID=9012073" width="1" height="1">]]></content:encoded>
      <pubDate>Wed, 22 Oct 2008 21:09:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/manual code review">manual code review</category>
      <category domain="http://securityratty.com/tag/code review">code review</category>
      <category domain="http://securityratty.com/tag/vulnerabilities">vulnerabilities</category>
      <category domain="http://securityratty.com/tag/reduce security vulnerabilities">reduce security vulnerabilities</category>
      <category domain="http://securityratty.com/tag/sdl">sdl</category>
      <category domain="http://securityratty.com/tag/windows">windows</category>
      <category domain="http://securityratty.com/tag/windows server">windows server</category>
      <category domain="http://securityratty.com/tag/sdl process fails">sdl process fails</category>
      <category domain="http://securityratty.com/tag/sdl process">sdl process</category>
      <source url="http://blogs.msdn.com/sdl/archive/2008/10/22/ms08-067.aspx">MS08-067 and the SDL</source>
    </item>
    <item>
      <title><![CDATA[Good hygiene and Banned APIs]]></title>
      <link>http://securityratty.com/article/76a6df21c84c03ac4f35261fb88bd645</link>
      <guid>http://securityratty.com/article/76a6df21c84c03ac4f35261fb88bd645</guid>
      <description><![CDATA[Jeremy Dallman here with a quick note about a code sanitizing tool we are making available to support one of the SDL requirements Remove all Banned APIs from your code
This requirement was put in...]]></description>
      <content:encoded><![CDATA[<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Jeremy Dallman here with a quick note about&nbsp;a code sanitizing tool we are making available to support one of the SDL requirements – Remove all Banned APIs from your code. </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>This requirement was put in place to prevent use of certain older C runtime functions that lead to buffer overrun flaws and have been deprecated. In the Security Development Lifecycle book, an entire chapter is dedicated to the topic of banned function calls. In the book, we also provide a copy of the banned.h header file on the companion CD. This header file allows you to locate any banned functions in your code.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>On MSDN, we have document the </FONT><A href="http://msdn.microsoft.com/en-us/library/bb288454.aspx"><FONT face=Calibri size=3>SDL list of Banned Function Calls</FONT></A><FONT face=Calibri size=3>, but the header file has not been publicly available outside the SDL book until now. Today, we are providing the banned.h header on the Microsoft Download Center. </FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><A href="http://download.microsoft.com/download/2/e/b/2ebac853-63b7-49b4-b66f-9fd85f37c0f5/banned.h"><FONT face=Calibri size=3>Find the banned.h header here</FONT></A></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>By including this header file, then using #include “banned.h”; you will be able to locate any banned functions in your code. The full list of banned APIs is also included in the header file.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Alternately, if you are using the compiler in Visual Studio 2005 or later, you have a built-in way to check for these banned functions. To catch banned C runtime functions, you can compile with /W4 and then triage all C4996 warnings. In code reviews, you should always remove any code that disables the C4996 warnings&nbsp;- e.g.: #pragma warning(disable:4996). This is one simple way to ensure your code is released without banned functions.</FONT></P>
<P class=MsoNormal style="MARGIN: 0in 0in 10pt"><FONT face=Calibri size=3>Sanitizing your code to remove potentially insecure APIs is a vital protection. Whether you include the banned.h header file or leverage the /W4-C4996 warnings in the Visual Studio 2005 compiler, you now have two ways to check your code and meet another SDL requirement in your development phase.</FONT></P><img src="http://blogs.msdn.com/aggbug.aspx?PostID=9011814" width="1" height="1">]]></content:encoded>
      <pubDate>Wed, 22 Oct 2008 18:08:00 +0000</pubDate>
      <category domain="http://securityratty.com/tag/header file">header file</category>
      <category domain="http://securityratty.com/tag/header">header</category>
      <category domain="http://securityratty.com/tag/code">code</category>
      <category domain="http://securityratty.com/tag/code reviews">code reviews</category>
      <category domain="http://securityratty.com/tag/runtime functions">runtime functions</category>
      <category domain="http://securityratty.com/tag/functions">functions</category>
      <category domain="http://securityratty.com/tag/apis">apis</category>
      <category domain="http://securityratty.com/tag/w4-c4996 warnings">w4-c4996 warnings</category>
      <category domain="http://securityratty.com/tag/c4996 warnings">c4996 warnings</category>
      <source url="http://blogs.msdn.com/sdl/archive/2008/10/22/good-hygiene-and-banned-apis.aspx">Good hygiene and Banned APIs</source>
    </item>
    <item>
      <title><![CDATA[Given the Current Economic Turmoil, What Should IT Managers Do?]]></title>
      <link>http://securityratty.com/article/c3cb795253913d9e8117ca429595355f</link>
      <guid>http://securityratty.com/article/c3cb795253913d9e8117ca429595355f</guid>
      <description><![CDATA[Gartner's Compliance &amp; Risk Management Research Community met recently and considered what IT managers should do given the economic turmoil spreading around the world

What started as a problem with...]]></description>
      <content:encoded><![CDATA[Gartner's Compliance & Risk Management Research Community met recently and considered what IT managers should do given the economic turmoil spreading around the world.<br />
<br />
What started as a problem with risky mortgages in hot real estate markets in the United States has spread to Wall Street with a devastating impact on the financial health and well being of a number of banks and an insurance company. Each day, the turmoil spreads, first to the equity and commodity markets where investors and speculators attempt to preserve what capital remains. Next, the central banks and governments rush in with an infusion of liquidity in an attempt to keep the money flowing through the world's financial market.<br />
<br />
The media commentary on the current financial crisis sounds the tone that all the laws of economics and free markets no longer apply. The reporters sound as if the next developments will be Mother Nature suspending the laws of physics and gravity. Against this backdrop, CIOs and IT managers wonder, "What do we do?"<br />
<br />
There is no denying that business as usual is not currently happening. To speculate or attempt to deal with the regulatory fallout that will follow this financial crisis is currently a waste of time. The central focus that CIOs must address now is what impact will this financial crisis have on IT in the next budget cycle. Also, how can IT help the enterprise demonstrate trustworthiness to key stakeholders, maintain critical functions that drive revenue and cash flow, and focus on the needs of the people who work for your organization.<br />
<br />
At the heart of the current financial crisis is a lack in confidence in the credit markets. Government officials report that interbank lending has ground to a halt, which prompted the U.S. Federal Reserve to step in on 7 October 2008 and offer direct short term lending to U.S. corporations. <br />
<br />
First, to combat this lack of confidence permeating the market, enterprises should take extraordinary means to increase their financial transparency and demonstrate that they have the ability to meet their obligations to creditors, customers, and the communities where they are located. Senior management must develop and exercise a voice in the public policy dialog immediately - and voluntarily. Do not wait for Congressional subpoenas, shareholder meetings, or ambush interviews by the media. Tell the world, honestly, about the state of your company and its plans for the near term and the long view.<br />
<br />
Second, everyone must develop a laser-like focus on the organization's value proposition, those intangible reasons that define why your enterprise exists. To leverage an old cliché, every oar must be in the water and pulling in the same direction. The goal is not just to make it to the finish line, but to survive. Ancillary or tertiary projects must be postponed for a later time; and tasks that improve customer service, remove friction from processes, and increase cash flow should be top priorities.  <br />
<br />
Finally, think about the people who work for you. No doubt they are scared by the uncertainty about the future. Management must be honest and open in keeping the rank and file apprised of the organization's situation. They should be encouraged to communicate that information in a timely fashion with friends and neighbors in the community. Management should be extremely sensitive to non-work related issues that may have an impact on employee morale and well being. The most obvious is related to housing, mortgage default and potential foreclosure. However, it can extend beyond the most obvious issues. The problem with short-term lending is also having an impact on some governmental agencies, and some school districts are cutting back to only four days of instruction, forcing many parents to scramble and find new daycare arrangements. ]]></content:encoded>
      <pubDate>Fri, 17 Oct 2008 07:38:02 +0000</pubDate>
      <category domain="http://securityratty.com/tag/financial crisis">financial crisis</category>
      <category domain="http://securityratty.com/tag/current financial crisis">current financial crisis</category>
      <category domain="http://securityratty.com/tag/increase cash flow">increase cash flow</category>
      <category domain="http://securityratty.com/tag/increase">increase</category>
      <category domain="http://securityratty.com/tag/central focus">central focus</category>
      <category domain="http://securityratty.com/tag/cash flow">cash flow</category>
      <category domain="http://securityratty.com/tag/focus">focus</category>
      <category domain="http://securityratty.com/tag/senior management">senior management</category>
      <category domain="http://securityratty.com/tag/obvious issues">obvious issues</category>
      <source url="http://blog.gartner.com/blog/security.php?x=0&amp;itemid=3968">Given the Current Economic Turmoil, What Should IT Managers Do?</source>
    </item>
  </channel>
</rss>
