The iframe element is not an inherently malicious HTML element. In fact, it has many positive uses. However, over the last number of years, attackers have discovered it is an easy way to carry off malicious code attacks like drive-by downloads. These malicious iframe elements are hosted on malicious websites, or in some cases, legitimate websites that have been hacked and had the iframe element inserted into their Web pages.
While an attack mechanism commonly found in drive-by downloading websites, the use of the iframe element is not limited to Web pages. It could also appear in emails, documents, or any sort of file type that supports HTML.What is an iframe element?
The iframe element allows Web developers to include HTML content from other sources in their pages. A typical iframe element might look like this:
<iframe name="example" src=" http://www.example.com/example.html" width="640" height="280"></iframe>
A common real-world example that uses iframe elements are online banner ads. An advertiser creates the content in an HTML file that is hosted on a 3rd party website. A Web developer can then call this content within their own pages by adding the URL in an iframe element. The banner add then appears within the Web page they have created.
How are iframes used maliciously?
One of the features of the iframe element is width and height attributes. In most legitimate cases, such as the banner ad example above, a Web developer would specify the pixel size they would like the ad to appear.
However, a malicious attacker often sets these width and height attributes to zero pixels each. As a result, the iframe is invisible in a standard Web page, making it undetectable to the casual user. Such an iframe element might look like this if viewed in the markup:
<iframe name="malicious" src="http://www.example.com/malicious.html" width="0" height="0"></iframe>
The attacker then includes a malicious URL within the element. When a page that contains such an iframe element is visited, the malicious actions are carried out, without any sort of interaction by the visitor.What sorts of activities can be carried out with a malicious iframe?
This largely depends on the code on the page the user is directed to through the iframe element. Almost anything that can be carried out on a Web page could be performed through an iframe, though one of the more popular malicious activities is using iframe elements in conjunction with exploit packs.
An exploit pack is a malicious program comprised of a group of exploits for known vulnerabilities. There are a wide variety of exploit packs out there, such as Mpack
, etc. These programs are often stored on a malicious server. When a user visits such a server, the exploit pack attempts to carry out a series of attacks against either the user’s browser or operating system.
If the exploit pack is successful in finding a vulnerability and then compromising the computer, the next stage of the attack can then proceed. This usually entails the downloading of additional malware files onto the compromised computer. In many cases this entails downloaders, infostealers, or back doors.
Iframe elements and exploit packs can also be used as a method of propagation when a Web server is compromised. After a successful attack in these cases, the threat dropped on the compromised computer may scan for Web files, such as .html, .asp, or .php files, adding a malicious iframe element to any that are found. Alternatively, attackers may use a SQL injection attack routine that adds an iframe into the fields of database tables, and thus any subsequent pages generated from the database.What are the risks?
An iframe attack, the resulting exploit attempts, and the chances that further malicious code will be downloaded poses a relatively high risk of damaging a compromised computer. The risks vary, and depend on the success of the attack, but range from becoming part of a botnet, to loss of data, and even the chance of identity theft.What can I do to minimize the risks?
As a general rule, users should always run up-to-date antivirus software with real-time protection such as Norton Antivirus, Norton Internet Security, Norton 360
or Symantec Endpoint Protection
. In addition, a firewall -- or better still, an Intrusion Prevention System (IPS) -- will help to block back channel activities initiated by these types of malicious programs. Program controls such as those found in Symantec Endpoint Protection can also help to prevent unknown programs such as these from executing in the first place.
In order to prevent the exploit packs from successfully compromising a computer, it is also a good idea to ensure that all relevant security patches are installed.How can I find out more?
Advanced users can submit a sample to Threat Expert
to obtain a detailed report of the system and file system changes caused by a threat.
Symantec Security Response encourages all users and administrators to adhere to the following basic security "best practices":