Method weak_file_permissions
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def weak_file_permissions(service_name, service, _path, token)
success = false
vprint_status("[#{service_name}] Checking for weak file permissions")
# get path to exe; parse out quotes and arguments
- 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 exploit
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def exploit
if is_system?
fail_with(Failure::None, 'Session is already elevated')
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 weak_registry_permissions
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def weak_registry_permissions(service_name)
# check the system and payload architectures are compatible, otherwise this technique won't work
return false if sysinfo['Architecture'] != payload_arch
vprint_status("[#{service_name}] Checking for weak registry permissions")
- 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 weak_file_permissions
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def weak_file_permissions(service_name, service, _path, token)
success = false
vprint_status("[#{service_name}] Checking for weak file permissions")
# get path to exe; parse out quotes and arguments
Method weak_registry_permissions
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def weak_registry_permissions(service_name)
# check the system and payload architectures are compatible, otherwise this technique won't work
return false if sysinfo['Architecture'] != payload_arch
vprint_status("[#{service_name}] Checking for weak registry permissions")
Method initialize
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'Windows Escalate Service Permissions Local Privilege Escalation',
Method exploit
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def exploit
if is_system?
fail_with(Failure::None, 'Session is already elevated')
end
Method weak_service_permissions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def weak_service_permissions(service_name, service, path)
success = false
vprint_status("[#{service_name}] Checking for weak service permissions")
if (service_change_config(service_name, { path: path }) == ERROR::SUCCESS)
- 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"