rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method cmd_unset_with_fallbacks has 58 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def cmd_unset_with_fallbacks(*args)
    if args.include?('-h') || args.include?('--help')
      cmd_unset_help
      return
    end
Severity: Major
Found in lib/msf/ui/console/command_dispatcher/core.rb - About 2 hrs to fix

    Method check_multiple has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def check_multiple(mod)
        rhosts_walker = Msf::RhostsWalker.new(mod.datastore['RHOSTS'], mod.datastore).to_enum
        rhosts_walker_count = rhosts_walker.count
    
        # Short-circuit check_multiple if it's a single host, or doesn't have any hosts set
    Severity: Major
    Found in lib/msf/ui/console/module_command_dispatcher.rb - About 2 hrs to fix

      Method start_handler has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def start_handler
          if datastore['EC2_ID'].blank?
            raise Msf::OptionValidateError.new({ 'EC2_ID' => "EC2_ID cannot be blank" })
          end
      
      
      Severity: Major
      Found in lib/msf/core/handler/bind_aws_instance_connect.rb - About 2 hrs to fix

        Method import_msf_zip has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def import_msf_zip(args={}, &block)
            data = args[:data]
            wspace = Msf::Util::DBManager.process_opts_workspace(args, framework)
            bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []
        
        
        Severity: Major
        Found in lib/msf/core/db_manager/import/metasploit_framework/zip.rb - About 2 hrs to fix

          Method import_nessus_xml_v2 has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def import_nessus_xml_v2(args={}, &block)
              data = args[:data]
              wspace = Msf::Util::DBManager.process_opts_workspace(args, framework).name
              bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []
          
          
          Severity: Major
          Found in lib/msf/core/db_manager/import/nessus/xml/v2.rb - About 2 hrs to fix

            Method prepare_exec has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def prepare_exec(sql)
                begin
                  sploit = connect.parse(sql)
                rescue ::OCIError => e
                  print_error("#{e.to_s}")
            Severity: Major
            Found in lib/msf/core/exploit/oracle.rb - About 2 hrs to fix

              Method handle_exception has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def handle_exception e
                  msg = setup_fail_detail_from_exception e
              
                  case e
                    when Msf::Exploit::Complete
              Severity: Major
              Found in lib/msf/core/exploit.rb - About 2 hrs to fix

                Method php_system_block has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def php_system_block(options = {})
                    cmd = options[:cmd_varname] || '$cmd'
                    dis = options[:disabled_varname] || @dis || '$' + Rex::Text.rand_text_alpha(rand(4) + 4)
                    output = options[:output_varname] || '$' + Rex::Text.rand_text_alpha(rand(4) + 4)
                
                
                Severity: Major
                Found in lib/msf/core/payload/php.rb - About 2 hrs to fix

                  Method run_packrat has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def run_packrat(userprofile, opts = {})
                            vprint_status 'Starting Packrat...'
                            artifact_parent = opts[:gatherable_artifacts]
                            application = opts[:application]
                  
                  
                  Severity: Major
                  Found in lib/msf/core/post/windows/packrat.rb - About 2 hrs to fix

                    Method scan! has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                              def scan!
                                valid!
                    
                                # Keep track of connection errors.
                                # If we encounter too many, we will stop.
                    Severity: Major
                    Found in lib/metasploit/framework/login_scanner/base.rb - About 2 hrs to fix

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

                        def get_target(agent)
                          return target if target.name != 'Automatic'
                      
                          nt = agent.scan(/Windows NT (\d\.\d)/).flatten[0] || ''
                          ie = agent.scan(/MSIE (\d)/).flatten[0] || ''
                      Severity: Major
                      Found in modules/exploits/windows/browser/ie_cgenericelement_uaf.rb and 1 other location - About 2 hrs to fix
                      modules/exploits/windows/browser/ie_cbutton_uaf.rb on lines 86..116

                      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 87.

                      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

                        def get_target(agent)
                          #If the user is already specified by the user, we'll just use that
                          return target if target.name != 'Automatic'
                      
                          nt = agent.scan(/Windows NT (\d\.\d)/).flatten[0] || ''
                      Severity: Major
                      Found in modules/exploits/windows/browser/ie_cbutton_uaf.rb and 1 other location - About 2 hrs to fix
                      modules/exploits/windows/browser/ie_cgenericelement_uaf.rb on lines 81..110

                      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 87.

                      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 initialize( info = {} )
                      
                          super( update_info( info,
                            'Name'          => 'Java Applet Driver Manager Privileged toString() Remote Code Execution',
                            'Description'   => %q{
                      Severity: Major
                      Found in modules/exploits/multi/browser/java_jre17_driver_manager.rb and 1 other location - About 2 hrs to fix
                      modules/exploits/multi/browser/java_jre17_provider_skeleton.rb on lines 17..72

                      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 87.

                      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 initialize( info = {} )
                      
                          super( update_info( info,
                            'Name'          => 'Java Applet ProviderSkeleton Insecure Invoke Method',
                            'Description'   => %q{
                      modules/exploits/multi/browser/java_jre17_driver_manager.rb on lines 15..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 87.

                      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 4 locations. Consider refactoring.
                      Open

                        swagger_path '/api/v1/events/{id}' do
                          # Swagger documentation for /api/v1/events/:id GET
                          operation :get do
                            key :description, 'Return a specific event that is stored in the database.'
                            key :tags, [ 'event' ]
                      lib/msf/core/web_services/documentation/api/v1/session_api_doc.rb on lines 88..123
                      lib/msf/core/web_services/documentation/api/v1/session_event_api_doc.rb on lines 136..171
                      lib/msf/core/web_services/documentation/api/v1/vuln_attempt_api_doc.rb on lines 115..150

                      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 86.

                      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

                        class MessageEncryptor
                      
                          module NullSerializer #:nodoc:
                      
                            def self.load(value)
                      modules/exploits/multi/http/rails_secret_deserialization.rb on lines 32..77

                      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 86.

                      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

                        data.unpack("n*").each do |inp|
                          fl = (inp & 0xff00) >> 8
                          vk = (inp & 0xff)
                          kc = VirtualKeyCodes[vk]
                      
                      
                      Severity: Major
                      Found in scripts/meterpreter/keylogrecorder.rb and 1 other location - About 2 hrs to fix
                      modules/post/windows/capture/lockout_keylogger.rb on lines 100..121

                      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 86.

                      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 4 locations. Consider refactoring.
                      Open

                        swagger_path '/api/v1/sessions/{id}' do
                          # Swagger documentation for /api/v1/sessions/:id GET
                          operation :get do
                            key :description, 'Return a specific session that is stored in the database.'
                            key :tags, [ 'session' ]
                      lib/msf/core/web_services/documentation/api/v1/event_api_doc.rb on lines 138..173
                      lib/msf/core/web_services/documentation/api/v1/session_event_api_doc.rb on lines 136..171
                      lib/msf/core/web_services/documentation/api/v1/vuln_attempt_api_doc.rb on lines 115..150

                      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 86.

                      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

                            data.unpack('n*').each do |inp|
                              fl = (inp & 0xff00) >> 8
                              vk = (inp & 0xff)
                              kc = VirtualKeyCodes[vk]
                      
                      
                      Severity: Major
                      Found in modules/post/windows/capture/lockout_keylogger.rb and 1 other location - About 2 hrs to fix
                      scripts/meterpreter/keylogrecorder.rb on lines 120..141

                      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 86.

                      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

                        class MessageEncryptor
                      
                          module NullSerializer #:nodoc:
                      
                            def self.load(value)
                      Severity: Major
                      Found in modules/exploits/multi/http/rails_secret_deserialization.rb and 1 other location - About 2 hrs to fix
                      modules/exploits/multi/http/metasploit_static_secret_key_base.rb on lines 32..77

                      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 86.

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language