<?xml version="1.0" encoding="utf-8" ?>

<rss version="2.0" 
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:admin="http://webns.net/mvcb/"
   xmlns:dc="http://purl.org/dc/elements/1.1/"
   xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
   xmlns:wfw="http://wellformedweb.org/CommentAPI/"
   xmlns:content="http://purl.org/rss/1.0/modules/content/"
   xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">
<channel>
    <title>Dominic White - Security</title>
    <link>http://singe.za.net/blog/</link>
    <description>.tHE pRODUCT - Security &amp; Privacy Blog</description>
    <dc:language>en</dc:language>
    <generator>Serendipity 1.5-beta1 - http://www.s9y.org/</generator>
    <managingEditor>webmaster@singe.rucus.net</managingEditor>
<webMaster>webmaster@singe.rucus.net</webMaster>
<ttl>2160</ttl>
<pubDate>Tue, 02 Feb 2010 09:25:28 GMT</pubDate>

    <image>
        <url>http://singe.za.net/pics/links/tHEpRODUCT-blue.gif</url>
        <title>RSS: Dominic White - Security - .tHE pRODUCT - Security &amp; Privacy Blog</title>
        <link>http://singe.za.net/blog/</link>
        <width>120</width>
        <height>29</height>
    </image>

<item>
    <title>Breach at iContact exposes my (and your) details to Spammers</title>
    <link>http://singe.za.net/blog/archives/995-Breach-at-iContact-exposes-my-and-your-details-to-Spammers.html</link>
            <category>Security</category>
    
    <comments>http://singe.za.net/blog/archives/995-Breach-at-iContact-exposes-my-and-your-details-to-Spammers.html#comments</comments>
    <wfw:comment>http://singe.za.net/blog/wfwcomment.php?cid=995</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://singe.za.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=995</wfw:commentRss>
    

    <author>nospam@example.com (Dominic White)</author>
    <content:encoded>
    &lt;p&gt;This week something special happened, something I&#039;d been saving for the right person, something magical. Today, hackers took my private data. Everything&#039;s changed, I feel like a part of the world, connected to so many other people who have shared in this experience. Today, I&#039;m a woman! (Ok, I may have gone a bit far with that last bit)&lt;/p&gt; 
