SQL Injection occurs when data input for example by a user is interpreted as a SQL command rather than normal data by the backend database. This is an extremely common vulnerability and its successful exploitation can have critical implications. Netsparker confirmed the vulnerability by executing a test SQL Query on the back-end database. In these tests, SQL Injection was not obvious but the different responses from the page based on the injection test allowed us to identify and confirm the SQL Injection.
Impact
Depending on the backend database, the database connection settings and the operating system, an attacker can mount one or more of the following type of attacks successfully:
Reading, Updating and Deleting arbitrary data from the database
Executing commands on the underlying operating system
Reading, Updating and Deleting arbitrary tables from the database
Actions to Take
See the remedy for solution.
If you are not using a database access layer (DAL), consider using one. This will help you to centralise the issue. You can also use an ORM (object relational mapping). Most of the ORM systems use only parameterised queries and this can solve the whole SQL Injection problem.
Locate the all dynamically generated SQL queries and convert them to parameterised queries. (If you decide to use a DAL/ORM change all legacy code to use these new libraries)
Use your weblogs and application logs to see if there was any previous but undetected attack to this resource.
Remedy
A robust method for mitigating the threat of SQL Injection based vulnerabilities is to use parameterized queries (prepared statements). Almost all modern languages provide built in libraries for this. Wherever possible do not create dynamic SQL queries or SQL queries with string concatenation.
Required Skills for Successful Exploitation
There are numerous freely available tools to exploit SQL Injection vulnerabilities. This is a complex area with many dependencies, however it should be noted that the numerous resources available in this area have raised both attacker awareness of the issues and their ability to discover and leverage them. SQL Injection is one of the most common web application vulnerabilities.
SQL Injection occurs when data input for example by a user is interpreted as a SQL command rather than normal data by the backend database. This is an extremely common vulnerability and its successful exploitation can have critical implications. Even though Netsparker believes that there is a SQL Injection in here it could not confirm it. There can be numerous reasons for Netsparker not being able to confirm this. We strongly recommend investigating the issue manually to ensure that it is an SQL Injection and that it needs to be addressed. You can also consider sending the details of this issue to us, in order that we can address this issue for the next time and give you a more precise result.
Impact
Depending on the backend database, database connection settings and the operating system, an attacker can mount one or more of the following type of attacks successfully:
Reading, Updating and Deleting arbitrary data from the database
Executing commands on the underlying operating system
Reading, Updating and Deleting arbitrary tables from the database
Actions to Take
See the remedy for solution.
If you are not using a database access layer (DAL) within the architecture consider its benefits and implement if appropriate. As a minimum the use of s DAL will help centralize the issue and its resolution. You can also use an ORM (object relational mapping). Most ORM systems use parameterized queries and this can solve many if not all SQL Injection based problems.
Locate all of the dynamically generated SQL queries and convert them to parameterised queries. (If you decide to use a DAL/ORM, change all legacy code to use these new libraries)
Monitor and review weblogs and application logs in order to uncover active or previous exploitation attempts.
Remedy
A very robust method for mitigating the threat of SQL Injection based vulnerabilities is to use parameterized queries (prepared statements). Almost all modern languages provide built in libraries for this. Wherever possible do not create dynamic SQL queries or SQL queries with string concatenation.
Required Skills for Successful Exploitation
There are numerous freely available tools to test for SQL Injection vulnerabilities. This is a complex area with many dependencies, however it should be noted that the numerous resources available in this area have raised both attacker awareness of the issues and their ability to discover and leverage them. SQL Injection is one of the most common web application vulnerabilities.
<br /><b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>3</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>5</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>6</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>7</b><br /><br /><b>Warning</b>: file_get_contents(../../images/button/.gif) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>8</b><br />
A Local File Inclusion (LFI) vulnerability occurs when a file from the target system is injected into attacked server page.
Impact
Impact can differ based on the exploitation and the read permission of the web server user. Depends on these factors an attacker might carry out one or more of the following attacks:
Gather usernames via /etc/password file
Harvest useful information from the log files such as "/apache/logs/error.log" or "/apache/logs/access.log"
Remotely execute commands via combining this vulnerability with some of other attack vectors such as file upload vulnerability or log injection.
Remedy
If it's possible, do not accept appending file paths directly. Make it hard-coded or selectable from a limited hard-coded path list via an index variable
If you definitely need dynamic path concatenation, ensure that you only accept required characters such as "a-Z0-9" and do not allow "..", "/", "%00" (null byte) or any other similar unexpected characters.
Finally it's important to limit the API to allow inclusion only from a directory and directories below it. This way you can ensure that any potential attack can not perform a directory traversal attack.
<br /><b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>3</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>5</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>6</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>7</b><br /><br /><b>Warning</b>: file_get_contents(../../images/button/.gif) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>8</b><br />
Netsparker identified that the target web server is an Apache server. This was disclosed through the HTTP response. This information can help an attacker to gain a greater understanding of the systems in use and potentially develop further attacks targeted at the specific version of Apache.
Impact
An attacker can search for specific security vulnerabilities for the version of Apache identified within the SERVER header.
Remedy
Configure your web server to prevent information leakage from the SERVER header of its HTTP response.
Netsparker identified that the target web server is disclosing the PHP version in use through the HTTP response. This information can help an attacker to gain a greater understanding of the systems in use and potentially develop further attacks targeted at the specific version of PHP.
Impact
An attacker can look for specific security vulnerabilities for the version identified. Also the attacker can use this information in conjunction with the other vulnerabilities in the application or the web server.
Netsparker identified that the target web server is disclosing OpenSSL version in the HTTP response. This information can help an attacker to develop further attacks and also the system can become an easier target for automated attacks.
Impact
An attacker can look for specific security vulnerabilities for the identified version. Also the attacker can use this information in conjunction with the other vulnerabilities in the application or the web server.
Remedy
Configure your web server to prevent information leakage from the SERVER header of its HTTP response.
Netsparker identified that the target web server is disclosing one of the Apache modules version. This was disclosed through the HTTP response. This information can help an attacker to gain a greater understanding of the systems in use and potentially develop further attacks targeted at the specific version of Apache.
Impact
An attacker can look for specific security vulnerabilities for the identified Apache module version. The attacker can also use this information in conjunction with the other vulnerabilities in the application or the web server.
Remedy
Configure your web server to prevent information leakage from the SERVER header of its HTTP response.
Netsparker identified that the target web server is disclosing the Perl version in the HTTP response. This information can help an attacker to develop further attacks and also the system can become an easier target for automated attacks.
Impact
An attacker can look for specific security vulnerabilities for the identified version of Perl. Also the attacker can use this information in conjunction with other identified vulnerabilities in the application or the web server.
Remediation
Configure your web server to prevent information leakage from the SERVER header of its HTTP response.
The error message may disclose sensitive information and this information can be used by an attacker to mount new attacks or to enlarge the attack surface. In rare conditions this may be a clue for an SQL Injection vulnerability. Most of the time Netsparker will detect and report that problem separately.
Remedy
Do not provide any error messages on production environments. Save error messages with a reference number to a backend storage such as a text file or database, then show this number and a static user-friendly error message to the user.
<br /><b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>3</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>5</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>6</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>7</b><br /><br /><b>Warning</b>: file_get_contents(../../images/button/.gif) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>8</b><br />
Netsparker identified a programming error message.
Impact
The error message may disclose sensitive information and this information can be used by an attacker to mount new attacks or to enlarge the attack surface. Source code, stack trace, etc. type data may be disclosed. Most of these issues will be identified and reported separately by Netsparker.
Remedy
Do not provide error messages on production environments. Save error messages with a reference number to a backend storage such as a log, text file or database then show this number and a static user-friendly error message to the user.
<b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>3</b>
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>5</b>
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>6</b>
<b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>7</b>
<b>Warning</b>: file_get_contents(../../images/button/.gif) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>8</b>
Request
GET /button/image/?b=%22%26%20ping%20-n%2026%20127.0.0.1%20%26 HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Cache-Control: no-cache Host: www.socialfollow.com Accept-Encoding: gzip, deflate
<br /><b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>3</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>5</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>6</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>7</b><br /><br /><b>Warning</b>: file_get_contents(../../images/button/.gif) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>8</b><br />
Netsparker identified that the target web site is using a MySQL Server. This is generally not a security issue and is reported here for information purposes.
Impact
This issue is reported as additional information only, there is no direct impact arising from this issue.
<br /><b>Warning</b>: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>3</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>5</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>6</b><br /><br /><b>Warning</b>: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php:3) in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>7</b><br /><br /><b>Warning</b>: file_get_contents(../../images/button/.gif) [<a href='function.file-get-contents'>function.file-get-contents</a>]: failed to open stream: No such file or directory in <b>/var/www/vhosts/socialfollow.com/httpdocs/button/image/index.php</b> on line <b>8</b><br />