Method sploit
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sploit
user = cmd_exec("whoami").chomp
vprint_status("The current effective user is #{user}. Starting the sploit")
# Get size of sudoers file
sudoer_path = "/etc/sudoers"
Method initialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(update_info(info,
'Name' => 'Mac OS X 10.9.5 / 10.10.5 - rsh/libmalloc Privilege Escalation',
'Description' => %q{
This module writes to the sudoers file without root access by exploiting rsh and malloc log files.
Method exploit
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exploit
if is_root?
fail_with Failure::BadConfig, 'Session already has root privileges'
end
Method exploit
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def exploit
if is_root?
fail_with Failure::BadConfig, 'Session already has root privileges'
end
- 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 cleanup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cleanup
vprint_status("Starting the cron restore process...")
super
# Restore crontab back to is original state
# If we don't do this, then cron will continue to append the no password rule to sudoers.
- 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 sploit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def sploit
user = cmd_exec("whoami").chomp
vprint_status("The current effective user is #{user}. Starting the sploit")
# Get size of sudoers file
sudoer_path = "/etc/sudoers"
- 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"