This report describes Remote File Inclusion (RFI) – an attack that usually flies under the radar. Although RFI attacks have the potential to cause as much damage as the more popular SQL injection and cross-site scripting (XSS) attacks, they are not widely discussed. Imperva’s Hacker Intelligence Initiative (HII) has documented examples of automated attack campaigns launched in the wild. This report pinpoints common traits and techniques as well as the role blacklisting can play in mitigation.
1 of 3
More Related Content
Remote File Inclusion
1. May 2011
Hacker Intelligence Initiative, Monthly Trend Report #1
Hacker Intelligence Summary Report – Remote File Inclusion
We begin our first report by describing an attack which usually flies under the radar – Remote File Inclusion (RFI). Although these
attacks have the potential to cause as much damage as the more popular SQL Injection and Cross-Site Scripting (XSS) attacks,
they are not widely discussed.
HII has documented examples of automated attack campaigns launched in the wild. This report pinpoints their common traits
and techniques, as well as the role blacklisting can play in mitigating them.
What is a “Remote File Inclusion” Vulnerability?
RFI is caused by insufficient validation of user input provided as parameters to a Web application. Parameters that are
vulnerable to remote file inclusion enable an attacker to include code from a remotely hosted file in a script executed on
the application’s server. Since the attacker’s code is thus executed on the Web server it might be used for temporary data
theft or manipulation, or for a long term takeover of the vulnerable server.
Current solutions such as Web Application Firewalls (WAF) deal with this threat and block the exploit using signatures that
match the abused vulnerable application parameter. However, knowledge extracted from observed attacks would improve
and enhance this solution.
Remote File Inclusion – an Anatomy of an Exploit
The RFI attack vector includes a URL reference to the remotely hosted code. Most attacks include two steps. In the first step
the attack vector references a simple validation script, usually capable of printing some distinguished output to the HTML
page. If the validation script is successfully executed by the server under attack then the attacker proceeds with a second
vector that references the actual payload script. The servers hosting the scripts are either compromised servers or file
sharing services.
Remote File Inclusion – Attack Frequency and Volume
As the following diagram shows, RFI attacks occur on a daily-basis. RFI attack traffic is spread over the course of a month,
and there are 2-3 days of concentrated attack attempts every month.
2. Hacker Intelligence Initiative, Monthly Trend Report
The sporadic peaks of attack activity containing a high frequency of requests are usually from a single source, indicating that
these attacks were issued by automatic tools.
The relative volume of RFI attacks is usually low. For sake of comparison, we measured the frequency of observed RFI attacks
against the frequency of observed SQL Injection attacks between December 2010 and March 2011. Within the attack traffic,
1.7% was associated with SQL Injection, while 0.3% of the attack traffic was identified as RFI-related.
Remote File Inclusion – Attack Origins
We have observed RFI attacks that originated from hundreds of sources. Usually, an attacker initiated only a small number of
RFI attacks. However, some attackers initiated a disproportionate number of attacks: the 10 most active attackers issued 51%
of the observed attacks.
Most of the attackers were active against the observed Web applications during just a short period (less than a day).
However, some attackers were active and repeatedly sent RFI attack vectors over a long period of weeks and even months.
As the following chart shows, most attack traffic originates from the United States.
Diagram 1: RFI attack traffic origins by country
Remote File Inclusion – Attack Targets
Several observed Web applications were targeted by a large number of attackers. The attackers operated independently of
one another with the goal of seeking exploitable vulnerabilities on the Web. Furthermore, each Web application was usually
attacked by several attackers. We see this as an indication that active RFI attack tools are repeatedly trying to discover and
exploit whatever RFI vulnerabilities they can detect on the Web.
We also noticed that there is a correlation between the number of RFI attacks targeted at a site and the popularity of a site,
as well as a correlation between the number of RFI attacks targeted at a site and the total attack activity directed at it.
Remote File Inclusion – Malicious Scripts
We have observed hundreds of URLs that attackers attempted to remotely include within the Web applications. While the
scripts are hosted at many locations, many of them are duplicates of each other, so the number of actual scripts that used in
the attacks is small (20-30).
Report #1, May 2011 2