rapid7/metasploit-framework

View on GitHub

Showing 15,831 of 21,886 total issues

Method handle_ip360_v3_vuln has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def handle_ip360_v3_vuln(wspace,hobj,port,proto,hname,vulnid,vulnname,cves,bids,task=nil)
    info = { :workspace => wspace, :host => hobj, :port => port, :proto => proto, :task => task }
    if hname != "unknown" and hname[-1,1] != "?"
      info[:name] = hname
    end
Severity: Minor
Found in lib/msf/core/db_manager/import/ip360/v3.rb - About 1 hr to fix

    Method create has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def create(name, aliased_as: nil)
          # First, a direct alias check
          return create(self.aliases[name], aliased_as: name) if self.aliases[name]
    
          # Check to see if it has a module type prefix.  If it does,
    Severity: Minor
    Found in lib/msf/core/module_manager.rb - About 1 hr to fix

      Method report_session_event has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def report_session_event(opts)
          return if not active
          raise ArgumentError.new("Missing required option :session") if opts[:session].nil?
          raise ArgumentError.new("Expected an :etype") unless opts[:etype]
          session = nil
      Severity: Minor
      Found in lib/msf/core/db_manager/session_event.rb - About 1 hr to fix

        Method report_artifact has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def report_artifact(opts)
            return if not active
        
            artifacts_dir = Report::ARTIFACT_DIR
            tmp_path = opts[:file_path]
        Severity: Minor
        Found in lib/msf/core/db_manager/report.rb - About 1 hr to fix

          Method connect has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def connect
              handle = nil
          
              if(not @oci8_loaded)
                raise RuntimeError, "Could not load the Oracle driver (oci8): #{@oci8_error}"
          Severity: Minor
          Found in lib/msf/core/exploit/oracle.rb - About 1 hr to fix

            Method vim_find_vm_by_name has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def vim_find_vm_by_name(name)
                vim_setup_references
                @dcs.each do |dc|
                  soap_data = vim_soap_envelope(vim_soap_retrieve_properties('vmFolder', 'Datacenter' , dc['ref']))
                  res = vim_send_soap_request(soap_data)
            Severity: Minor
            Found in lib/msf/core/exploit/remote/vim_soap.rb - About 1 hr to fix

              Method plugin_integration has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def plugin_integration(sesskey, file_id, plugin_name, type = 'theme')
                  res = send_request_cgi(
                    'method' => 'POST',
                    'uri' => normalize_uri(target_uri.path, 'admin', 'tool', 'installaddon', 'index.php'),
                    'keep_cookies' => true,
              Severity: Minor
              Found in lib/msf/core/exploit/remote/http/moodle/admin.rb - About 1 hr to fix

                Method remove_plugin has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def remove_plugin(addon_name, moodle_version, sesskey)
                    if moodle_version < Rex::Version.new('3.9.0')
                      send_request_cgi({
                        'method' => 'POST',
                        'uri' => normalize_uri(target_uri.path, 'admin', 'index.php'),
                Severity: Minor
                Found in lib/msf/core/exploit/remote/http/moodle/admin.rb - About 1 hr to fix

                  Method exec_pod has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              def exec_pod(name, namespace, command, options = {})
                                options = {
                                  'stdin' => false,
                                  'stdout' => false,
                                  'stderr' => false,
                  Severity: Minor
                  Found in lib/msf/core/exploit/remote/http/kubernetes/client.rb - About 1 hr to fix

                    Method wordpress_upload_plugin has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def wordpress_upload_plugin(name, zip, cookie)
                        nonce = wordpress_helper_get_plugin_upload_nonce(cookie)
                        if nonce.nil?
                          vprint_error("Failed to acquire the plugin upload nonce")
                          return false
                    Severity: Minor
                    Found in lib/msf/core/exploit/remote/http/wordpress/admin.rb - About 1 hr to fix

                      Method wexec has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def wexec(disconnect=true)
                          simple.connect("\\\\#{datastore['RHOST']}\\IPC$")
                          handle = dcerpc_handle('367abb81-9844-35f1-ad32-98f038001003', '2.0', 'ncacn_np', ["\\svcctl"])
                          vprint_status("Binding to #{handle} ...")
                          dcerpc_bind(handle)
                      Severity: Minor
                      Found in lib/msf/core/exploit/remote/smb/client/web_exec.rb - About 1 hr to fix

                        Method dns_bruteforce has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def dns_bruteforce(domain, wordlist, threads)
                            return if wordlist.blank?
                            threads = 1 if threads <= 0
                        
                            queue = []
                        Severity: Minor
                        Found in lib/msf/core/exploit/remote/dns/enumeration.rb - About 1 hr to fix

                          Method encode_payload has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              def encode_payload(shellcode)
                                shellcode = shellcode.dup
                                encoder_list = get_encoders(shellcode)
                                if encoder_list.empty?
                                  cli_print "No encoder specified, outputting raw payload"
                          Severity: Minor
                          Found in lib/msf/core/payload_generator.rb - About 1 hr to fix

                            Method generate_reverse_tcp has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def generate_reverse_tcp(opts={})
                                # Set up the socket
                                cmd  = "import socket,zlib,base64,struct#{opts[:retry_wait].to_i > 0 ? ',time' : ''}\n"
                                if opts[:retry_wait].blank? # do not retry at all (old style)
                                  cmd << "s=socket.socket(2,socket.SOCK_STREAM)\n" # socket.AF_INET = 2
                            Severity: Minor
                            Found in lib/msf/core/payload/python/reverse_tcp.rb - About 1 hr to fix

                              Method find_actual_payload has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def find_actual_payload
                                  return if not actual_payload.nil?
                              
                                  # Look for one based on the exploit's compatible set
                                  if(assoc_exploit)
                              Severity: Minor
                              Found in lib/msf/core/payload/generic.rb - About 1 hr to fix

                                Method generate_migrate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def generate_migrate(opts={})
                                    %Q^
                                    load_ws2_32:
                                      push '32'
                                      push 'ws2_'
                                Severity: Minor
                                Found in lib/msf/core/payload/windows/migrate_tcp.rb - About 1 hr to fix

                                  Method generate_stage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def generate_stage(opts={})
                                      conf = opts[:datastore] || datastore
                                      conf[:staged] = true
                                      stage_uuid = opts[:uuid] || uuid
                                      key, nonce = retrieve_chacha_creds(stage_uuid)
                                  Severity: Minor
                                  Found in lib/msf/core/payload/windows/encrypted_reverse_tcp.rb - About 1 hr to fix

                                    Method assert_compatible has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        def self.assert_compatible(pe, arch)
                                          unless (arch == ARCH_X86 && pe.ptr_32?) || (arch == ARCH_X64 && pe.ptr_64?)
                                            raise Msf::ValidationError, "Selected PE file is not #{arch}"
                                          end
                                    
                                    
                                    Severity: Minor
                                    Found in lib/msf/core/payload/windows/pe_inject.rb - About 1 hr to fix

                                      Method get_vecs_entries has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              def get_vecs_entries(vecs_store)
                                                return nil unless command_exists? vecs_bin
                                      
                                                out = cmd_exec("#{vecs_bin} entry list --store #{vecs_store}")
                                                return nil if out.nil?
                                      Severity: Minor
                                      Found in lib/msf/core/post/vcenter/vcenter.rb - About 1 hr to fix

                                        Method capture_lsa_key has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          def capture_lsa_key(bootkey)
                                            vprint_status('Getting PolSecretEncryptionKey...')
                                            pol = registry_getvaldata('HKLM\\SECURITY\\Policy\\PolSecretEncryptionKey', '')
                                            if pol
                                              print_status('XP or below system')
                                        Severity: Minor
                                        Found in lib/msf/core/post/windows/priv.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language