About Me

Wednesday, 11 April 2012

RFI (Remote File Inclusion) basic info.

RFI(Remote File Inclusion)

Remote File Include (RFI) is an attack technique used to exploit "dynamic file include" mechanisms in web applications. When web applications take user input (URL, parameter value, etc.) and pass them into file include commands, the web application might be tricked into including remote files with malicious code.

Typically, RFI attacks are performed by setting the value of a request parameter to a URL that refers to a malicious file. Consider the following PHP code:

The first line of code extracts the value of the file parameter from the HTTP request. The second line of code dynamically sets the file name to be included using the extracted value. If the web application does not properly sanitize the value of the file parameter (for example, by checking against a white list) this code can be exploited. Consider the following URL:


Other PHP commands vulnerable to RFI are include_once, fopen, file_get_contents, require and require_once. Additional information on PHP environment variable behavior can be found at

0 comments:

Post a Comment