hackedteam/fuzzer-windows

View on GitHub

Showing 56 of 193 total issues

Avoid deeply nested control flow statements.
Open

                if distance >= var_size_threshold:
                    print "[*] Function: %s -> Stack Variable: %s (%d bytes)" % ( GetFunctionName(function), prev_member, distance )

Severity: Major
Found in ie_sandbox/grayhat/stack_calc.py - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    for i in os.listdir('testcases'):
                        m = hashlib.md5()
                        m.update(open('testcases' + '\\' + i, "rb").read())
                        print '[*]\t {} : {}'.format(i, m.hexdigest())
                
    Severity: Major
    Found in fontfuzzer/fuzzers_downloaded/native.py - About 45 mins to fix

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

      def install_hooks(pydbg, image_addr, calls_name, offset, calls_n):
      Severity: Minor
      Found in ie_sandbox/broker_trace/broker_tracer.py - About 35 mins to fix

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

            def doHeadChecksum(self, handle):
                """
                To calculate the checkSum for the 'head' table which itself includes the checkSumAdjustment entry for the entire font, do the following:
        
                1] Set the checkSumAdjustment to 0.
        Severity: Minor
        Found in fontfuzzer/parsers/TTF.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 bp_set has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def bp_set(self,address):
                print "[*] Setting breakpoint at: 0x%08x" % address
                if not self.breakpoints.has_key(address):
        
                    # store the original byte
        Severity: Minor
        Found in ie_sandbox/grayhat/my_debugger.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 enumerate_threads has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def enumerate_threads(self):
                      
                thread_entry     = THREADENTRY32()
                thread_list      = []
                snapshot         = kernel32.CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, self.pid)
        Severity: Minor
        Found in ie_sandbox/grayhat/my_debugger.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 post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def post(self, uri):
        
                uriFields = uri.split('/')
        
                # add new server
        Severity: Minor
        Found in fontfuzzer/hostagent.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 exception_handler_single_step has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def exception_handler_single_step(self):
                print "[*] Exception address: 0x%08x" % self.exception_address
                # Comment from PyDbg:
                # determine if this single step event occured in reaction to a hardware breakpoint and grab the hit breakpoint.
                # according to the Intel docs, we should be able to check for the BS flag in Dr6. but it appears that windows
        Severity: Minor
        Found in ie_sandbox/grayhat/my_debugger.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 generateTestCases has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def generateTestCases(fontSourceDir):
            fonts = {}
        
            testcasesFolder = 'testcases'
            
        Severity: Minor
        Found in fontfuzzer/fuzzers_downloaded/native.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 __init__ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def __init__(self, handle, isLong, numberOfRecords):
        
                # 0 for short offsets, 1 for long
                self.isLong = isLong
        
        
        Severity: Minor
        Found in fontfuzzer/parsers/TTF.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 fuzz has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def fuzz( self ):
        
                while 1:
        
                    if not self.running:
        Severity: Minor
        Found in ie_sandbox/grayhat/file_fuzzer.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 post has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def post(self, uri):
                uriFields = uri.split('/')
                         
                            
                # extract from json array the list of nodes
        Severity: Minor
        Found in fontfuzzer/serveragent.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 post has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def post(self, uri):
                uriFields = uri.split('/')
                
                # handle fuzzer fetch/update requests
                #
        Severity: Minor
        Found in fontfuzzer/hostagent.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 getRet has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        def getRet(imm, allocaddr, max_opcodes = 300):
            addr = allocaddr
        
            for a in range(0, max_opcodes):
                op = imm.disasmForward( addr )
        Severity: Minor
        Found in ie_sandbox/grayhat/hippie_easy.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 bp_del_hw has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def bp_del_hw(self,slot):
                
                # Disable the breakpoint for all active threads
                for thread_id in self.enumerate_threads():
        
        Severity: Minor
        Found in ie_sandbox/grayhat/my_debugger.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 get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def get(self):
        
                # force 'IE9 standards' document mode, otherwise it will switch to quirks mode and fonts won't be rendered
                self.write('<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">') 
                self.write('<html><body>')
        Severity: Minor
        Found in fontfuzzer/fuzzers/browser.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