modules/exploits/windows/nimsoft/nimcontroller_bof.rb
Method parse_listing
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
Open
def parse_listing(response, directory)
result = { 'name' => '', 'date' => '', 'size' => '', 'type' => '' }
i = 0
begin
- 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
File nimcontroller_bof.rb
has 375 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class MetasploitModule < Msf::Exploit::Remote
Rank = ExcellentRanking
include Msf::Exploit::Remote::Tcp
prepend Msf::Exploit::Remote::AutoCheck
Method generate_rop_chain
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def generate_rop_chain
# RAX -> HMODULE GetModuleHandleA(
# ( RCX == *module ) LPCSTR lpModuleName,
# );
rop_gadgets = [0x0000000140018c42] * 15 # ret
Method parse_listing
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def parse_listing(response, directory)
result = { 'name' => '', 'date' => '', 'size' => '', 'type' => '' }
i = 0
begin
Method initialize
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(info = {})
super(
update_info(
info,
'Name' => 'CA Unified Infrastructure Management Nimsoft 7.80 - Remote Buffer Overflow',
Method generate_probe
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def generate_probe(probe, args)
client = "#{rand_text_alphanumeric(14)}\x00"
packet_args = ''
probe += "\x00"
Method exploit
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def exploit
connect
shellcode = make_nops(500)
shellcode << payload.encoded