rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

Method generate_cmdstager has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def generate_cmdstager(opts = {}, pl = nil)
    select_cmdstager(opts)

    exe_opts = {code: pl}.merge(
      platform: target_platform,
Severity: Minor
Found in lib/msf/core/exploit/cmd_stager.rb - About 1 hr to fix

    Method handle_credential_login has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def handle_credential_login(data, mod)
      # Required
      service_data = {
          address: data['address'],
          port: data['port'],
    Severity: Minor
    Found in lib/msf/core/module/external.rb - About 1 hr to fix

      Method generate_axis2 has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def generate_axis2(opts={})
          raise if not respond_to? :stager_config
      
          app_name = opts[:app_name] || Rex::Text.rand_text_alpha_lower(rand(8)+8)
      
      
      Severity: Minor
      Found in lib/msf/core/payload/java.rb - About 1 hr to fix

        Method handle_intermediate_stage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def handle_intermediate_stage(conn, payload)
            if( self.module_info['Stager']['RequiresMidstager'] == false )
              conn.put( [ payload.length ].pack('V') )
              # returning false allows stager.rb!handle_connection() to prepend the stage_prefix if needed
              return false
        Severity: Minor
        Found in lib/msf/core/payload/windows.rb - About 1 hr to fix

          Method initialize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def initialize(info = {})
              super(
                update_info(
                  info,
                  'Compat' => {
          Severity: Minor
          Found in lib/msf/core/post/file.rb - About 1 hr to fix

            Method busy_box_write_file has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def busy_box_write_file(file_path, data, prepend = false)
                if prepend
                  dir = busy_box_writable_dir
                  return false unless dir
                  cmd_exec("cp -f #{file_path} #{dir}tmp")
            Severity: Minor
            Found in lib/msf/core/post/linux/busy_box.rb - About 1 hr to fix

              Method service_change_startup has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def service_change_startup(name, mode, server = nil)
                        if mode.is_a? Integer
                          startup_number = mode
                        else
                          case mode.downcase
              Severity: Minor
              Found in lib/msf/core/post/windows/services.rb - About 1 hr to fix

                Method win_parse_results has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def win_parse_results(str)
                    tip = false
                    hashish = {}
                    lastkey = nil
                    str.each_line do |line|
                Severity: Minor
                Found in lib/msf/core/post/windows/cli_parse.rb - About 1 hr to fix

                  Method shell_registry_getvalinfo has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def shell_registry_getvalinfo(key, valname, view)
                      key = normalize_key(key)
                      value = {
                        'Data' => nil,
                        'Type' => nil
                  Severity: Minor
                  Found in lib/msf/core/post/windows/registry.rb - About 1 hr to fix

                    Method ldap_auth_opts_kerberos has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            def ldap_auth_opts_kerberos(opts, ssl)
                              auth_opts = {}
                              raise Msf::ValidationError, 'The LDAP::Rhostname option is required when using Kerberos authentication.' if opts[:ldap_rhostname].blank?
                              raise Msf::ValidationError, 'The DOMAIN option is required when using Kerberos authentication.' if opts[:domain].blank?
                    
                    
                    Severity: Minor
                    Found in lib/metasploit/framework/ldap/client.rb - About 1 hr to fix

                      Method attempt_login has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              def attempt_login(credential)
                                result_options = {
                                    credential: credential
                                }
                      
                      
                      Severity: Minor
                      Found in lib/metasploit/framework/login_scanner/db2.rb - About 1 hr to fix

                        Method attempt_login has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                def attempt_login(credential)
                                  result_opts = {
                                    credential: credential,
                                    status: Metasploit::Model::Login::Status::INCORRECT,
                                    proof: nil,

                          Method attempt_login has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  def attempt_login(credential)
                                    result_opts = {
                                      credential: credential
                                    }
                          
                          
                          Severity: Minor
                          Found in lib/metasploit/framework/login_scanner/smh.rb - About 1 hr to fix

                            Method Exec has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                        public virtual void Exec(int oldLen)
                                        {
                                            try {
                                                // generate JIT-code for Payload()
                                                Payload();
                            Severity: Minor
                            Found in external/source/exploits/cve-2013-0074/SilverApp1/MainPage.xaml.cs - About 1 hr to fix

                              Function check_logins has 8 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def check_logins(rhost, rport, targeturi, domain, usernames, passwords, timeout, user_agent):
                              Severity: Major
                              Found in modules/auxiliary/scanner/http/rdp_web_login.py - About 1 hr to fix

                                Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def __init__(self, command='', username='', password='', domain='', hashes=None, share=None,
                                Severity: Major
                                Found in modules/auxiliary/scanner/smb/impacket/dcomexec.py - About 1 hr to fix

                                  Function check_login has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                  def check_login(rhost, rport, targeturi, domain, username, password, timeout, user_agent):
                                  Severity: Major
                                  Found in modules/auxiliary/scanner/http/rdp_web_login.py - About 1 hr to fix

                                    Function _encdec has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def _encdec(self, data, K, s, S, L1, L2, L3, L4):
                                    Severity: Major
                                    Found in data/meterpreter/python/met_aes.py - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                                          if ((node.is_leaf? && !strpath.include?('.')) || node.is_root? || !node.is_leaf?) && (!usinginipath || (usinginipath && strpath.match(inipathname)))
                                      
                                                            modopts['PATH'] = strpath
                                                            print_status("Path: #{strpath}")
                                      
                                      
                                      Severity: Major
                                      Found in plugins/wmap.rb - About 1 hr to fix

                                        Method scheduleremote has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                        def scheduleremote(session,schtype,cmd,tmmod,cmdopt,targetsys,username,password)
                                        Severity: Major
                                        Found in scripts/meterpreter/scheduleme.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language