etz69/irhelper

View on GitHub

Showing 58 of 165 total issues

Avoid deeply nested control flow statements.
Open

                    if check in process:
                        ###NOt all have peb information
                        if not str(process[check]).lower() == str(rule_list[key][check]).lower() and str(process[check]).lower() != "nopeb" :

                            print("Violation detected on: [%s] "
Severity: Major
Found in modules/cmds/vol_pslist_module.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    for flag in acb_flags:                        #Compare the two hex values and check if one is contained in the other, if so save it
                        if bool(flag & b[7]):
                            flags.append(acb_flags[flag])
                    f_values[b[6]].append(flags)
Severity: Major
Found in modules/utils/samparser.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if len(result['hollow']) != 0:
                        for hollow_process in result['hollow']:
                            if str(hollow_process['pid']) == str(process_list['pid']):
                                process_list['hollow'] = True

Severity: Major
Found in modules/cmds/vol_malfind_extended_module.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    for flag in f_values[RID][3]:
                        results['users'][user]['Account Flags'] += (flag + " | ")
                    results['users'][user]['Failed Login Count'] = f_values[RID][4]
Severity: Major
Found in modules/utils/samparser.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if struct.unpack("<B", data[offset:offset+1])[0] == 0:
                            offset = offset+1
                        results['groups'][groupname]['Members'] += binary_to_sid(data[offset:offset+12])
Severity: Major
Found in modules/utils/samparser.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if int(suspicious_process['risk_index']) >= int(risk_level):
                        list_of_suspicious_processes.append(suspicious_process.copy())

Severity: Major
Found in modules/utils/helper.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if eth_payload.is_tcp():
                            payload = obj.Object('_TCP', vm=session_space,
                                offset=eth_payload.payload_offset())
                        elif eth_payload.is_udp():
                            payload = obj.Object('_UDP', vm=session_space,
Severity: Major
Found in vol_plugins/ndispktscan.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if username != None:
                            results['groups'][groupname]['Members'] += " -> " + username + "</br>"
                        else:
                            results['groups'][groupname]['Members'] += "\t\n"
                        newOffset += 12
Severity: Major
Found in modules/utils/samparser.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                    if flag:
                        net_info.append((rs[0], rs[1]))

Severity: Major
Found in modules/cmds/vol_netscan_module.py - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                        if "country" in i:
                            countries.append(i['country'][0])

Severity: Major
Found in modules/utils/helper.py - About 45 mins to fix

Function update_value has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def update_value(self, table_name, column_name, value, key_name, key):
Severity: Minor
Found in modules/db/DBops.py - About 35 mins to fix

Function vol_cmdscan has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def vol_cmdscan(_project):
    global result

    print_header("Running cmdscan command")
    rdb = dbops.DBOps(_project.db_name)
Severity: Minor
Found in modules/cmds/vol_cmdline_module.py - About 35 mins to fix

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

Function valid_ip has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def valid_ip(input_string):
    #Return if IP not local/Brodacast and if private or public

    if not is_ipv4(input_string):
        return False,False
Severity: Minor
Found in modules/utils/helper.py - About 35 mins to fix

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

Function prep_cmd has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def prep_cmd(self, **kwargs):
        '''
        Prepares for running the required command from module/cmds

        Args:
Severity: Minor
Found in modules/cmd_processor.py - About 35 mins to fix

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

Function calculate_shanon_string has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def calculate_shanon_string(input):

    stList = list(input)
    alphabet = list(Set(stList)) # list of symbols in the string
    freqList = []
Severity: Minor
Found in modules/utils/helper.py - About 35 mins to fix

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

Function calculate_md5 has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def calculate_md5():
    print_header("Calculating MD5 of dumped files..")

    rdb = dbops.DBOps("results.db")

Severity: Minor
Found in modules/cmds/vol_pslist_module.py - About 25 mins to fix

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

Function detect_proc_hollow has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def detect_proc_hollow(self):
        """Detects hollowed processes and returns dictionary with pid as the key and type of process hollowing as value"""
        proc_peb_info = self.get_proc_peb_info()
        proc_vad_info = self.get_proc_vad_info()
        hol_type = None
Severity: Minor
Found in vol_plugins/hollowfind.py - About 25 mins to fix

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

Function binary_shanon_entropy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def binary_shanon_entropy(data, _debug=False):
    entropy = 0
    count = dict()
    for c in data:
        try:
Severity: Minor
Found in modules/utils/helper.py - About 25 mins to fix

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

Severity
Category
Status
Source
Language