GHDB, DORK Tests

VULNERABILITIES

Vulnerabilities

CRITICAL

19 %

IMPORTANT

31 %

LOW

38 %

INFORMATION

13 %

SQL Injection

SQL Injection

1
TOTAL

CRITICAL

CONFIRMED

1

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.

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 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)

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.

<br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Unable to save result set in <b>/mnt/book_direct/releases/20110209222312/v002/dbase/classes/trips_classes.php</b> on line <b>70</b><br />Error: A problem was encountered while executing the query <i>SELECT g.id, g.group_id, g.map_config FROM groups_config g WHERE g.group_id = (select 1 and row(1,1)>(select count(*),concat(CONCAT(CHAR(95),CHAR(33),CHAR(64),CHAR(52),CHAR(100),CHAR(105),CHAR(108),CHAR(101),CHAR(109),CHAR(109),CHAR(97)),0x3a,floor(rand()*2))x from (select 1 union select 2)a group by x limit 1))</i> Duplicate entry '_!@4dilemma:1' for key 1

[High Possibility] SQL Injection

[High Possibility] SQL Injection

2
TOTAL

CRITICAL

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_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Unable to save result set in <b>/mnt/book_direct/releases/20110209222312/v002/dbase/classes/trips_classes.php</b> on line <b>70</b><br />Error: A problem was encountered while executing the query <i>SELECT template_path,template_style FROM clones WHERE id = (select 1 and row(1,1)>(select count(*),concat(CONCAT(CHAR(95),CHAR(33),CHAR(64),CHAR(52),CHAR(100),CHAR(105),CHAR(108),CHAR(101),CHAR(109),CHAR(109),CHAR(97)),0x3a,floor(rand()*2))x from (select 1 union select 2)a group by x limit 1))</i> Duplicate entry '_!@4dilemma:0' for key 1

Error: A problem was encountered while executing the query <i>SELECT g.id, g.group_id, g.map_config FROM groups_config g WHERE g.group_id = %27</i> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%27' at line 1

Cross-site Scripting

Cross-site Scripting

4
TOTAL

IMPORTANT

CONFIRMED

4

XSS (Cross-site Scripting) allows an attacker to execute a dynamic script (Javascript, VbScript) in the context of the application. This allows several different attack opportunities, mostly hijacking the current session of the user or changing the look of the page by changing the HTML on the fly to steal the user's credentials. This happens because the input entered by a user has been interpreted as HTML/Javascript/VbScript by the browser.

XSS targets the users of the application instead of the server. Although this is a limitation, since it allows attackers to hijack other users' session, an attacker might attack an administrator to gain full control over the application.

Impact

There are many different attacks that can be leveraged through the use of XSS, including:

Hi-jacking users' active session

Changing the look of the page within the victims browser.

Mounting a successful phishing attack.

Intercept data and perform man-in-the-middle attacks.

Remedy

The issue occurs because the browser interprets the input as active HTML, Javascript or VbScript. To avoid this, all input and output from the application should be filtered. Output should be filtered according to the output format and location. Typically the output location is HTML. Where the output is HTML ensure that all active content is removed prior to its presentation to the server.

Prior to sanitizing user input, ensure you have a pre-defined list of both expected and acceptable characters with which you populate a white-list. This list needs only be defined once and should be used to sanitize and validate all subsequent input.

Error: A problem was encountered while executing the query <i>SELECT template_path,template_style FROM clones WHERE id = </a style=x:expre/**/ssion(netsparker(0x00002C))></i> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '</a style=x:expre/**/ssion(netsparker(0x00002C))>' at line 1

Error: A problem was encountered while executing the query <i>SELECT g.id, g.group_id, g.map_config FROM groups_config g WHERE g.group_id = '"--></style></script><script>netsparker(0x000031)</script></i> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''"--></style></script><script>netsparker(0x000031)</script>' at line 1

Database User Has Admin Privileges

Database User Has Admin Privileges

1
TOTAL

IMPORTANT

CONFIRMED

1

Netsparker identified that the target web site is connecting to the backend database by using a user that has administrative privileges. This issue has been confirmed by checking the connection privileges via an identified SQL Injection vulnerability in the application.

Impact

This can allow an attacker to gain extra privileges via SQL Injection attacks. Here is the list of attacks that the attacker might carry out:

Gain full access to the database server.

Gain a reverse shell to the database server and execute commands on the underlying operating system.

Access the database with full permissions. Where it may be possible to read, update or delete arbitrary data from the database.

