Malware spoofing HTTP Host header to hide C&C communication

Posted by   Virus Bulletin on   Sep 4, 2013

Traffic appears as requests to Google or Yandex.

There have been several recent examples of malware using a spoofed HTTP Host header to hide communucation with its control servers.

When a web browser sends an HTTP request to a web server, it includes a Host header, containing the host of the site that is requested. This header has been mandatory since the introduction of HTTP version 1.1 in 1999. It allows for domain-based virtual hosting, where websites on multiple domains are hosted on a single web server.

It is trivial to spoof HTTP requests and the Host header is no exception. This is usually of little concern: depending on the way the web server is set up, the user will get a redirect, an error, or a default website. Sites such as Google, Facebook and Virus Bulletin will return a 302 redirect when a request is made for a document on a different domain, while Microsoft and Yahoo return an error. Under normal circumstances, none of this should affect the server's security.

  Connecting to the Virus Bulletin web server with a spoofed hostname will cause the web server to return a 302 redirect.

In some cases, using a spoofed Host header can be used to bypass filters that block traffic based on the content of this header. In recent months, this trick has been used by various pieces of malware.

In July, Trend Micro wrote two posts on pieces of malware that used a spoofed Google header to communicate with their command and control servers. This week, McAfee's Umesh Wanve analysed the 'Cidox' trojan which sent a fake Yandex header, making it appear as if requests were made to the servers of the Russian search engine.

Of course, one would hope that security software would block this communication based on the IP address, or the content of the traffic. But no software is perfect and a system administrator analysing server logs could easily be deceived by the spoofed Host header.

In the case of big sites like Google and Yandex, a simple reverse DNS lookup on the IP address will reveal that the header is spoofed. More generally, however, it is not so simple to determine with certainty whether the host name is spoofed.

Security software and system administrators alike should thus treat the content of the Host header in the same way as they treat a domain name appearing in an email header: if it is known to be bad, then blocking is justified on the grounds that it is either bad, or spoofed. But if it isn't, it shouldn't be assumed to be valid.

Posted on 4 September 2013 by Martijn Grooten

twitter.png
fb.png
linkedin.png
hackernews.png
reddit.png

 

Latest posts:

VBSpam tests to be executed under the AMTSO framework

VB is excited to announce that, starting from the Q3 test, all VBSpam tests of email security products will be executed under the AMTSO framework.

In memoriam: Prof. Ross Anderson

We were very sorry to learn of the passing of Professor Ross Anderson a few days ago.

In memoriam: Dr Alan Solomon

We were very sorry to learn of the passing of industry pioneer Dr Alan Solomon earlier this week.

New paper: Nexus Android banking botnet – compromising C&C panels and dissecting mobile AppInjects

In a new paper, researchers Aditya K Sood and Rohit Bansal provide details of a security vulnerability in the Nexus Android botnet C&C panel that was exploited in order to gather threat intelligence, and present a model of mobile AppInjects.

New paper: Collector-stealer: a Russian origin credential and information extractor

In a new paper, F5 researchers Aditya K Sood and Rohit Chaturvedi present a 360 analysis of Collector-stealer, a Russian-origin credential and information extractor.

We have placed cookies on your device in order to improve the functionality of this site, as outlined in our cookies policy. However, you may delete and block all cookies from this site and your use of the site will be unaffected. By continuing to browse this site, you are agreeing to Virus Bulletin's use of data as outlined in our privacy policy.