rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method gather_minion_data has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def gather_minion_data
    print_status('Gathering data from minions (this can take some time)')
    command = []
    if datastore['GETHOSTNAME']
      command << 'network.get_hostname'
Severity: Major
Found in modules/post/multi/gather/saltstack_salt.rb - About 2 hrs to fix

    Method run has 65 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def run
        tries = 0
    
        begin
          print_status('Obtaining the boot key...')
    Severity: Major
    Found in modules/post/windows/gather/hashdump.rb - About 2 hrs to fix

      Method read_hashdump has 65 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def read_hashdump
          host = session.session_host
          collected_hashes = ''
          tries = 1
      
      
      Severity: Major
      Found in modules/post/windows/gather/smart_hashdump.rb - About 2 hrs to fix

        Method run has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def run
            ### MAIN ###
            client = session
        
            domain = nil
        Severity: Major
        Found in modules/post/windows/recon/computer_browser_discovery.rb - About 2 hrs to fix

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

            def initialize(info = {})
              super(
                update_info(
                  info,
                  'Name' => 'WhatsUp Gold Credentials Dump',

            Method run has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def run
                reg_key = 'HKLM\\SAM\\SAM\\Domains\\Account\\Users'
            
                unless is_system?
                  if datastore['GETSYSTEM']
            Severity: Major
            Found in modules/post/windows/manage/enable_support_account.rb - About 2 hrs to fix

              Method choose_mem_regions has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def choose_mem_regions(pid, match_data = [])
                  return [] if match_data.empty?
              
                  mem_regions = []
                  match_data.each do |match|
              Severity: Major
              Found in modules/post/linux/gather/mimipenguin.rb - About 2 hrs to fix

                Method is_hash_from_empty_pwd? has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def self.is_hash_from_empty_pwd?(arg)
                    hash_type = arg[:type]
                    raise ArgumentError,"arg[:type] is mandatory" if not hash_type
                    raise ArgumentError,"arg[:type] must be lm or ntlm" if not hash_type  =~ /^((lm)|(ntlm))$/
                
                
                Severity: Major
                Found in lib/rex/proto/ntlm/crypt.rb - About 2 hrs to fix

                  Method start has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def start
                        # create a thread to handle this client request so as to not block the socks4a server
                        @client_thread = Rex::ThreadFactory.spawn("SOCKS4AProxyClient", false) do
                          begin
                            @server.add_client( self )
                  Severity: Major
                  Found in lib/rex/proto/proxy/socks4a.rb - About 2 hrs to fix

                    Method add_dns has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def add_dns(*args)
                        rules = ['*']
                        first_rule = true
                        comm = nil
                        resolvers = []
                    Severity: Major
                    Found in lib/msf/ui/console/command_dispatcher/dns.rb - About 2 hrs to fix

                      Method extract_module_detail_info has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def extract_module_detail_info(report_file)
                            Mdm::Module::Detail.all.each do |m|
                            report_file.write("<module_detail>\n")
                            #m_id = m.attributes["id"]
                      
                      
                      Severity: Major
                      Found in lib/msf/core/db_export.rb - About 2 hrs to fix

                        Method stage_meterpreter has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def stage_meterpreter(opts={})
                            ds = opts[:datastore] || datastore
                            met = MetasploitPayloads.read('meterpreter', 'meterpreter.py')
                        
                            var_escape = lambda { |txt|
                        Severity: Major
                        Found in lib/msf/core/payload/python/meterpreter_loader.rb - About 2 hrs to fix

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                              scanner.scan! do |result|
                                credential_data = result.to_h
                                credential_data.merge!(
                                    module_fullname: self.fullname,
                                    workspace_id: myworkspace_id
                          Severity: Major
                          Found in modules/auxiliary/scanner/http/axis_login.rb and 1 other location - About 2 hrs to fix
                          modules/auxiliary/scanner/http/wordpress_xmlrpc_login.rb on lines 72..95

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 95.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Identical blocks of code found in 2 locations. Consider refactoring.
                          Open

                              scanner.scan! do |result|
                                credential_data = result.to_h
                                credential_data.merge!(
                                    module_fullname: self.fullname,
                                    workspace_id: myworkspace_id
                          Severity: Major
                          Found in modules/auxiliary/scanner/http/wordpress_xmlrpc_login.rb and 1 other location - About 2 hrs to fix
                          modules/auxiliary/scanner/http/axis_login.rb on lines 82..105

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 95.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                  {
                                    'Offsets' =>
                                      {
                                        'LPORT' => [ 20, 'n' ],
                                      },
                          Severity: Major
                          Found in modules/payloads/stagers/linux/x64/bind_tcp.rb and 1 other location - About 2 hrs to fix
                          modules/payloads/singles/linux/x64/shell_bind_tcp.rb on lines 26..75

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 95.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                  {
                                    'Offsets' =>
                                      {
                                        'LPORT' => [ 20, 'n' ],
                                      },
                          Severity: Major
                          Found in modules/payloads/singles/linux/x64/shell_bind_tcp.rb and 1 other location - About 2 hrs to fix
                          modules/payloads/stagers/linux/x64/bind_tcp.rb on lines 24..73

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 95.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                            def setup_handler
                              if !datastore['Proxies'].blank? && !datastore['ReverseAllowProxy']
                                raise RuntimeError, "TCP connect-back payloads cannot be used with Proxies. Use 'set ReverseAllowProxy true' to override this behaviour."
                              end
                          
                          
                          Severity: Major
                          Found in lib/msf/core/handler/reverse_tcp_ssl.rb and 1 other location - About 2 hrs to fix
                          lib/msf/core/handler/reverse_tcp_double_ssl.rb on lines 65..102

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 95.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                            def setup_handler
                              if !datastore['Proxies'].blank? && !datastore['ReverseAllowProxy']
                                raise RuntimeError, 'TCP connect-back payloads cannot be used with Proxies. Can be overridden by setting ReverseAllowProxy to true'
                              end
                          
                          
                          Severity: Major
                          Found in lib/msf/core/handler/reverse_tcp_double_ssl.rb and 1 other location - About 2 hrs to fix
                          lib/msf/core/handler/reverse_tcp_ssl.rb on lines 44..79

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 95.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Method scheduleremote has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          def scheduleremote(session,schtype,cmd,tmmod,cmdopt,targetsys,username,password)
                            execmd = ""
                            success = false
                            taskname = "syscheck#{rand(100)}"
                            if cmdopt != nil
                          Severity: Major
                          Found in scripts/meterpreter/scheduleme.rb - About 2 hrs to fix

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

                              def initialize(info = {})
                                super(
                                  update_info(
                                    info,
                                    'Name' => 'Windows Secrets Dump',
                            Severity: Major
                            Found in modules/auxiliary/gather/windows_secrets_dump.rb - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language