Furthermore, depending on the platform and the database system user an attacker might carry out a privilege escalation attack to gain administrator access to the target system.

Remedy

Create a database user with the least possible permissions for your application and connect to the database with that user. Always follow the principle of providing the least privileges for all users and applications.

<br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Unable to save result set in <b>/mnt/book_direct/releases/20110209222312/v002/dbase/classes/trips_classes.php</b> on line <b>70</b><br />Error: A problem was encountered while executing the query <i>SELECT g.id, g.group_id, g.map_config FROM groups_config g WHERE g.group_id = (select 1 and row(1,1)>(select count(*),concat(CONCAT(CHAR(95),CHAR(33),CHAR(64),CHAR(52),CHAR(100),CHAR(105),CHAR(108),CHAR(101),CHAR(109),CHAR(109),CHAR(97)),0x3a,floor(rand()*2))x from (select 1 union select 2)a group by x limit 1))</i> Duplicate entry '_!@4dilemma:1' for key 1

Cookie Not Marked As HttpOnly

Cookie Not Marked As HttpOnly

1
TOTAL

LOW

CONFIRMED

1

Cookie was not marked as HTTPOnly. HTTPOnly cookies can not be read by client-side scripts therefore marking a cookie as HTTPOnly can provide an additional layer of protection against Cross-site Scripting attacks..

Impact

During a Cross-site Scripting attack an attacker might easily access cookies and hijack the victim's session.

Actions to Take

See the remedy for solution

Consider marking all of the cookies used by the application as HTTPOnly (After these changes javascript code will not able to read cookies.

Remedy

Mark the cookie as HTTPOnly. This will be an extra layer of defence against XSS. However this is not a silver bullet and will not protect the system against Cross-site Scripting attacks. An attacker can use a tool such as XSS Tunnel to bypass HTTPOnly protection.

Apache Version Disclosure

1
TOTAL

LOW

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.

PHP Version Disclosure

1
TOTAL

LOW

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.

Database Error Message

1
TOTAL

LOW

Netsparker identified a database 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. 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.

Error: A problem was encountered while executing the query <i>SELECT template_path,template_style FROM clones WHERE id = </a style=x:expre/**/ssion(netsparker(0x00002C))></i> You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '</a style=x:expre/**/ssion(netsparker(0x00002C))>' at line 1

Programming Error Message

Programming Error Message

1
TOTAL

LOW

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.

Identified Error Message

<b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Unable to save result set in <b>/mnt/book_direct/releases/20110209222312/v002/dbase/classes/trips_classes.php</b> on line <b>70</b>

<br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Unable to save result set in <b>/mnt/book_direct/releases/20110209222312/v002/dbase/classes/trips_classes.php</b> on line <b>70</b><br />Error: A problem was encountered while executing the query <i>SELECT template_path,template_style FROM clones WHERE id = (select 1 and row(1,1)>(select count(*),concat(CONCAT(CHAR(95),CHAR(33),CHAR(64),CHAR(52),CHAR(100),CHAR(105),CHAR(108),CHAR(101),CHAR(109),CHAR(109),CHAR(97)),0x3a,floor(rand()*2))x from (select 1 union select 2)a group by x limit 1))</i> Duplicate entry '_!@4dilemma:0' for key 1

[Possible] Internal IP Address Leakage

[Possible] Internal IP Address Leakage

1
TOTAL

LOW

Netsparker discovered an internal IP address in the page. It was not determined if the IP address was that of the system itself or that of an internal network.

Impact

This kind of information can be useful for an attacker when combined with other vulnerabilities.

Remedy

First ensure that this is not a false positive. Due to the nature of the issue. Netsparker could not confirm that this IP address was actually the real internal IP address of the target web server or internal network. If it is then consider removing it.

<br /><b>Warning</b>: mysql_query() [<a href='function.mysql-query'>function.mysql-query</a>]: Unable to save result set in <b>/mnt/book_direct/releases/20110209222312/v002/dbase/classes/trips_classes.php</b> on line <b>70</b><br />Error: A problem was encountered while executing the query <i>SELECT template_path,template_style FROM clones WHERE id = (select 1 and row(1,1)>(select count(*),concat(CONCAT(CHAR(95),CHAR(33),CHAR(64),CHAR(52),CHAR(100),CHAR(105),CHAR(108),CHAR(101),CHAR(109),CHAR(109),CHAR(97)),0x3a,floor(rand()*2))x from (select 1 union select 2)a group by x limit 1))</i> Duplicate entry '_!@4dilemma:0' for key 1