&lt;p&gt;The skinny is that I use unique e-mail addresses for each service provider that I want to continue communicating with (for the ones I don&#039;t I use one-shot addresses). I noticed on the weekend that I was being deluged with pharmaceutical spam to three of these addresses, namely my Threadsy, Numbuzz &amp;amp; Share-it (via a product I bought there, ChatterBlocker) contacts. This lead me &lt;a href=&quot;https://twitter.com/singe/status/8489242055&quot;&gt;to tweet&lt;/a&gt;: &amp;quot;&lt;span class=&quot;status-body&quot;&gt;&lt;span class=&quot;entry-content&quot;&gt;Either a security or ethics breach at @&lt;a class=&quot;tweet-url username&quot; href=&quot;https://twitter.com/threadsy&quot;&gt;threadsy&lt;/a&gt; &amp;amp; @&lt;a class=&quot;tweet-url username&quot; href=&quot;https://twitter.com/nimbuzz&quot;&gt;nimbuzz&lt;/a&gt; Getting Viagra spammed hard on the unique e-mail addresses I gave them.&amp;quot;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt; &lt;p&gt;Chatterblocker got back to me with the equivalent of &amp;quot;What? Wasn&#039;t me.&amp;quot; &lt;span class=&quot;fn&quot;&gt;&lt;a title=&quot;Skott Kendall&quot; href=&quot;http://dskendall.com/&quot;&gt;Scott Kendall&lt;/a&gt; from Threadsy jumped into an investigation however and contacted me for more details. He also passed on results of his investigation to Nimbuzz, much kudos. Scott then &lt;a href=&quot;https://twitter.com/dskendall/status/8516192689&quot;&gt;informed me this morning&lt;/a&gt; that there has been a &lt;a title=&quot;Breach Notification from iContact&quot; href=&quot;http://www.icontact.com/blog/index.php?blog=1&amp;amp;p=401&amp;amp;more=1&amp;amp;c=1&amp;amp;tb=1&amp;amp;pb=1&quot;&gt;breach at iContact&lt;/a&gt;, evidently a shared service provider to the affected entities, resulting in the theft of customer contact details that must have been sold to spammers (or by a horizontally integrated crime crew). We&#039;re assured by iContact that only our e-mail addresses were stolen. However, we&#039;re not given any reason to believe that; unless the data is segmented somehow I don&#039;t see why an attacker wouldn&#039;t take the whole caboodle.&lt;/span&gt;&lt;/p&gt; 
&lt;p&gt;What concerns me is first that I wasn&#039;t even aware I had a relationship with iContact. A quick look of the websites of Threadsy and Nimbuzz don&#039;t make reference to them apart from the generic &amp;quot;we may share your data with business relevant third parties&amp;quot; in the privacy policy. Even if it is made explicit in the privacy policy, it doesn&#039;t mean you understand it, take this &lt;a href=&quot;http://mathiasbynens.be/examples/facebook-friends&quot;&gt;Facebook friendlist leak&lt;/a&gt; for example. Maybe if we had a &amp;quot;&lt;a title=&quot;Nutritional Label for Privacy&quot; href=&quot;http://cups.cs.cmu.edu/soups/2009/proceedings/a4-kelley.pdf&quot;&gt;nutritional label for privacy&lt;/a&gt;&amp;quot; with disclosure of who the third parties were I would feel more in control of my data and more importantly the decisions I make.&lt;br /&gt;&lt;/p&gt; 
&lt;p&gt;Second, I&#039;m not aware what data of mine had been given to iContact and what could potentially be at risk. Was it just my contact details, or did it include behavioural data too? Even if I can&#039;t do anything about it, I&#039;d like to know what was breached with some solid factual basis. More importantly, I&#039;d like to see what is shared with the third-party up front. I believe the small externality of writing that down in human readable and explicit form may encourage service providers to limit it.&lt;/p&gt; 
&lt;p&gt;Third, this was a consumer-lead breach-discovery. People with custom e-mail addresses tracked the source and informed iContact they had a breach. We see the same thing with credit card breaches, and with the likes of Google notifying other companies that the APT (do I get points for using it?) got them too. Is it any wonder those are the breaches we see frequently reported. IT shops usually aren&#039;t aware they&#039;ve been breached until an affected third party tells them.&lt;br /&gt;&lt;/p&gt; 
&lt;p&gt;In conclusion, if you&#039;re getting spammed hard with pharmaceutical spam, this is probably why. There&#039;s nothing you can do about it, and there&#039;s probably a near infinite number of variations of your private (by which I mean data you don&#039;t want publicly exposed) data floating around at service providers you know nothing about that doesn&#039;t have the same canary-in-a-mine like properties that can make you (and hence the service provider) aware of the breach. Good luck.&lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 02 Feb 2010 08:25:09 +0200</pubDate>
    <guid isPermaLink="false">http://singe.za.net/blog/archives/995-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
</item>
<item>
    <title>Brain Krebs Leaves The Washington Post</title>
    <link>http://singe.za.net/blog/archives/992-Brain-Krebs-Leaves-The-Washington-Post.html</link>
            <category>Security</category>
    
    <comments>http://singe.za.net/blog/archives/992-Brain-Krebs-Leaves-The-Washington-Post.html#comments</comments>
    <wfw:comment>http://singe.za.net/blog/wfwcomment.php?cid=992</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://singe.za.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=992</wfw:commentRss>
    

    <author>nospam@example.com (Dominic White)</author>
    <content:encoded>
    &lt;p&gt;Brian Krebs, author of &lt;a title=&quot;SecurityFix&quot; href=&quot;http://voices.washingtonpost.com/securityfix/&quot;&gt;SecurityFix&lt;/a&gt; and one of the very few mainstream infosec journalists, is pulling a McLeodd&lt;sup&gt;&lt;a title=&quot;Footnote1&quot; href=&quot;#foot1&quot;&gt;1&lt;/a&gt;&lt;/sup&gt; and leaving the Washington Post to go on his own. He will be reporting from &lt;a tite=&quot;Krebs on Security&quot; href=&quot;http://www.krebsonsecurity.com/&quot;&gt;Krebs on Security&lt;/a&gt; from today.&lt;/p&gt; 
&lt;p&gt;Apart from the coverage, Brian has also got involved in or instigated responses to some threats, and I hope that fewer editorial restrictions allow him to do and say more.&lt;/p&gt; 
&lt;p&gt;In truth, I only really like Brian because he&#039;s &lt;a title=&quot;The Worm Business&quot; href=&quot;http://voices.washingtonpost.com/securityfix/2005/08/the_worm_business_1.html&quot;&gt;linked&lt;/a&gt;, &lt;a title=&quot;More MS Patch Data&quot; href=&quot;http://voices.washingtonpost.com/securityfix/2006/01/more_ms_patch_data.html&quot;&gt;to me&lt;/a&gt; before, encouraging up to 1.5 people to read the abstract on &lt;a href=&quot;/masters/thesis&quot; title=&quot;Limiting Vulnerability Exposure Through Effective Patch Management&quot;&gt;my thesis&lt;/a&gt; ;), but more seriously providing data and inspiration to me and several other researchers.&lt;/p&gt; 
&lt;p&gt;Good luck Brian&lt;/p&gt; &lt;small&gt;&lt;a id=&quot;foot1&quot;&gt;Footnote 1&lt;/a&gt;: I probably shouldn&#039;t mix my ZA and Infosec references, but Duncan McLeodd left the Financial Mail to form independent tech news startup &lt;a title=&quot;TechCentral&quot; href=&quot;http://www.techcentral.co.za/&quot;&gt;TechCentral&lt;/a&gt;.&lt;/small&gt;  
    </content:encoded>

    <pubDate>Wed, 30 Dec 2009 08:48:34 +0200</pubDate>
    <guid isPermaLink="false">http://singe.za.net/blog/archives/992-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
</item>
<item>
    <title>&quot;Up to Date&quot; isn't the same as &quot;Knowledgeable&quot;</title>
    <link>http://singe.za.net/blog/archives/990-Up-to-Date-isnt-the-same-as-Knowledgeable.html</link>
            <category>Security</category>
    
    <comments>http://singe.za.net/blog/archives/990-Up-to-Date-isnt-the-same-as-Knowledgeable.html#comments</comments>
    <wfw:comment>http://singe.za.net/blog/wfwcomment.php?cid=990</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://singe.za.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=990</wfw:commentRss>
    

    <author>nospam@example.com (Dominic White)</author>
    <content:encoded>
    &lt;p&gt;Eugene Spafford has a warning for us in his &lt;a title=&quot;An old canard reappears, sort of&quot; href=&quot;http://www.cerias.purdue.edu/site/blog/post/an_old_canard_reappears_sort_of/&quot;&gt;latest entry&lt;/a&gt; that I thought worth remembering:&lt;/p&gt; 
&lt;blockquote&gt; 
&lt;p&gt;Generally, hackers who specialize in the latest attacks dismiss anyone not versed in their tools as ignorant, so I have heard this kind of criticism before. It is still the case that the &amp;quot;elite&amp;quot; hackers who specialize in the latest penetration tools think that they are the most informed about all things security. Sadly, some decision-makers believe this too, much to their later regret, usually because they depend on penetration analysis as their primary security mechanism.&lt;/p&gt; 
&lt;/blockquote&gt; 
&lt;p&gt;In many ways, I worry that mechanisms like RSS &amp;amp; twitter and the associated behaviour help us to be up to date, but not knowledgeable, and that the implied arrogance of being up to date stops us from realising it.&lt;/p&gt;  
    </content:encoded>

    <pubDate>Mon, 14 Dec 2009 07:39:10 +0200</pubDate>
    <guid isPermaLink="false">http://singe.za.net/blog/archives/990-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
</item>
<item>
    <title>ZaCon - Information Security for the Rest of Us</title>
    <link>http://singe.za.net/blog/archives/988-ZaCon-Information-Security-for-the-Rest-of-Us.html</link>
            <category>Security</category>
    
    <comments>http://singe.za.net/blog/archives/988-ZaCon-Information-Security-for-the-Rest-of-Us.html#comments</comments>
    <wfw:comment>http://singe.za.net/blog/wfwcomment.php?cid=988</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://singe.za.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=988</wfw:commentRss>
    

    <author>nospam@example.com (Dominic White)</author>
    <content:encoded>
    &lt;p&gt;
Update: Haroon&#039;s talk &amp;quot;&lt;a href=&quot;http://www.vimeo.com/7857004&quot; title=&quot;Haroon Meer &amp;quot;Why ZaCon&amp;quot; on Vimeo&quot;&gt;Why ZaCon&lt;/a&gt;&amp;quot; at the con provides more of an overview. Including some aspects I didn&#039;t consider.&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Our first South Africa fledgling &lt;a href=&quot;http://en.wikipedia.org/wiki/Unconference&quot; title=&quot;Wikipedia&quot;&gt;unconference&lt;/a&gt;-like security conference, &lt;a href=&quot;http://zacon.org.za/&quot;&gt;ZaCon&lt;/a&gt;, takes place this Saturday (21 Nov). Our intention was to have something which fits in the gap between corporate conferences like the &lt;a href=&quot;http://ww2.itweb.co.za/events/securitysummit/2009/&quot; title=&quot;ITWeb&quot;&gt;ITWeb security summit&lt;/a&gt; and academic conferences like &lt;a href=&quot;http://www.infosecsa.co.za/&quot; title=&quot;Information Security South Africa&quot;&gt;ISSA&lt;/a&gt;. The former is huge and can afford to bring over some of the big names, but also has plenty of &amp;quot;paid for&amp;quot; opinions and a sometimes less meaty content. The latter is peer-reviewed and requires more than a slide deck and a grin to present at, but also sometimes values theory over pragmatism and places a large burden on people already holding down a job.&lt;br /&gt;&lt;/p&gt; &lt;p&gt;And so ZaCon was born, a security conference both &amp;quot;for security geeks by security geeks&amp;quot; and open to new entrants to the industry. It&#039;s on a Saturday, on purpose, you don&#039;t get a free day off work. It&#039;s also non-aligned, giving speakers the freedom to say what they want, how they want, and also preventing us from having to push agendas in return for money, or people attending so they can be seen in the right places.&lt;/p&gt; 
&lt;p&gt;None of this is a middle finger to ITWeb, ISSA, vendors, security companies etc. It serves to outline what we felt was a need, and how we plan on meeting it. We will continue to contribute and support the other conferences, and most of us work for security companies anyway.&lt;/p&gt; 
&lt;p&gt;The &lt;a href=&quot;http://zacon.org.za/cfp.html&quot;&gt;CFP&lt;/a&gt; had a &lt;a href=&quot;http://zacon.org.za/programme-09.html&quot;&gt;great response&lt;/a&gt;, we&#039;ve managed to secure a &lt;a href=&quot;http://zacon.org.za/venue-09.html&quot;&gt;killer venue&lt;/a&gt; (&lt;a href=&quot;http://zacon.org.za/directions.html&quot;&gt;directions&lt;/a&gt;) thanks to the&lt;a href=&quot;http://www.uj.ac.za/&quot;&gt; University of Johannesburg&lt;/a&gt; and their &lt;a href=&quot;http://www.uj.ac.za/csweb/Home/tabid/764/Default.aspx&quot;&gt;&lt;font face=&quot;Arial, Helvetica, sans-serif&quot;&gt;&lt;font size=&quot;2&quot;&gt;Academy for Information Technology&lt;/font&gt;&lt;/font&gt;&lt;/a&gt;, we&#039;re getting more coverage than we deserve from &lt;a href=&quot;http://www.discussit.co.za/&quot;&gt;DiscussIT&lt;/a&gt;, should have full video/audio+slides to distribute afterwards and even have free wifi courtesy of &lt;a href=&quot;http://www.is.co.za/hotspots/Hotspot.htm&quot;&gt;IS AlwaysOn Hotspots&lt;/a&gt;.&lt;br /&gt;&lt;/p&gt; 
&lt;p&gt;All in all, apart from the expected teething problems, I&#039;m expecting an awesome day of security geekery. If that interests you, then details are available at &lt;a href=&quot;http://zacon.org.za/&quot;&gt;the site&lt;/a&gt;. Please remember to RSVP to rsvp-@-zacon-org-za if you&#039;ll be attending. If you can&#039;t make it, follow the &lt;a href=&quot;http://twitter.com/zacon09&quot;&gt;zacon09&lt;/a&gt; twitter feed (or &lt;a href=&quot;http://search.twitter.com/search?q=%23zacon&quot;&gt;#zacon&lt;/a&gt; hashtag) for coverage and I&#039;ll see if I can get a liveblog or two in. We&#039;re hoping to publish full Defcon-style video of each talk too.&lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Thu, 19 Nov 2009 09:50:46 +0200</pubDate>
    <guid isPermaLink="false">http://singe.za.net/blog/archives/988-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
</item>
<item>
    <title>Efficient extraction of data using binary search and ordering information</title>
    <link>http://singe.za.net/blog/archives/989-Efficient-extraction-of-data-using-binary-search-and-ordering-information.html</link>
            <category>Security</category>
    
    <comments>http://singe.za.net/blog/archives/989-Efficient-extraction-of-data-using-binary-search-and-ordering-information.html#comments</comments>
    <wfw:comment>http://singe.za.net/blog/wfwcomment.php?cid=989</wfw:comment>

    <slash:comments>0</slash:comments>
    <wfw:commentRss>http://singe.za.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=989</wfw:commentRss>
    

    <author>nospam@example.com (Dominic White)</author>
    <content:encoded>
    &lt;p&gt;&lt;em&gt;I&#039;m quite excited and honoured to host a guest entry from Yusuf Moosa Motara covering his talk at ZaCon (a video of which can be found &lt;a href=&quot;http://www.vimeo.com/7866525&quot; title=&quot;Yusuf Motara @ ZaCon on Vimeo&quot;&gt;here&lt;/a&gt;, and the slides &lt;a href=&quot;/utils/yusuf/Efficient%20extraction%20of%20text%20using%20binary%20search%20and.pptx&quot; title=&quot;PowerPoint&quot;&gt;here&lt;/a&gt;).&lt;/em&gt; &lt;/p&gt; 
&lt;p&gt;&lt;br /&gt;&lt;/p&gt; &lt;h2&gt;Caveat&lt;/h2&gt; 
&lt;p&gt;I make no claims about the novelty of this technique.  For all I know, it&#039;s been widely known for some time, but I could find no record of it.  The target server is SQL Server in this text, but the technique is applicable to other implementations.  If nobody else bothers to claim it, I hereby name the technique after myself: nothing impresses random chicks quite as much as having an obscure and totally-irrelevant-to-their-lives technique named after oneself, after all.&lt;/p&gt; 
&lt;p&gt;On second thought -- call it whatever you want to ;).&lt;/p&gt; 
&lt;h2&gt;Background&lt;/h2&gt; 
&lt;p&gt;Some injection points are worse candidates than others.  A difficult injection point is found in the ORDER BY clause of a SQL statement, since there can be no further statement after an ORDER BY and our only real &amp;quot;in&amp;quot; is the ability to put in expressions, though those expressions may do nothing more than change the resulting order.  Such a change of ordering does provide us with a 1-bit channel to slip data along.  We could do so a simple manner:&lt;/p&gt; 
&lt;pre&gt;[...] ORDER BY case when (select top 1 substring(username,1,1) from
users)=&amp;lt;91&amp;gt;a&amp;lt;92&amp;gt; then ID else Address end&lt;/pre&gt; 
&lt;p&gt;... but a quick examination will tell us that the time taken to extract data with this technique is around 0.5*/n/*/m/, where /n/ is the length of the data, and /m/ is the size of the alphabet, assuming that (on average) the correct character is found after half the search-space has been traversed.  Reordering the character test order in accordance with the frequencies that we expect to find in the text can yield better results, but not results that are significantly better.&lt;/p&gt; 
&lt;h2&gt;A better way&lt;/h2&gt; 
&lt;p&gt;We can do more than directly compare letters: we can get ordering information out.  This allows us to use a binary search algorithm to find the correct text efficiently.  In other words, we can use a query similar to:&lt;/p&gt; 
&lt;pre&gt;[...] ORDER BY case when (select top 1 cast(username as varbinary(255)) from
users where username not in (&#039;&#039;)) __OP__ cast(&#039;__CANDIDATE__&#039; as varbinary(255))
then ID else Address end&lt;/pre&gt; 
&lt;p&gt;The subselect provides us with a way to get the first row of data.  After getting the column data for that row, we can modify the &amp;quot;not in&amp;quot; clause to include the retrieved data, thus shifting us to the next row.  __OP__ is either &amp;quot;&amp;gt;&amp;quot; or &amp;quot;&amp;lt;&amp;quot;, depending on whether we would like to search the upper or lower space.  __CANDIDATE__ is the string that we are comparing against.&lt;/p&gt; 
&lt;p&gt;Obtaining __CANDIDATE__ is a simple enough matter of converting text to a number that reflect the ordering of the text.  Unfortunately, SQL makes things difficult by supporting concepts like collation; therefore, the lexicographic ordering of the text in your language may not align with the ordering of the text in SQL.  We can solve this problem by using the same injection point and asking the SQL server to order our alphabet for us.  For a ~90-character alphabet, this takes ~300 queries.  We will make up for this setup cost within the first two or three records.&lt;/p&gt; 
&lt;p&gt;SQL Server doesn&#039;t play well with strings.  If there are trailing spaces, they aren&#039;t counted towards the string length; if there are apostrophes, comparisons become more interesting (for example, &amp;quot;mooo&amp;quot; &amp;lt; &amp;quot;moo&#039;&#039;a&amp;quot;, but &amp;quot;mooo&amp;quot; &amp;gt; &amp;quot;moo&#039;&#039;z&amp;quot; [ed: note single and double apostrophes look similar in that example]).  To get around both of these (and a few other string-related idiocies), we cast to binary and compare as byte-sequences.&lt;/p&gt; 
&lt;p&gt;A binary search searches a range, and we should set our initial range.  A lower bound of 0 will do, and the upper bound should be set to the largest /n/-valued sequence, where /n/ is the length of the string to be retrieved, as determined by a preliminary length-seeking binary search using the same injection point.&lt;/p&gt; 
&lt;p&gt;The alphabet used must cover all of the possible letters.  Failure to do this will cause the binary search to fail; more importantly, it will make it difficult to proceed to the next record unless one can identify that record by ROWID or some other method.&lt;/p&gt; 
&lt;h2&gt;Web-specific Complications&lt;/h2&gt; 
&lt;p&gt;Certain sequences, such as&lt;span style=&quot;font-family: monospace;&quot;&gt; &lt;/span&gt;&amp;quot;\e&amp;lt;zmo~~&amp;quot; or &amp;quot;Lor,w&amp;amp;#$Jo&amp;quot; get detected, incorrectly, by WAFs as being XSS vectors.  This illustrates the stupidity of blacklist-based security precautions.  The only workaround I can think of at present is to remove the &amp;quot;&amp;lt;&amp;quot; and &amp;quot;&amp;amp;&amp;quot;/&amp;quot;#&amp;quot; characters from the alphabet, and ensure that we skip past sequences that contain such things by modifying our SQL injection query.&lt;/p&gt; 
&lt;p&gt;As the number of retrieved items grows, the length of the query grows as well.  Therefore, this technique is of limited use when faced with a GET injection.  A solution to this might be to use adaptive queries: when the strings &amp;quot;Alice&amp;quot;, &amp;quot;Alison&amp;quot;, &amp;quot;Albert&amp;quot;, &amp;quot;Alyssa&amp;quot;, and &amp;quot;Bart&amp;quot; have been retrieved, it might be possible to change the seen strings to &amp;quot;Al%&amp;quot; and &amp;quot;Bart&amp;quot;, thus reducing the length of the query.  I leave this extension as an exercise to the reader.&lt;/p&gt; 
&lt;h2&gt;Pay-off&lt;/h2&gt; 
&lt;p&gt;A binary search finds its target in log2(n)+1 probes, at worst.  In real-world terms, this leads to an average of a 6x increase in efficiency (and hence speed) for pulling out data, as compared to the simplistic method of exploiting the ordering side-channel: basically, the difference between waiting 10 minutes for a long text blob or 1 hour for the same blob.&lt;/p&gt; 
&lt;h2&gt;Notes&lt;/h2&gt; 
&lt;p&gt;Though we apply the technique to free-form text extraction here, it would be trivial to apply it to the extraction of GUIDs, or numeric data.  Numeric data extraction would be a particularly interesting exercise, since a binary search works by continually narrowing the search-space.  It might be sufficient to get a &amp;quot;ballpark&amp;quot; figure in some cases, and thus obtain better than O(log2(n)) efficiency.&lt;/p&gt; 
&lt;p&gt;I have created a small proof-of-concept, consisting of a &lt;a title=&quot;Toy Application and Database (zip)&quot; href=&quot;/utils/yusuf/SimpleApp.zip&quot;&gt;toy ASP.Net application that is susceptible to injection, a SQL Server database&lt;/a&gt;, and the &lt;a title=&quot;SQL Extraction PoC&quot; href=&quot;/utils/yusuf/get_data_minimal.py&quot;&gt;extraction tool coded in Python3&lt;/a&gt;.  If the code differs from the explanatory text (which is the text that you are reading right now, of course!), please place your trust in the code.&lt;/p&gt; 
&lt;h2&gt;Further work&lt;/h2&gt; 
&lt;p&gt;There are a number of optimisations that could be done to the existing proof-of-concept.  More importantly, the idea of using remote comparison functions to efficiently draw out previously-inaccessible data via binary search is an intriguing one, and one which deserves more attention.  &lt;a href=&quot;https://twitter.com/AndrewMohawk&quot; title=&quot;Andrew from Paterva who wrote Maltego&quot;&gt;Andrew MacPherson&lt;/a&gt; has pointed out to me that a similar technique is used by the Metasploit framework when trying to determine the EIP in some cases, and I am grateful for the knowledge; I am sure that there are even more applications for the idea just waiting to be found!&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 01 Dec 2009 08:50:41 +0200</pubDate>
    <guid isPermaLink="false">http://singe.za.net/blog/archives/989-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
</item>
<item>
    <title>SuperGenPass</title>
    <link>http://singe.za.net/blog/archives/987-SuperGenPass.html</link>
            <category>Security</category>
    
    <comments>http://singe.za.net/blog/archives/987-SuperGenPass.html#comments</comments>
    <wfw:comment>http://singe.za.net/blog/wfwcomment.php?cid=987</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://singe.za.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=987</wfw:commentRss>
    

    <author>nospam@example.com (Dominic White)</author>
    <content:encoded>
    As someone who uses a lot of web apps, I run into the problem of trying to remember multiple passwords. Most people resolve this by just using the same password across all the sites. However, as &lt;a href=&quot;http://www.techcrunch.com/2009/07/19/the-anatomy-of-the-twitter-attack/&quot; title=&quot;The Anatomy of the Twitter Attack&quot;&gt;numerous&lt;/a&gt;, &lt;a href=&quot;http://blogs.zdnet.com/security/?p=4538&quot; title=&quot;Hotmail Breach Exposes Passwords&quot;&gt;examples&lt;/a&gt;, &lt;a href=&quot;http://www.telegraph.co.uk/technology/news/6125081/Security-risk-as-people-use-same-password-on-all-websites.html&quot; title=&quot;Security Risk as People use Same Password on All Websites&quot;&gt;have&lt;/a&gt;, &lt;a href=&quot;http://www.theregister.co.uk/2009/03/04/spotify_breach/&quot; title=&quot;Spotify Breach Exposes other Accounts&quot;&gt;demonstrated&lt;/a&gt;, that&#039;s not a good idea. The knee-jerk counter is to use a different password (or groups of passwords) across the sites, but that becomes difficult to remember. If you want the quick solution I&#039;m proposing then check out &lt;a title=&quot;SuperGenPass&quot; href=&quot;http://supergenpass.com/&quot;&gt;SuperGenPass&lt;/a&gt; (or &lt;a title=&quot;Singe&#039;s SuperGenPass&quot; href=&quot;http://singe.za.net/sgp/&quot;&gt;my customised version&lt;/a&gt;). The security geek details follow after the jump.&lt;br /&gt; &lt;p&gt;Some of my colleagues use password databases such as &lt;a href=&quot;http://www.keepassx.org/&quot; title=&quot;KeePassX&quot;&gt;KeyPassX&lt;/a&gt;, or the browser&#039;s &amp;quot;remember password&amp;quot; feature. These solutions are significantly better than using the same password across all sites, but suffer from a few problems:&lt;/p&gt; 
&lt;ul&gt; 
&lt;li&gt;You have all your passwords written down somewhere - at some point you may not be the only one looking at this list&lt;br /&gt;&lt;/li&gt; 
&lt;li&gt;That list isn&#039;t always protected - e.g. using Firefox&#039;s &amp;quot;remember password&amp;quot; feature without a master password could expose your password on physical theft of the device&lt;/li&gt; 
&lt;li&gt;Portability - if you aren&#039;t at your machine you can&#039;t log in. KeePassX is quite portable, but then ends up making more copies of the password list.&lt;br /&gt;&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;None of these are killers, but they aren&#039;t ideal. This is where &lt;a href=&quot;http://supergenpass.com/&quot; title=&quot;SuperGenPass&quot;&gt;SuperGenPass&lt;/a&gt; comes in. SuperGenPass hashes a password with the domain to make a unique password per-site, meaning that a compromise or malicious admin on one site won&#039;t give them the password for another site. The main advantage is that there&#039;s no database or list of passwords lying around that could be compromised and you only need remember one password. If you wear lots of tinfoil like me, you can remember groups of passwords e.g. critical, important, arb sites. It&#039;s ridiculously portable with a &lt;a href=&quot;http://supergenpass.com/#Start&quot; title=&quot;Bookmarklets&quot;&gt;bookmarklet&lt;/a&gt; (don&#039;t use this, see below), &lt;a href=&quot;data:text/html;charset=utf-8;base64,PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQ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ywnbmV0LmJzJywnb3JnLmJzJywnYWIuY2EnLCdiYy5jYScsJ21iLmNhJywnbmIuY2EnLCduZi5jYScsJ25sLmNhJywnbnMuY2EnLCdudC5jYScsJ251LmNhJywnb24uY2EnLCdwZS5jYScsJ3FjLmNhJywnc2suY2EnLCd5ay5jYScsJ2djLmNhJywnY28uY2snLCduZXQuY2snLCdvcmcuY2snLCdlZHUuY2snLCdnb3YuY2snLCdjb20uY24nLCdlZHUuY24nLCdnb3YuY24nLCduZXQuY24nLCdvcmcuY24nLCdhYy5jbicsJ2FoLmNuJywnYmouY24nLCdjcS5jbicsJ2dkLmNuJywnZ3MuY24nLCdneC5jbicsJ2d6LmNuJywnaGIuY24nLCdoZS5jbicsJ2hpLmNuJywnaGsuY24nLCdobC5jbicsJ2huLmNuJywnamwuY24nLCdqcy5jbicsJ2xuLmNuJywnbW8uY24nLCdubS5jbicsJ254LmNuJywncWguY24nLCdzYy5jbicsJ3NuLmNuJywnc2guY24nLCdzeC5jbicsJ3RqLmNuJywndHcuY24nLCd4ai5jbicsJ3h6LmNuJywneW4uY24nLCd6ai5jbicsJ2FydHMuY28nLCdjb20uY28nLCdlZHUuY28nLCdmaXJtLmNvJywnZ292LmNvJywnaW5mby5jbycsJ2ludC5jbycsJ25vbS5jbycsJ21pbC5jbycsJ29yZy5jbycsJ3JlYy5jbycsJ3N0b3JlLmNvJywnd2ViLmNvJywnYWMuY3InLCdjby5jcicsJ2VkLmNyJywnZmkuY3InLCdnby5jcicsJ29yLmNyJywnc2EuY3InLCdjb20uY3UnLCduZXQuY3UnLCdvcmcuY3UnLCdhYy5jeScsJ2NvbS5jeScsJ2dvdi5jeScsJ25ldC5jeScsJ29yZy5jeScsJ2NvLmRrJywnYXJ0LmRvJywnY29tLmRvJywnZWR1LmRvJywnZ292LmRvJywnZ29iLmRvJywnb3JnLmRvJywnbWlsLmRvJywnbmV0LmRvJywnc2xkLmRvJywnd2ViLmRvJywnY29tLmR6Jywnb3JnLmR6JywnbmV0L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C5zdCcsJ2NvbS5zdCcsJ3N0b3JlLnN0JywnbWlsLnN0JywnY28uc3QnLCdjb20uc3YnLCdvcmcuc3YnLCdlZHUuc3YnLCdnb2Iuc3YnLCdyZWQuc3YnLCdjb20uc3knLCduZXQuc3knLCdvcmcuc3knLCdnb3Yuc3knLCdhYy50aCcsJ2NvLnRoJywnZ28udGgnLCduZXQudGgnLCdvci50aCcsJ2NvbS50bicsJ25ldC50bicsJ29yZy50bicsJ2VkdW5ldC50bicsJ2dvdi50bicsJ2Vucy50bicsJ2Zpbi50bicsJ25hdC50bicsJ2luZC50bicsJ2luZm8udG4nLCdpbnRsLnRuJywncm5ydC50bicsJ3JudS50bicsJ3Jucy50bicsJ3RvdXJpc20udG4nLCdjb20udHInLCduZXQudHInLCdvcmcudHInLCdlZHUudHInLCdnb3YudHInLCdtaWwudHInLCdiYnMudHInLCdrMTIudHInLCdnZW4udHInLCdjby50dCcsJ2NvbS50dCcsJ29yZy50dCcsJ25ldC50dCcsJ2Jpei50dCcsJ2luZm8udHQnLCdwcm8udHQnLCdpbnQudHQnLCdjb29wLnR0Jywnam9icy50dCcsJ21vYmkudHQnLCd0cmF2ZWwudHQnLCdtdXNldW0udHQnLCdhZXJvLnR0JywnbmFtZS50dCcsJ2dvdi50dCcsJ2VkdS50dCcsJ25pYy50dCcsJ3VzLnR0JywndWsudHQnLCdjYS50dCcsJ2V1LnR0JywnZXMudHQnLCdmci50dCcsJ2l0LnR0Jywnc2UudHQnLCdkay50dCcsJ2JlLnR0JywnZGUudHQnLCdhdC50dCcsJ2F1LnR0JywnY28udHYnLCdjb20udHcnLCduZXQudHcnLCdvcmcudHcnLCdlZHUudHcnLCdpZHYudHcnLCdnb3YudHcnLCdjb20udWEnLCduZXQudWEnLCdvcmcudWEnLCdlZHUudWEnLCdnb3YudWEnLCdhYy51ZycsJ2NvLnVnJywnb3IudWcnLCdnby51ZycsJ2NvLnVrJywnbWUudWsnLCdvcmcudWsnLCdlZHUudWsnLCdsdGQudWsnLCdwbGMudWsnLCduZXQudWsnLCdzY2gudWsnLCduaWMudWsnLCdhYy51aycsJ2dvdi51aycsJ25ocy51aycsJ3BvbGljZS51aycsJ21vZC51aycsJ2RuaS51cycsJ2ZlZC51cycsJ2NvbS51eScsJ2VkdS51eScsJ25ldC51eScsJ29yZy51eScsJ2d1Yi51eScsJ21pbC51eScsJ2NvbS52ZScsJ25ldC52ZScsJ29yZy52ZScsJ2NvLnZlJywnZWR1LnZlJywnZ292LnZlJywnbWlsLnZlJywnYXJ0cy52ZScsJ2JpYi52ZScsJ2Zpcm0udmUnLCdpbmZvLnZlJywnaW50LnZlJywnbm9tLnZlJywncmVjLnZlJywnc3RvcmUudmUnLCd0ZWMudmUnLCd3ZWIudmUnLCdjby52aScsJ25ldC52aScsJ29yZy52aScsJ2NvbS52bicsJ2Jpei52bicsJ2VkdS52bicsJ2dvdi52bicsJ25ldC52bicsJ29yZy52bicsJ2ludC52bicsJ2FjLnZuJywncHJvLnZuJywnaW5mby52bicsJ2hlYWx0aC52bicsJ25hbWUudm4nLCdjb20udnUnLCdlZHUudnUnLCduZXQudnUnLCdvcmcudnUnLCdkZS52dScsJ2NoLnZ1JywnZnIudnUnLCdjb20ud3MnLCduZXQud3MnLCdvcmcud3MnLCdnb3Yud3MnLCdlZHUud3MnLCdhYy55dScsJ2NvLnl1JywnZWR1Lnl1Jywnb3JnLnl1JywnY29tLnllJywnbmV0LnllJywnb3JnLnllJywnZ292LnllJywnZWR1LnllJywnbWlsLnllJywnYWMuemEnLCdhbHQuemEnLCdib3Vyc2UuemEnLCdjaXR5LnphJywnY28uemEnLCdlZHUuemEnLCdnb3YuemEnLCdsYXcuemEnLCdtaWwuemEnLCduZXQuemEnLCduZ28uemEnLCdub20uemEnLCdvcmcuemEnLCdzY2hvb2wuemEnLCd0bS56YScsJ3dlYi56YScsJ2NvLnp3JywnYWMuencnLCdvcmcuencnLCdnb3YuencnLCdldS5vcmcnLCdhdS5jb20nLCdici5jb20nLCdjbi5jb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PSJ0ZXh0Ij48L3A%2BDQoNCgkJCTwvZm9ybT4NCg0KCQk8L2Rpdj4NCg0KDQoJPC9ib2R5Pg0KDQo8L2h0bWw%2B&quot;&gt;data URI&lt;/a&gt;, &lt;a href=&quot;http://supergenpass.com/mobile/&quot;&gt;straight JavaScript&lt;/a&gt;, &lt;a href=&quot;http://michael.gorven.za.net/files/supergenpass.py&quot;&gt;Python&lt;/a&gt; (&lt;a href=&quot;https://code.launchpad.net/%7Emgiuca/pysgp/&quot;&gt;alternative&lt;/a&gt;) and &lt;a href=&quot;http://mene.za.net/passgen/&quot;&gt;J2MEE&lt;/a&gt; implementations.&lt;/p&gt; 
&lt;p&gt;There are a few potential problems that need to be considered (they all have solutions) however:&lt;/p&gt; 
&lt;ul&gt; 
&lt;li&gt;The bookmarklet runs in the same context as the website you&#039;re logging into. This means javascript on the site (or POST&#039;ed/GET&#039;ed information) has access to it. This allows a malicious or hacked site to get hold of your master password. There&#039;s a better explanation &lt;a title=&quot;SuperGenPass is not that Secure&quot; href=&quot;http://akibjorklund.com/2009/supergenpass-is-not-that-secure&quot;&gt;here&lt;/a&gt;, and I put up a demo &lt;a title=&quot;SuperGenPass Bookmarlet Master Password Leak&quot; href=&quot;http://singe.za.net/exploit/sgp.html&quot;&gt;here&lt;/a&gt;. So DO NO USE THE BOOKMARKLET. Any of the other versions are good enough, but are vulnerable to shoulder surfing (something the bookmarklet is not vulnerable to).&lt;br /&gt;&lt;/li&gt; 
&lt;li&gt;The algorithm doesn&#039;t include za.net and za.org as top level domains. This means that all your passwords for the approximately 30k domains hosted under these could have the same password. As it is unlikely that the majority of internet users use more than one web-app in these domains, this isn&#039;t a huge risk. Although, it does technically make finding the correct MD5 collision slightly easier. When I notified the developers of the bug, the response was that a change in the algorithm would affect users with existing passwords on these sites and hence they would not change it. So I made my &lt;a title=&quot;Singe&#039;s SuperGenPass&quot; href=&quot;http://singe.za.net/sgp/&quot;&gt;own&lt;/a&gt;, more on that later.&lt;/li&gt; 
&lt;li&gt;The default password length is 10. That&#039;s fine, but given research &lt;a title=&quot;Password Cracking in the Cloud&quot; href=&quot;http://news.electricalchemy.net/2009/10/password-cracking-in-cloud-part-5.html&quot;&gt;like this&lt;/a&gt;, and that setting the default to 12 costs the user nothing and potentially buys them $7,700,102,463 extra protection per password, that sounds like a good deal.&lt;/li&gt; 
&lt;li&gt;MD5 - this isn&#039;t a problem. The knee jerk I hear from some security people is that is uses MD5 and &lt;a title=&quot;MD5 Considered Harmful&quot; href=&quot;http://www.win.tue.nl/hashclash/rogue-ca/&quot;&gt;that&#039;s broken&lt;/a&gt;. However, the vulnerability in MD5 allows other values to be found that hash to the same value (a collision). This does not let you work out the reverse i.e. the original value (master password in this case) from a single hash however. So we&#039;re safe here (I think, crypto nerds got any comments?)&lt;/li&gt; 
&lt;/ul&gt; 
&lt;p&gt;In light of the above, I&#039;ve made my own customised version of sgp. It includes customised versions of all but the J2MEE version (which is partially customised by it&#039;s author to include za.net/org already). My recommendation is to use the Data URI as a bookmark loaded in your sidebar (in Firefox). While it is slightly slower logging in to one site because you will need to type the domain, it is faster when logging in to many because you can just change the domain without re-entering your master password. It is vulnerable to shoulder surfing however.&lt;/p&gt; 
&lt;p&gt;In summary. SuperGenPass provides a convenient way to use different passwords across different sites. There are some potential problems and improvements, to which I recommend using &lt;a title=&quot;singe&#039;s SuperGenPass&quot; href=&quot;/sgp/&quot;&gt;my customised version&lt;/a&gt;, with the preferred method being the Data URI as a Bookmark loaded in your sidebar.&lt;/p&gt; 
&lt;p&gt;Thanks to &lt;a title=&quot;Russell Cloran&quot; href=&quot;http://russell.rucus.net/&quot;&gt;Russell&lt;/a&gt; for pointing SGP out in the first place, and &lt;a title=&quot;Michael Gorven&quot; href=&quot;http://michael.gorven.za.net/&quot;&gt;Michael&lt;/a&gt; for the Python and J2MEE version and the changes.&lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Tue, 17 Nov 2009 20:20:33 +0200</pubDate>
    <guid isPermaLink="false">http://singe.za.net/blog/archives/987-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
</item>
<item>
    <title>&quot;Evil Thug&quot; goes after Full-Disk Encryption</title>
    <link>http://singe.za.net/blog/archives/986-Evil-Thug-goes-after-Full-Disk-Encryption.html</link>
            <category>Security</category>
    
    <comments>http://singe.za.net/blog/archives/986-Evil-Thug-goes-after-Full-Disk-Encryption.html#comments</comments>
    <wfw:comment>http://singe.za.net/blog/wfwcomment.php?cid=986</wfw:comment>

    <slash:comments>4</slash:comments>
    <wfw:commentRss>http://singe.za.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=986</wfw:commentRss>
    

    <author>nospam@example.com (Dominic White)</author>
    <content:encoded>
    Boy do I have news for you security people out there; I have a 100% reliable way of breaking all encryption! I call it the &amp;quot;Evil Thug&amp;quot; attack. I provide this service for a small fee. The entry level service will get me or an employee for a hour, this is all it will take to break any encryption in the world (and no we don&#039;t &lt;a title=&quot;Wikipedia Swordfish (film)&quot; href=&quot;http://en.wikipedia.org/wiki/Swordfish_(film)#Plot&quot;&gt;need a prostitute, even for 2048bit RSA encryption&lt;/a&gt;). &lt;p&gt;The basic methodology is to approach the encrypted device... and punch the owner in the face until they decrypt the device. The premium service will have this punch-up upgraded to a &lt;a title=&quot;Wikipedia Rubber Hose Cryptanalysis&quot; href=&quot;http://en.wikipedia.org/wiki/Rubber-hose_cryptanalysis&quot;&gt;rubber hosing&lt;/a&gt;, and the platinum version will get you &lt;a title=&quot;XKCD Crypto Nerds&quot; href=&quot;http://xkcd.com/538/&quot;&gt;some drugs and a $5 wrench&lt;/a&gt;. Unlike our competitors, you won&#039;t need to involve a &lt;a title=&quot;Evil Made goes after TrueCrypt&quot; href=&quot;http://theinvisiblethings.blogspot.com/2009/10/evil-maid-goes-after-truecrypt.html&quot;&gt;notoriously unreliable Latino third-party stereotype&lt;/a&gt;.&lt;/p&gt; 
&lt;p&gt;Okay, jokes aside. Joanna Rutkowska, who has done some &lt;a href=&quot;http://bluepillproject.org/&quot;&gt;hardcore stuff in the past&lt;/a&gt;, has done a write-up and released a tool showing how easily the passphrase for a full-disk encryption product can be retrieved by an example person who has access to your physical laptop, even if powered off and without requiring the complexity of &lt;a title=&quot;Lank Clever&quot; href=&quot;http://citp.princeton.edu/memory/&quot;&gt;coldboot attacks&lt;/a&gt;. While she acknowledges that &amp;quot;the concept behind the Evil Maid Attack is neither new, nor l33t in any way&amp;quot; the &lt;a href=&quot;http://search.twitter.com/search?q=%22Evil+Maid%22&quot;&gt;amount of non-critical coverage it has gotten&lt;/a&gt; has irked me.&lt;br /&gt;&lt;/p&gt; 
&lt;p&gt;Her scenario involves someone who not only has access to your laptop without you being around, but has repeat access to your living space, and if they choose, *you*. Of the one squillion options available to a thief at this point, some complicated boot-loader jiggery pokery (not to mention extensions to support other full disk encryption software, AV evasion and the inevitable arms-race/maintenance overhead these things turn into) seems far less viable than beating it out of the victim, or even poisoning their toothpaste and only giving them the antidote once decryption has occurred.&lt;br /&gt;&lt;/p&gt; 
&lt;p&gt;Arguably, actually beating someone exposes you to all sorts of potential law enforcement nastiness, like getting ID&#039;ed in a perp walk. However, if you are going to train an army of maids, *and* have them chain gang laptops out of hotels, you can still get ID&#039;ed by a maid, and you&#039;re setting up a fairly big bread trail to your operation by involving that many people, and stealing that much stuff. In short; No, this does not provide you some magic-anti-police ability to scale the theft and is less violent but no more effective than our platinum wrench service.&lt;br /&gt;&lt;/p&gt; 
&lt;p&gt;In future, please don&#039;t look to encryption to stop bullets, or pretend that when it doesn&#039;t something interesting has happened.&lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Mon, 19 Oct 2009 22:35:32 +0200</pubDate>
    <guid isPermaLink="false">http://singe.za.net/blog/archives/986-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
</item>
<item>
    <title>When AntiVirus was the Virus</title>
    <link>http://singe.za.net/blog/archives/985-When-AntiVirus-was-the-Virus.html</link>
            <category>Security</category>
    
    <comments>http://singe.za.net/blog/archives/985-When-AntiVirus-was-the-Virus.html#comments</comments>
    <wfw:comment>http://singe.za.net/blog/wfwcomment.php?cid=985</wfw:comment>

    <slash:comments>2</slash:comments>
    <wfw:commentRss>http://singe.za.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=985</wfw:commentRss>
    

    <author>nospam@example.com (Dominic White)</author>
    <content:encoded>
    &lt;p&gt;
This weekend was rather eventful, and we learned a valuable lesson about viruses, security software, and professional scepticism in IT environments. I&#039;ve briefly documented it below so you can learn from our mistakes.&lt;/p&gt; 
&lt;p&gt;Last week Wednesday a virus was detected on a client&#039;s network. The anti-virus (AV) host intrusion prevention system (HIPS) was updated to block access to the URLs the virus was using to fetch its payload and other control instruction.. However, the domain lookups[1] to these URLs increased massively by Friday, so much so, they caused the internal firewalls to fail due to the load from trying to inspect this traffic. Domain lookups were then blocked at the firewall, but the source of the lookups persisted. However, network access was restored and outwardly there was nothing wrong.
&lt;/p&gt; &lt;p&gt;
We now needed a sample of the virus. Without it we could not get a signature from our AV vendor and get it removed from the whole environment. We also needed to know what it did so we could advise on appropriate remediation (e.g. changing facebook passwords). We tried all sorts of things. We isolated one machine and tried to work out what would make the lookups stop (our test for the existence of the virus). We replaced the local domain cache with static links (in hosts and lmhosts files) to try and make the lookups not traverse the network (and hence not cause outages in future), while we tried looking for the virus. We ran multiple tools and scoured &#039;infected&#039; hard drives looking for the virus. We even dumped running programs from RAM fearing the virus had injected itself into a legitimate windows process. We killed processes until bluescreen or reboot, everything we could think of to try and find a failure criteria that would identify a sample. Meanwhile, our AV vendor&#039;s highest level escalation analysts were connecting in to our machines, we were uploading hundreds of potentially infected files to them, and a hard drive had been priority couriered to them. This continued 24 hours a day during the weekend with IT personnel working 24hr shifts until breaking point. &lt;br /&gt;&lt;/p&gt; 
&lt;p&gt;Eventually, on Sunday it was discovered that there was no virus (or not as widespread as we believed) and that our AV&#039;s HIPS had in fact been causing the domain lookup flood. By assigning the HIPS to block traffic to the viruses&#039; domain, the HIPS would perform a domain lookup to find where the domain current resides and block that. However, instead of caching the lookup&#039;s result, our AV would regularly re-lookup the domain. This is likely because of &#039;fast flux&#039;[2] malware domains which bounce their actual location all over the internet. The unintended consequence however, was a DNS flood. Even then, DNS should not be large enough to cause significant network latency, and it was this in conjunction with the firewalls attempting to inspect and apply policy to this traffic that caused the failure. What&#039;s more, is that the domain lookups should have gone to local DNS resolvers and not the internal top-level DNS (which is behind the firewalls), but were bypassing their local cache due to advised against misconfigurations.&lt;/p&gt; 
&lt;p&gt;In summary, our own security software caused an unintended consequence, that behaved much like a highly complex virus. In future, I would recommend that at least two solid points of evidence for the existence of a virus be discovered before a sample is attempted to be recovered (usually an infection vector and behaviour, if you see behaviour after infection but not before, then you have something). While, on the surface, I feel quite stupid, in reality not even the top level analysts at our AV spotted the behaviour of their own software. The truth is that IT environments are sufficiently complex, that these sorts of mistakes are more likely than not. As security people, our job is to know this, and make sure we can guide people to get enough evidence to know what is happening before they waste an entire weekend. This is why I want all of you to learn from our mistake :)&lt;/p&gt; 
&lt;p&gt;[1] The internet works on IP addresses, these are four sets of numbers. However, they are not very human readable, so the domain name system (DNS) was created to allow human readable names e.g. www.google.com which a domain lookup would translate to something like 209.85.227.103&lt;/p&gt; 
&lt;p&gt;[2] Virus writers have worked out that if they rely on one domain then it is fairly easy to get them shut down. So they usually make their viruses query a couple to several thousand domains, and make those domains regularly change the IP address returned (see [1]) providing two layers of rapidly changing complexity, thus making them that much harder to stop.
&lt;/p&gt; 
    </content:encoded>

    <pubDate>Mon, 19 Oct 2009 12:38:48 +0200</pubDate>
    <guid isPermaLink="false">http://singe.za.net/blog/archives/985-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
</item>
<item>
    <title>Conficker Claims its First Human</title>
    <link>http://singe.za.net/blog/archives/979-Conficker-Claims-its-First-Human.html</link>
            <category>Security</category>
    
    <comments>http://singe.za.net/blog/archives/979-Conficker-Claims-its-First-Human.html#comments</comments>
    <wfw:comment>http://singe.za.net/blog/wfwcomment.php?cid=979</wfw:comment>

    <slash:comments>1</slash:comments>
    <wfw:commentRss>http://singe.za.net/blog/rss.php?version=2.0&amp;type=comments&amp;cid=979</wfw:commentRss>
    

    <author>nospam@example.com (Dominic White)</author>
    <content:encoded>
    Conficker has claimed it&#039;s first victim, this time a live one. Conficker, a computer virus that security researchers have warned will do severe damage to computing systems from April 1st, has claimed millions of computer victims to date. However, Harry Hermulen&#039;s computer was luckier than he was. &lt;p&gt;Mr Hermulen, fearing a computerised Armageddon would occur on April 1st due to Conficker, barricaded himself in his log cabin outside the small town of Pofadder in South Africa last week. After missing the town&#039;s weekly &amp;quot;sokkie&amp;quot;, a type of traditional Afrikaans dance, town members went to visit Harry. One witness described what they found as &amp;quot;horrifying&amp;quot;. &amp;quot;We knocked on the door, but Harry didn&#039;t answer, a jean-pant were drying outside, but Harry only had one pair, so we knew he was inside.&amp;quot; said Maggie van Schoonstad. &amp;quot;We opened the door and found yellow, red and blue devil&#039;s signs on all the walls,&amp;quot; continued Maggie These were later confirmed as the logos of well known Anti-Virus vendors. &amp;quot;We found him dead in front of his computer, his face was all blue from the screen.&amp;quot;&lt;/p&gt; 
&lt;p&gt;Later analysis confirmed Mr Hermulen had starved to death. Computer experts determined that while waiting for his Vista computer to boot, then clicking through the thousands of &#039;Allow&#039; dialogs presented to&amp;#160; him by the multiple Anti-Virus products installed, Mr Hermulen had not had time to eat. &amp;quot;His finger was full of blood and stuck to his mouse.&amp;quot; said Frikkie Steyn a close hunting friend of Harry.&lt;/p&gt; 
&lt;p&gt;When asked for comment, Norton Symanteck, a spokesperson for Fckng-Secure Anti-Virus said, &amp;quot;What happened to Mr. Hermulen is a tragedy, BUT YOU&#039;RE ALL GOING TO DIE UNLESS YOU BUY ANTI-VIRUS.&amp;quot; Oh the humanity.&lt;/p&gt; 
&lt;p&gt;Happy April First.&lt;br /&gt;&lt;/p&gt; 
    </content:encoded>

    <pubDate>Wed, 01 Apr 2009 09:02:29 +0200</pubDate>
    <guid isPermaLink="false">http://singe.za.net/blog/archives/979-guid.html</guid>
    <creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/3.0/</creativeCommons:license>
</item>

</channel>
</rss>