rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

Avoid deeply nested control flow statements.
Open

                  if currfieldmark == "<select" and thisfield.match(/^class=/)
                    fieldtype = get_field_val(thisfield)
                  end
Severity: Major
Found in modules/auxiliary/fuzzers/http/http_form_field.rb - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    if thisfield[:name]
                      if fuzz_this_field(thisfield[:name],thisfield[:type]) == 1
                        print_status("    - Fuzzing field #{thisfield[:name]}")
                        do_fuzz_field(thisform,thisfield[:name])
                        init_fuzzdata()
    Severity: Major
    Found in modules/auxiliary/fuzzers/http/http_form_field.rb - About 45 mins to fix

      Method build_packet has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def build_packet(dnsOpcode,dnssec,trailingnul,reqns,classns,payload)
      Severity: Minor
      Found in modules/auxiliary/fuzzers/dns/dns_fuzzer.rb - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                      if datastore['ExpandCrash']
                        print_status("Crash string : #{prepend}#{evil}")
                      else
                        print_status("Crash string : #{prepend}#{evilstr} x #{count}")
                      end
        Severity: Major
        Found in modules/auxiliary/fuzzers/ftp/ftp_pre_post.rb - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                          if fieldid == "" and fieldname != ""
                            fieldid = fieldname
                          end
          Severity: Major
          Found in modules/auxiliary/fuzzers/http/http_form_field.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                              if thisfield.match(/^name=/)
                                fieldname = get_field_val(thisfield)
                              end
            Severity: Major
            Found in modules/auxiliary/fuzzers/http/http_form_field.rb - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                              if fieldid != ""
                                formfields << {
                                  :id => fieldid,
                                  :name => fieldname,
                                  :type => fieldtype,
              Severity: Major
              Found in modules/auxiliary/fuzzers/http/http_form_field.rb - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                          if @lastdata
                            print_error("#{msg} DNS is DOWN since the request:")
                            print_error(lastdata.unpack('H*'))
                          else
                            print_error("#{msg} DNS is DOWN")
                Severity: Major
                Found in modules/auxiliary/fuzzers/dns/dns_fuzzer.rb - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                    if !dns_send(pkt,@underlayerProtocol) then return end
                  Severity: Major
                  Found in modules/auxiliary/fuzzers/dns/dns_fuzzer.rb - About 45 mins to fix

                    Method create_files has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def create_files
                        f1 = datastore['XOML_FILE'].empty? ? 'workflow.xoml' : datastore['XOML_FILE']
                        f1 << '.xoml' unless f1.downcase.end_with?('.xoml')
                        f2 = datastore['XML_FILE'].empty? ? 'workflow.xml' : datastore['XML_FILE']
                        f2 << '.xml' unless f2.downcase.end_with?('.xml')
                    Severity: Minor
                    Found in modules/evasion/windows/applocker_evasion_workflow_compiler.rb - About 45 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

                    Method encode_block has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def encode_block(state, buf)
                    
                        # Skip encoding for empty badchars
                        if(state.badchars.length == 0)
                          return buf
                    Severity: Minor
                    Found in modules/encoders/cmd/printf_php_mq.rb - About 45 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

                    Method create_files has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def create_files
                        f1 = datastore['TXT_FILE'].empty? ? 'regasm_regsvcs.txt' : datastore['TXT_FILE']
                        f1 << '.txt' unless f1.downcase.end_with?('.txt')
                        f2 = datastore['SNK_FILE'].empty? ? 'key.snk' : datastore['SNK_FILE']
                        f2 << '.snk' unless f2.downcase.end_with?('.snk')
                    Severity: Minor
                    Found in modules/evasion/windows/applocker_evasion_regasm_regsvcs.rb - About 45 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

                    Method create_aarch64_string_in_stack has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def create_aarch64_string_in_stack(string, registers: {})
                        target = registers.fetch(:destination, :x0)
                        stack = registers.fetch(:stack, :x9)
                    
                        # Instructions for pushing the bytes of the string 8 characters at a time
                    Severity: Minor
                    Found in modules/payloads/singles/osx/aarch64/shell_bind_tcp.rb - About 45 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

                    Method try_sub has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def try_sub(state, block)
                        buf   = "\x68";
                        vbuf  = ''
                        ctx   = ''
                        carry = 0
                    Severity: Minor
                    Found in modules/encoders/x86/avoid_utf8_tolower.rb - About 45 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

                    Method command_string has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def command_string
                        user = datastore['USER'] || 'metasploit'
                        pass = datastore['PASS'] || ''
                        cust = datastore['CUSTOM'] || ''
                        wmic = datastore['WMIC']
                    Severity: Minor
                    Found in modules/payloads/singles/cmd/windows/adduser.rb - About 45 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

                    Method create_aarch64_string_in_stack has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def create_aarch64_string_in_stack(string, registers: {})
                        target = registers.fetch(:destination, :x0)
                        stack = registers.fetch(:stack, :x9)
                    
                        # Instructions for pushing the bytes of the string 8 characters at a time
                    Severity: Minor
                    Found in modules/payloads/singles/osx/aarch64/shell_reverse_tcp.rb - About 45 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

                    Method create_aarch64_string_in_stack has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def create_aarch64_string_in_stack(string, registers: {})
                        target = registers.fetch(:destination, :x0)
                        stack = registers.fetch(:stack, :x9)
                    
                        # Instructions for pushing the bytes of the string 8 characters at a time
                    Severity: Minor
                    Found in modules/payloads/singles/osx/aarch64/exec.rb - About 45 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

                    Method command_string has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def command_string
                        user = datastore['USER'] || 'metasploit'
                        pass = datastore['PASS'] || ''
                        cust = datastore['CUSTOM'] || ''
                        wmic = datastore['WMIC']
                    Severity: Minor
                    Found in modules/payloads/singles/windows/adduser.rb - About 45 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

                    Method check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def check
                        unless is_43bsd?
                          vprint_warning('System does not appear to be 4.3BSD')
                        end
                    
                    
                    Severity: Minor
                    Found in modules/exploits/unix/local/emacs_movemail.rb - About 45 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

                    Method exploit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def exploit
                        auth_token = check_appkey
                        if auth_token.blank? || test_appkey(auth_token) == false
                          vprint_error 'Unable to continue: the set datastore APP_KEY value or information leak is invalid.'
                          return
                    Severity: Minor
                    Found in modules/exploits/unix/http/laravel_token_unserialize_exec.rb - About 45 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