modules/exploits/osx/browser/safari_proxy_object_type_confusion.rb
Method on_request_uri
has 323 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def on_request_uri(cli, request)
user_agent = request['User-Agent']
print_status("Request from #{user_agent}")
offsets = get_offsets(user_agent)
unless offsets
File safari_proxy_object_type_confusion.rb
has 458 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class MetasploitModule < Msf::Exploit::Remote
Rank = ManualRanking
include Msf::Post::File
include Msf::Exploit::EXE
Method offset_table
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def offset_table
{
'10.12.6' => {
jsc_vtab: '0x0000d8d8',
dyld_stub_loader: '0x00001168',
Method get_offsets
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
def get_offsets(user_agent)
if user_agent =~ /Intel Mac OS X (.*?)\)/
osx_version = $1.gsub("_", ".")
if user_agent =~ /Version\/(.*?) /
if Rex::Version.new($1) >= Rex::Version.new('11.1.1')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method initialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(info = {})
super(update_info(info,
'Name' => 'Safari Proxy Object Type Confusion',
'Description' => %q{
This module exploits a type confusion bug in the Javascript Proxy object in
Method get_offsets
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_offsets(user_agent)
if user_agent =~ /Intel Mac OS X (.*?)\)/
osx_version = $1.gsub("_", ".")
if user_agent =~ /Version\/(.*?) /
if Rex::Version.new($1) >= Rex::Version.new('11.1.1')