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

<channel>
	<title>Kyrus Technology</title>
	<atom:link href="http://www.kyrus-tech.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.kyrus-tech.com</link>
	<description></description>
	<lastBuildDate>Mon, 20 Feb 2012 16:38:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>NSRLookup Update</title>
		<link>http://www.kyrus-tech.com/archives/702</link>
		<comments>http://www.kyrus-tech.com/archives/702#comments</comments>
		<pubDate>Thu, 09 Feb 2012 14:01:58 +0000</pubDate>
		<dc:creator>Jesse</dc:creator>
				<category><![CDATA[Forensics]]></category>
		<category><![CDATA[People]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.kyrus-tech.com/?p=702</guid>
		<description><![CDATA[I have updated the Kyrus NSRLookup server to use the current version of the NSRL hashes, version 2.35. (Until now we were using a hash set which was slightly out of date and didn't have as many hashes.) You should notice more files matching now,...]]></description>
			<content:encoded><![CDATA[<p>I have updated the Kyrus NSRLookup server to use the current version of the NSRL hashes, version 2.35. (Until now we were using a hash set which was slightly out of date and didn't have as many hashes.) You should notice more files matching now, especially those related to Windows 7. On a related note, *nix users should update their copy of nsrllookup. There was a bug found in version 1.1. The fix is version 1.1-2 and available at http://nsrlquery.sourceforge.net/.</p>
<p>To test the new hash set, I created a Windows 7 virtual machine and hashed all of the files on it. I then submitted all of those files to the Kyrus NSRLookup server, with the following results:<br />
<span style="font-family: courier;"><br />
$ nsrllookup -K known.txt -U unknown.txt -s nsrl.kyr.us &lt; all.txt &amp;&amp;<br />
wc -l *own.txt<br />
40650 known.txt<br />
7567 unknown.txt<br />
48217 total<br />
</span><br />
Of 48,000 input files, 7,600 were unknown. That’s a lot of unknowns! So I made a custom version of md5deep (which will be published soon), which only hashes Windows executables. I then hashed just the Windows executables on my VM and submitted them to the server:<br />
<span style="font-family: courier;"><br />
$ nsrllookup -K known.txt -U unknown.txt -s nsrl.kyr.us &lt; exe.txt &amp;&amp;<br />
wc -l *own.txt<br />
15937 known.txt<br />
291 unknown.txt<br />
16228 total<br />
</span><br />
That's a LOT fewer files overall! We went from a total of 48,000 files to 16,000. That's a dramatic reduction thanks to ignoring non-executable files. Why just executables? Depending on the case type, you may only be looking for executables. In eDiscovery or illicit imagery cases, where the focus is on documents, you are probably better off searching for those file types directly rather than attempting to eliminate everything else. When doing executable analysis, look for executables!</p>
<p>But the real payoff  from this process is that there are only <strong>291</strong> unknown executables! That's actually manageable. Comparing 291 executables against the Malware Hash List is entirely do-able, as is sending the hashes to a service like VirusTotal. (Truth be told, I looked at the filenames of those 291 files, and most of them were part of VMWare.)</p>
<p>If you're champing at the bit to try out searching for executables, you can use another tool I wrote, Miss Identify, http://missidentify.sf.net/, to try it now. As a bonus, that program can generate warning messages when it finds executables which don't have an executable extension.</p>
<p>Finally, like you I have heard the complaints about the NSRL, such as <a href="http://ballinyourcourt.wordpress.com/2011/08/31/de-nisting-defective/" target="_blank">http://ballinyourcourt.wordpress.com/2011/08/31/de-nisting-defective/</a>. I asked the NSRL folks for a comment on the matter and they told me the following:</p>
<blockquote><p>In December 2011 NIST identified a type of container file they were not recursing into when generating the hash sets. Failure to process these container files led to many hashes being omitted from the data set. The latest hash set, produced in January 2012, contains many more files, especially for those files in Windows 7. The next hash set, version 2.36, scheduled to be released in March 2012, will have even more.</p>
<p>They added, "NSRL appreciates ALL feedback from the community. We endeavor to respond in a timely manner, and we encourage you to contact us directly at <a href="mailto:nsrl@nist.gov">nsrl@nist.gov</a> to enable NSRL to turn a solution around within a publication cycle."</p></blockquote>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyrus-tech.com/archives/702/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NSRLookup Service (Beta)</title>
		<link>http://www.kyrus-tech.com/archives/682</link>
		<comments>http://www.kyrus-tech.com/archives/682#comments</comments>
		<pubDate>Wed, 25 Jan 2012 16:02:54 +0000</pubDate>
		<dc:creator>Kyrus</dc:creator>
				<category><![CDATA[Forensics]]></category>
		<category><![CDATA[People]]></category>

		<guid isPermaLink="false">http://www.kyrus-tech.com/?p=682</guid>
		<description><![CDATA[Needle in a Stack of Needles How much of your job as a lethal forensicator is spent searching for needles in haystacks? Known File Filters can be helpful in this regard . . . until the filters get too large to be useful. Reducing the...]]></description>
			<content:encoded><![CDATA[<p><strong>Needle in a Stack of Needles</strong></p>
<p>How much of your job as a lethal forensicator is spent searching for needles in haystacks? Known File Filters can be helpful in this regard . . . until the filters get too large to be useful. Reducing the data set you have to look through in order to find that precious needle (ouch) is one of those Holy Grail problems forensics people have been trying to address for years.</p>
<p><strong>NIST on the Case</strong></p>
<p>NIST is kind enough to distribute the National Software Reference Library (<a href="http://www.nsrl.nist.gov/" target="_blank">NSRL</a>). A collection of hashes of known software (usually provided by vendors themselves), it contains over 78 million hashes, 21 million of which are unique. It is arguably the best resource almost no one uses because 78 million is enough hashes to choke almost any forensics tool you’re using. Go ahead and try it. We’ll wait . . .</p>
<p><strong>One Step Beyond</strong></p>
<p>Starting today we are offering (in Beta) the Kyrus NSRL Lookup Service (NSRLookup), which is based on the hard work of Rob Hansen at <a href="http://www.redjack.com/" target="_blank">Red Jack</a>, who coded <a href="http://nsrlquery.sf.net/" target="_blank">nsrlquery</a>. You can download a Windows binary or the *nix source code at SourceForge. Once installed, you can use the output of Jesse Kornblum’s <a href="http://md5deep.sourceforge.net/" target="_blank">md5deep</a> to query the server. The output can be piped directly:<br />
<span style="font-family: courier;"><br />
C:\&gt; md5deep -r * | nsrllookup -s nsrl.kyr.us<br />
</span><br />
. . . or a saved file can be used<br />
<span style="font-family: courier;"><br />
C:\&gt; md5deep -r * &gt; known.txt<br />
C:\&gt; nsrllookup -s nsrl.kyr.us &lt; known.txt<br />
</span><br />
By default the server responds with the hashes of unknown files. You can get the hashes of known files by adding the -k flag, like this:<br />
<span style="font-family: courier;"><br />
C:\&gt; nsrllookup -s nsrl.kyr.us -k &lt; known.txt<br />
</span><br />
To see a help screen and a list of all command line options, use the -h flag:<br />
<span style="font-family: courier;"><br />
C:\&gt; nsrllookup -h<br />
nsrllookup for Windows version 1.0.6-1<br />
nsrllookup [-hvukx] [-U FILE] [-K FILE] [-s SERVER] [-p PORT]<br />
-h: display this help message<br />
-v: display version information<br />
-u: show only unknown hashes (default)<br />
-k: show only known hashes<br />
-U FILE: write unknown hashes to FILE<br />
-K FILE: write known hashes to FILE<br />
-s SERVER: connect to a specified nsrlquery server<br />
-p PORT: connect on a specified port<br />
</span></p>
<p>Please report bugs in the Sourceforge <a href=" https://sourceforge.net/p/nsrlquery/discussion/" target="_blank">discussion forum</a>.</p>
<p>We hope that NSRLookup proves useful to the forensics community. It isn't quite a “find evidence” button, but with people like Rob trying to tackle the problem, its close. If you’d like to provide us with your feedback, please <a title="NSRLookup Contact Form" href="http://www.kyrus-tech.com/nsrlookup-contact" target="_blank">contact us</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyrus-tech.com/archives/682/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rich Smith at ICS</title>
		<link>http://www.kyrus-tech.com/archives/712</link>
		<comments>http://www.kyrus-tech.com/archives/712#comments</comments>
		<pubDate>Sun, 15 Jan 2012 16:32:11 +0000</pubDate>
		<dc:creator>Kyrus</dc:creator>
				<category><![CDATA[Appearances]]></category>
		<category><![CDATA[People]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.kyrus-tech.com/?p=712</guid>
		<description><![CDATA[Our own Rich Smith attended the Icelandic Computer Society's Smart Phone Security Conference and spoke on Pragmatic Approaches to Breaking Mobile Apps.]]></description>
			<content:encoded><![CDATA[<p>Our own Rich Smith attended the Icelandic Computer Society's <a href="http://www.sky.is/index.php?option=com_content&amp;view=article&amp;id=1778:2012-hversu-oeryggir-eru-snjallsimar&amp;catid=25&amp;Itemid=100074" target="_blank">Smart Phone Security Conference</a> and spoke on <em><a href="http://www.sky.is/images/stories/2012_SkjolOgMyndir/03_OryggiSnjallsimar/Pragmatic_Mobile_App_Sec.pdf" target="_blank">Pragmatic Approaches to Breaking Mobile Apps</a></em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyrus-tech.com/archives/712/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jesse Kornblum at SANS360</title>
		<link>http://www.kyrus-tech.com/archives/658</link>
		<comments>http://www.kyrus-tech.com/archives/658#comments</comments>
		<pubDate>Thu, 08 Dec 2011 14:48:11 +0000</pubDate>
		<dc:creator>Kyrus</dc:creator>
				<category><![CDATA[Appearances]]></category>
		<category><![CDATA[Forensics]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[People]]></category>

		<guid isPermaLink="false">http://www.kyrus-tech.com/?p=658</guid>
		<description><![CDATA[On Tuesday December 13th, Kyrus' Research Guru Jesse Kornblum will be presenting Artificial Intelligence in Computer Forensics at the SANS360 Digital Forensics and Incident Response Lightning Talk at the Hilton Washington &#38; Towers. From the SANS site: In one hour these Digital Forensics and Incident...]]></description>
			<content:encoded><![CDATA[<p>On Tuesday December 13th, Kyrus' Research Guru Jesse Kornblum will be presenting Artificial Intelligence in Computer Forensics at the <a href="https://computer-forensics.sans.org/sans360/dec2011/" target="_blank">SANS360 Digital Forensics and Incident Response Lightning Talk </a>at the Hilton Washington &amp; Towers.</p>
<p>From the SANS site:</p>
<blockquote><p>In one hour these Digital Forensics and Incident Response experts will discuss the coolest techniques and solutions they have discovered in 2011. If you have never been to a lightning talk it is an eye opening experience. Each speaker has 360 seconds (6 minutes) to deliver their message. This format allows SANS to present 10 experts within one hour, instead of the standard one presenter per hour. The compressed format gives you a clear and condensed message eliminating the fluff. If the topic isn't engaging, a new topic is just 6 minutes away.</p></blockquote>
<p>If you cannot attend in person, you can watch the simulcast by registering at:</p>
<pre><a href="https://www.sans.org/webcasts/digital-forensics-incident-response-lightning-talk-%96-live-webcast-94919">https://www.sans.org/webcasts/digital-forensics-incident-response-lightning-talk-%96-live-webcast-94919</a></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kyrus-tech.com/archives/658/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>We Are Our Own Worst Enemy</title>
		<link>http://www.kyrus-tech.com/archives/654</link>
		<comments>http://www.kyrus-tech.com/archives/654#comments</comments>
		<pubDate>Thu, 01 Dec 2011 14:56:14 +0000</pubDate>
		<dc:creator>Kyrus</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[People]]></category>

		<guid isPermaLink="false">http://www.kyrus-tech.com/?p=654</guid>
		<description><![CDATA[My op-ed on improving our industry by applying a little discipline is up at SC Magazine. It is tough being in cybersecurity. Defense is a cost center, and it's hard to find meaningful metrics to demonstrate success. Interest in security is also cyclical: Major breaches...]]></description>
			<content:encoded><![CDATA[<p>My op-ed on improving our industry by applying a little discipline is up at <a href="http://www.scmagazineus.com/we-are-our-own-worst-enemy/article/217168/" target="_blank">SC Magazine</a>.</p>
<blockquote><p>It is tough being in cybersecurity. Defense is a cost center, and it's hard to find meaningful metrics to demonstrate success. Interest in security is also cyclical: Major breaches stir action, but as time passes, interest and resources wane, though the threat is still there. Yet the biggest problem with cybersecurity is ourselves. Before we can succeed, all of us must agree to change.</p></blockquote>
<p>Read the full article <a href="http://www.scmagazineus.com/we-are-our-own-worst-enemy/article/217168/" target="_blank">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyrus-tech.com/archives/654/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Thoughts on &#039;Automated Synthesis of Symbolic Instruction Encodings from I/O Samples&#039;</title>
		<link>http://www.kyrus-tech.com/archives/645</link>
		<comments>http://www.kyrus-tech.com/archives/645#comments</comments>
		<pubDate>Thu, 10 Nov 2011 02:30:31 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Research]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.kyrus-tech.com/?p=645</guid>
		<description><![CDATA[Some interesting research by Patrice Godefroid: http://research.microsoft.com/apps/pubs/default.aspx?id=156020 The gist: I want to build a model of what each CPU instruction does in an unguided (completely automated) manner. we'll do it by having the CPU execute instructions and observing their side effects. this lets us build...]]></description>
			<content:encoded><![CDATA[<p>Some interesting research by Patrice Godefroid:</p>
<p><a href="http://research.microsoft.com/apps/pubs/default.aspx?id=156020">http://research.microsoft.com/apps/pubs/default.aspx?id=156020</a></p>
<p>The gist: I want to build a model of what each CPU instruction does in an unguided (completely automated) manner. we'll do it by having the CPU execute instructions and observing their side effects. this lets us build a "very good" model of what each instruction does.</p>
<p>The problem is how do I have input samples that can let me see everything? i.e. what if add is fine for integers from 0 to 1000000 but at 1000001 there is a problem? "the only way to find out is to exhaust" you say, that is, exhaustively try every possible input value (and every combination of input values).</p>
<p>That sucks. They have an algorithm that lets them do it "smarter". I'm still deciphering it, it's in the paper.</p>
<p>This is interesting to me because you can consider each instruction as a "function" and when you say "oh I have a way to reason about these functions reactions to certain inputs", ears should perk up.</p>
<p>Anyway, some results:</p>
<blockquote><p>"We also discovered cases where observed behaviors contradict the x86 reference manual (which is unsurprising given the size and complexity of the spec). For instance, we discovered by accident while debugging our template T -ARImain that the overflow OF flag should be set to 0 after executing IMUL[8] with 65 and 254 as inputs according to the Intel spec, while the OF flag is actually set to 1 after the execution of this instruction with those inputs on an Intel XEON3.7 processor.</p>
<p>Moreover, we discovered, again by accident, that the semantics of instruction varies across Intel processors. For instance, on an Intel XEON3.7 or Core2 or i7 M620 processors and in accordance with the x86 spec, executing instructions ROL, SHL or SHR does not set the overflow OF flag if the count argument is not 1. However, on an Intel i7-2620M processor (HP EliteBook 2760p, 2.7Ghz, 8Gb RAM, 64-bit) processor, the OF flag is set to 1 even for certain   cases when the count argument is greater than 1. Our template T -BSf lag is actually unable to capture this behavior, which is why we detected these corner cases.</p>
<p>Finally, and unsurprisingly, we also discovered several errors in previous manually-written x86 instruction handlers used in the whitebox fuzzer SAGE [5]"</p></blockquote>
<p>We discovered something similar with the shift/rotate instructions while implementing a project of our own (I forget the exact details, but I think it had to do with rotating by more than the register width would "still work" even though that case wasn't covered in the intel documentation). if you can put infrastructure like this together, you can discover interesting things about CPUs.</p>
<p>And of course, if you see some malware doing something "weird seeming" with instructions, you could perhaps infer that they were trying to do something like fingerprint what CPU they were on or flummox static analysis tools doing  instruction-level emulation, and then you could infer that whoever wrote the malware might have had enough time on their hands to come to grips with works like this paper.</p>
<p>The downside to being able to make that inference is I'm sure if you know just that much, you'll be super quick to blame anything "weird looking" on "oh I bet they're doing some super awesome per-cpu heuristic etection thingy" when really it's just some behavior you've never seen before. there has to be a word for that thought trap ...</p>
<p>And of course, there is prior academic work in discovering discrepancies between the docs and the reality, these people did it too: <a href="http://www.cl.cam.ac.uk/~pes20/weakmemory/index3.html">http://www.cl.cam.ac.uk/~pes20/weakmemory/index3.html</a> there are some similarities between the Cambridge approach and the MS research approach, but, the Cambridge model of the CPU is built by hand (as I recall) and the thing the MS research model brings to the table is the automated building of the model.</p>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.kyrus-tech.com/archives/645/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shortage of People or Ideas?</title>
		<link>http://www.kyrus-tech.com/archives/640</link>
		<comments>http://www.kyrus-tech.com/archives/640#comments</comments>
		<pubDate>Tue, 25 Oct 2011 16:32:46 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.kyrus-tech.com/?p=640</guid>
		<description><![CDATA[Is there really a shortage of cyber security experts, as this article would suggest, or are there hindrances to hiring the available experts into government positions? On only need to do a cursory search for all the people with cyber security experience and credentials (a...]]></description>
			<content:encoded><![CDATA[<p>Is there really a shortage of cyber security experts, as <a href="http://www.defensenews.com/" target="_blank">this article</a> would suggest, or are there hindrances to hiring the available experts into government positions? On only need to do a cursory search for all the people with cyber security experience and credentials (a topic for another day) who are looking for work to say that it is pretty clear that the latter statement is more accurate than the former.</p>
<p>Regardless of whose numbers you use, the cyber security market is measured in tens of billions of dollars. Cyber security is where the food is, to paraphrase an old <a href="http://www.samkinison.org/" target="_blank">Sam Kinison</a> routine, and people are flocking to it. What most of the best practitioners are not prepared to flock to is the paperwork, bureaucracy and (frankly) bulls*** that is par for the course for government work. There is a lot of cool work in the government, some things only the government can do, but the government is not for everyone.</p>
<p>Even if the government could get as many people as it needed to improve security, why do some think that throwing more bodies at the problem is the only way to ‘scale’ to address the issues? Throwing bodies at a problem stopped being a successful strategy back when the attrition warfare model went out of vogue. Better security isn’t going to come with a rise in the size of the ranks; it will come when we have in place models that let security mechanisms scale to match security threats.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyrus-tech.com/archives/640/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jesse Kornblum: Clustering and Classification</title>
		<link>http://www.kyrus-tech.com/archives/583</link>
		<comments>http://www.kyrus-tech.com/archives/583#comments</comments>
		<pubDate>Mon, 17 Oct 2011 13:10:47 +0000</pubDate>
		<dc:creator>Jesse</dc:creator>
				<category><![CDATA[Appearances]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[People]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.kyrus-tech.com/?p=583</guid>
		<description><![CDATA[Building on his research into fuzzy hashing and issues related to similarity, Jesse recently presented Clustering and Classification for Cyber Crime, the slides of which you can download here.]]></description>
			<content:encoded><![CDATA[<p>Building on his research into fuzzy hashing and issues related to similarity, Jesse recently presented <em>Clustering and Classification for Cyber Crime</em>, the slides of which <a title="Clustering and Classification Slides (PDF)" href="http://www.kyrus-tech.com/wp-content/uploads/2011/10/Clustering-and-Classification.pdf">you can download here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyrus-tech.com/archives/583/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Kelihos Botnet Takedown</title>
		<link>http://www.kyrus-tech.com/archives/575</link>
		<comments>http://www.kyrus-tech.com/archives/575#comments</comments>
		<pubDate>Tue, 27 Sep 2011 20:14:28 +0000</pubDate>
		<dc:creator>Kyrus</dc:creator>
				<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://www.kyrus-tech.com/?p=575</guid>
		<description><![CDATA[We felt privileged when we were asked to participate in this endeavor: On Sept. 22nd, Microsoft filed for an ex parte temporary restraining order from the U.S. District Court for the Eastern District of Virginia against Dominique Alexander Piatti, dotFREE Group SRO and John Does 1-22. The court granted...]]></description>
			<content:encoded><![CDATA[<p>We felt privileged when we were asked to participate in <a title="Microsoft Neutralizes Kelihos Botnet, Names Defendant in Case" href="http://blogs.technet.com/b/microsoft_blog/archive/2011/09/27/microsoft-neutralizes-kelihos-botnet-names-defendant-in-case.aspx">this endeavor</a>:</p>
<blockquote><p>On Sept. 22<sup>nd</sup>, Microsoft <a href="http://blogs.technet.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-80-54/8311.Kelihos-Botnet-Declaration.pdf">filed</a> for an ex parte temporary restraining order from the U.S. District Court for the Eastern District of Virginia against Dominique Alexander Piatti, dotFREE Group SRO and John Does 1-22. The court granted our request, allowing us to sever the known connections between the Kelihos botnet and the individual “zombie computers” under its control. Immediately following the takedown on Sept. 26<sup>th</sup>, we served Dominique Alexander Piatti, who was living and operating his business in the Czech Republic, and dotFREE Group SRO, with notice of the lawsuit and began discussions with Mr. Piatti to determine which of his subdomains were being used for legitimate business, so we could get those customers back online as soon as possible. We are also beginning our efforts to notify the other John Doe defendants in this case, and will be actively continuing our investigation to find out more about the people behind this botnet.</p></blockquote>
<p>...and we're proud that we had a role in making this happen.</p>
<p>Read the full post at the <a title="The Official Microsoft Blog" href="http://blogs.technet.com/b/microsoft_blog/archive/2011/09/27/microsoft-neutralizes-kelihos-botnet-names-defendant-in-case.aspx">MS Blog</a>.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyrus-tech.com/archives/575/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Destructive Nature of Compiler Optimizations</title>
		<link>http://www.kyrus-tech.com/archives/536</link>
		<comments>http://www.kyrus-tech.com/archives/536#comments</comments>
		<pubDate>Fri, 26 Aug 2011 11:31:44 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.kyrus-tech.com/?p=536</guid>
		<description><![CDATA[This is something that occurred to me while I was researching something else and I thought people might be interested in it. kind of a short essay / demonstration of awesome things that happen when abstract programming languages intersect with "rubber on the road" running code... Consider the following...]]></description>
			<content:encoded><![CDATA[<p>This is something that occurred to me while I was researching something else and I thought people might be interested in it. kind of a short essay / demonstration of awesome things that happen when abstract programming languages intersect with "rubber on the road" running code...</p>
<p>Consider the following two functions:</p>
<pre>void copyBytes(char *dst, char *src, size_t len) {
    if( len == 0 ) {
        return;
    } else {
        *dst = *src;
        return copyBytes(++dst, ++src, --len);
    }
}</pre>
<pre>void copyBytes2(char * dst, char *src, size_t len) {
    size_t copied = len;
    char *d = dst;
    char *s = src;

    while( copied &gt; 0 ) {
        *d = *s;
        d++;
        s++;
        copied--;
    }

    return;
}</pre>
<p>The question is, what do these functions do? Consider them for a few minutes before continuing (please).</p>
<p>So, they both pretty obviously copy memory. copyBytes performs the copy recursively, while copyBytes2 performs it iteratively. So, lets think about "what do these functions do" in terms of side effects.</p>
<p>Both result in "len" bytes from "src" moving to "dst". Simple enough, case closed, right? They're the same! Wait a minute though, copyBytes works recursively, this means that an additional side effect is for every byte copied, the stack pointer is decremented enough to create a new frame. Stack space is a limited resource, so, if you were copying a lot of data, copyBytes has the potential to exhaust stack space, resulting in the termination of that thread.</p>
<p>So, they're not the same?</p>
<p>Alright, compile it, test it, wait a minute, they are both capable of copying for large values of "len". Whats up?</p>
<p>So lets feed these 2 functions to LLVM, on two different optimization levels, to REALLY dig into this:</p>
<p>copyBytes with no opts:</p>
<p><a href="http://www.kyrus-tech.com/wp-content/uploads/2011/08/copyBytes-norec2.jpg"><img class="aligncenter size-full wp-image-555" src="http://www.kyrus-tech.com/wp-content/uploads/2011/08/copyBytes-norec2.jpg" alt="" width="851" height="552" /></a><br />
copyBytes2 with no opts:</p>
<p><a href="http://www.kyrus-tech.com/wp-content/uploads/2011/08/copyBytes2-norec.jpg"><img class="aligncenter size-full wp-image-556" src="http://www.kyrus-tech.com/wp-content/uploads/2011/08/copyBytes2-norec.jpg" alt="" width="751" height="600" /></a></p>
<p>copyBytes with -O1 LLVM opts:</p>
<p><a href="http://www.kyrus-tech.com/wp-content/uploads/2011/08/copyBytes.jpg"><img class="aligncenter size-full wp-image-557" src="http://www.kyrus-tech.com/wp-content/uploads/2011/08/copyBytes.jpg" alt="" width="680" height="587" /></a><br />
copyBytes2 with -O1 LLVM opts:</p>
<p><a href="http://www.kyrus-tech.com/wp-content/uploads/2011/08/copyBytes2.jpg"><img class="aligncenter size-full wp-image-558" src="http://www.kyrus-tech.com/wp-content/uploads/2011/08/copyBytes2.jpg" alt="" width="755" height="587" /></a></p>
<p>(LLVM IR is documented here: <a href="http://www.llvm.org/docs/LangRef.html" target="_blank">http://www.llvm.org/docs/LangRef.html</a> but this is short enough and non-weird enough that a lot of it should be pretty clear on its own)</p>
<p>So with no opts, copyBytes demonstrates the recursive behavior we expect. When we look at the IR for the "slightly" optimized version, we see the optimized has recognized how to optimize tail-call recursion into iterative logic, and that the resulting iterative logic is in fact EXACTLY the same as the source code that is explicitly iterative. The kind of interesting thing is that you can line up the two LLVM IR control flow graphs for the optimized functions and <em>prove</em> they are the same by comparing their side effects. The order, width, and count of loads and stores are identical.</p>
<p>So ... what controls whether or not these two functions express different behavior? Compiler optimization levels. So... people who audit source code... what exactly are you auditing? Usually, people are auditing what the compiled code will ACTUALLY DO and not really the code as written, because you really care about what the code actually does. This tells us, pretty conclusively, that to understand what code does you also have to have a very clear understanding of how it is compiled and what goes into its compilation.</p>
<p>So ... everyone who is (or was) focused on automated ways to verify C code ... have fun! When you're evaluating the sanity of some code, you're talking about something more meta-level than C...</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kyrus-tech.com/archives/536/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

