Drive-by campaign using dynamic DNS domains

Since Monday a new drive-by campaign is making the round which is using dynamic DNS domains of DynDNS and No-IP to spread malware.

The drive-by campaign consists of three different stages illustrated below:


*** First stage***
The first stage is always the same on all drive-by campaigns: The cybercriminals injects malicious code into legitimate websites (mostly using stolen FTP credentials, see “An Iframer for Dummies”). In this case the malicious code is a iframe which is pointing to a malicious domain for the second stage. The Iframe can look like this:

<iframe src="" width=248 height=0 style="visibility: hidden"></iframe>
<iframe src="" width=625 height=0 style="visibility: hidden"></iframe>

As you can see above, for this purpose the cybercriminals are using dynamic DNS domains names in the Iframes.

*** Second stage***
The second stage is the URL to which an iframe from the first stage is pointing to. The URL comes along with one of the following parameter, which will be given to in.cgi:

For example:


If a user visits a infected website with such a malicious iframe, the in.cgi script tries to set three cookies for the domain ( – CHINANET-SH) and sends a HTTP 302 (redirect) back to the victims browser.

Here’s an example of such a request:

Connecting to||:8080… connected.
HTTP request sent, awaiting response… 302 Found
Cookie coming from attempted to set domain to
Cookie coming from attempted to set domain to
Cookie coming from attempted to set domain to
Location: [following]

…with the following HTML content:

<meta http-equiv="REFRESH" content="1; URL=’’">
document moved <a href="">here</a>

…and the following cookies (one per line): FALSE / FALSE [number] SL_default_0000 _1_ FALSE / FALSE [number] TSUSER open4 FALSE / FALSE [number] SL_open4_0000

Until now I’ve seen the following dynamic DNS domains which are acting as “redirector” in the second stage:

Redirecting URLs (second stage)

Each of these redirection domains seems to select a target URL as redirection for the third stage. For this purpose every redirection URL has a pool of ten target URLs to choose from (some kind of a domain set), and this pool is changed every hour.

*** Third stage ***
As mentioned before, the dynamic DNS domains used by the third stage will change frequently (using different domain sets and HTTP 302). One would expect the target domains to contain malicious code that exploits vulnearable web browsers and browser plugins used by the visitors. BUT actually they are neither serving contents nor exploits – just blank pages:

Target URLs (third stage)

A full list of the malicious domains used by this drive by campaign in the third stage can be found here: (currently I already caputred more than 1’500 uniq domains which are assoiciated with this drive-by campaign). The list will be updated permanently using a script.

The strange thing is that the malicious domains currently doesn’t serve any kind of exploits/malware. So the question is why the cybercriminals are injecting malicious Iframes in thousands of legitimate websites while the drive-by infection doesn’t work? While several explanations like geoIP dependencies exist, the following one sounds most reasonable: They want to inject the malicious iframes in as many sites as possible. As soon as they have infected enough websites, they will put exploits on to the dynamic DNS domains which are currently just hosting a blank page. The benefit of it could be that AV-vendors are not able to get any exploits or malware before the cybercriminals “activate” the attack. Though the security industry might track the threat, they would be unable to react onto it while the attack has not been launched (don’t forget the domain flux which the domains are using).

Dynamic DNS domains are more and more used for this kind of attacks. Maybe it’s time for us to reconsider firewall policies of corporate networks concerning access to them?

UPDATE 2009-09-14
It seems that this drive-by campaign spreads a variant of the Bredolab trojan.

7 thoughts on “Drive-by campaign using dynamic DNS domains

  1. Pingback: Ddns- How it Works? Own Mail Server? Own Www Server? it is Possible Even in your Home | ADSL 4 ME

  2. Pingback: Drive-by campaign using dynamic DNS domains | Scripts Rss

  3. Pingback: Botnet en base a web servers corriendo sobre Linux | UR-VE.COM

  4. Pingback: Botnet en base a web servers corriendo sobre Linux « RSS2Blogs

Leave a Reply

Your email address will not be published. Required fields are marked *