rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

Method make_ntlmv2_clientchallenge has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def self.make_ntlmv2_clientchallenge(win_domain, win_name, dns_domain, dns_name,
              client_challenge = nil, chall_MsvAvTimestamp = nil, spnopt = {})
Severity: Major
Found in lib/rex/proto/ntlm/utils.rb - About 50 mins to fix

    Method create_rakp_hmac_sha1_salt has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def self.create_rakp_hmac_sha1_salt(con_sid, bmc_sid, con_rid, bmc_rid, bmc_gid, auth_level, username)
    Severity: Major
    Found in lib/rex/proto/ipmi/utils.rb - About 50 mins to fix

      Method trans has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def trans(pipe, param = '', body = '', setup_count = 0, setup_data = '', no_response = false, do_recv = true)
      Severity: Major
      Found in lib/rex/proto/smb/client.rb - About 50 mins to fix

        Method initialize has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def initialize(port = 22, listen_host = '0.0.0.0', context = {}, comm = nil,
            ssh_opts = default_options, cc_cb = nil, cd_cb = nil)
        Severity: Major
        Found in lib/rex/proto/ssh/server.rb - About 50 mins to fix

          Method trans_nonull has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            def trans_nonull(pipe, param = '', body = '', setup_count = 0, setup_data = '', no_response = false, do_recv = true)
          Severity: Major
          Found in lib/rex/proto/smb/client.rb - About 50 mins to fix

            Method initialize has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              def initialize(host, port, options, tty, database, user, auth)
            Severity: Major
            Found in lib/postgres/postgres-pr/postgres-compat.rb - About 50 mins to fix

              Method parse_host has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                def parse_host(host, wspace, blacklist, allow_yaml, btag, args, &block)
              Severity: Major
              Found in lib/msf/core/db_manager/import/metasploit_framework/xml.rb - About 50 mins to fix

                Method request_delegation_ticket has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  def request_delegation_ticket(session_key, tgt_ticket, realm, client_name, tgt_etype, expiry_time, now)
                Severity: Major
                Found in lib/msf/core/exploit/remote/kerberos/service_authenticator/base.rb - About 50 mins to fix

                  Method sign_jar has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                    def sign_jar(cert_cn, unsiged_jar, signed_jar, cert_alias="signFiles", msf_keystore="msfkeystore",
                        msf_store_pass="msfstorepass", msf_key_pass="msfkeypass")
                  Severity: Major
                  Found in lib/msf/core/exploit/java.rb - About 50 mins to fix

                    Method start_http_fetch_handler has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      def start_http_fetch_handler(srvname, srvexe, ssl=false, ssl_cert=nil, ssl_compression=nil, ssl_cipher=nil, ssl_version=nil)
                    Severity: Major
                    Found in lib/msf/core/payload/adapter/fetch/server/http.rb - About 50 mins to fix

                      Method routine_control has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        def routine_control(bus, src_id, dst_id, routine_type, id, data = [], opt = {})
                      Severity: Major
                      Found in lib/msf/core/post/hardware/automotive/uds.rb - About 50 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                            if name[-4:] == '.asm':
                                                build(name[:-4])
                                    for root, dirs, files in os.walk('./src/stage/'):
                        Severity: Major
                        Found in external/source/shellcode/windows/x64/build.py - About 45 mins to fix

                          Function setup_logging has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def setup_logging(verbose=True, log_file=None):
                              """Configure logging."""
                              if log_file is not None:
                                  logging.basicConfig(level=logging.DEBUG,
                                                      format="%(asctime)s: %(levelname)s: %(module)s: %(message)s",
                          Severity: Minor
                          Found in modules/auxiliary/gather/office365userenum.py - 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

                          Avoid deeply nested control flow statements.
                          Open

                              } else if WebRequestCodeResponse(url5) == 401 {
                                  urlToHarvest = url5
                              } else if WebRequestCodeResponse(url6) == 401 {
                                  urlToHarvest = url6
                              } else {
                          Severity: Major
                          Found in modules/auxiliary/scanner/msmail/shared/src/msmail/msmail.go - About 45 mins to fix

                            Function get_output has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def get_output(self):
                                    def output_callback(data):
                                        self._outputBuffer += data.decode("utf-8")
                            
                                    if self._noOutput is True:
                            Severity: Minor
                            Found in modules/auxiliary/scanner/smb/impacket/_msf_impacket.py - 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 doWork has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                public static void doWork(Help h, Exploit expl, String data, String jar, String lhost, int lport) {
                            Severity: Minor
                            Found in external/source/exploits/CVE-2012-0507/msf/x/Help.java - About 45 mins to fix

                              Function off2addr has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                              function off2addr(segs, off)
                              {
                                  if(!(off instanceof Int64)) off = new Int64(off);
                                  for(var i = 0; i < segs.length; ++i)
                                  {
                              Severity: Minor
                              Found in data/exploits/javascript_utils/utils.js - 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

                              Avoid deeply nested control flow statements.
                              Open

                                                  if name[-4:] == '.asm':
                                                      build(name[:-4])
                                          for root, dirs, files in os.walk('./src/single/'):
                              Severity: Major
                              Found in external/source/shellcode/windows/x64/build.py - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    for name in files:
                                                        build(name[:-4])
                                                for root, dirs, files in os.walk('./src/stage/'):
                                Severity: Major
                                Found in external/source/shellcode/windows/x86/build.py - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if name[-4:] == '.asm':
                                                          build(name[:-4])
                                          else:
                                  Severity: Major
                                  Found in external/source/shellcode/windows/x64/build.py - About 45 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language