rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'Kemp LoadMaster Unauthenticated Command Injection',

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

      def initialize(info = {})
        super(
          update_info(
            info,
            'Name' => 'Froxlor Log Path RCE',
    Severity: Major
    Found in modules/exploits/linux/http/froxlor_log_path_rce.rb - About 2 hrs to fix

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

        def initialize(info = {})
          super(
            update_info(
              info,
              'Name' => 'GLPI htmLawed php command injection',
      Severity: Major
      Found in modules/exploits/linux/http/glpi_htmlawed_php_injection.rb - About 2 hrs to fix

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

          def initialize(info = {})
            super(update_info(info,
              'Name'               => 'Webmin password_change.cgi Backdoor',
              'Description'        => %q{
                This module exploits a backdoor in Webmin versions 1.890 through 1.920.
        Severity: Major
        Found in modules/exploits/linux/http/webmin_backdoor.rb - About 2 hrs to fix

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

            def initialize(info = {})
              super(
                update_info(
                  info,
                  'Name' => 'Cisco UCS Director default scpuser password',
          Severity: Major
          Found in modules/exploits/linux/ssh/cisco_ucs_scpuser.rb - About 2 hrs to fix

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

              def run
                type = datastore['METHOD']
                remote = datastore['TARGET']
                thread_num = datastore['THREADS']
                proto = datastore['PROTOCOL']
            Severity: Major
            Found in modules/post/multi/recon/multiport_egress_traffic.rb - About 2 hrs to fix

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

                def run
                  fail_with(Failure::BadConfig, 'Invalid action') if action.nil?
              
                  scutil_path = datastore['SCUTIL_PATH'].shellescape
                  networksetup_path = datastore['NETWORKSETUP_PATH'].shellescape
              Severity: Major
              Found in modules/post/osx/manage/vpn.rb - About 2 hrs to fix

                Method parse_creds has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def parse_creds(f)
                    cred_table = Rex::Text::Table.new(
                      'Header' => 'Postgres Data',
                      'Indent' => 1,
                      'Columns' => ['Host', 'Port', 'DB', 'User', 'Password']
                Severity: Major
                Found in modules/post/multi/gather/pgpass_creds.rb - About 2 hrs to fix

                  Method read_response has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def read_response(t = -1, opts = {})
                      # Return a nil response if timeout is nil or 0
                      return if t.nil? || t == 0
                  
                      resp = Response.new
                  Severity: Major
                  Found in lib/rex/proto/http/client.rb - About 2 hrs to fix

                    Method generate_simple has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def self.generate_simple(payload, opts, &block)
                    
                        # Clone the module to prevent changes to the original instance
                        payload = payload.replicant
                        Msf::Simple::Framework.simplify_module(payload)
                    Severity: Major
                    Found in lib/msf/base/simple/payload.rb - About 2 hrs to fix

                      Method exploit_simple has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def self.exploit_simple(oexploit, opts, &block)
                          exploit = oexploit.replicant
                          # Trap and print errors here (makes them UI-independent)
                          begin
                            # Clone the module to prevent changes to the original instance
                      Severity: Major
                      Found in lib/msf/base/simple/exploit.rb - About 2 hrs to fix

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

                          def start_handler
                        
                            # Maximum number of seconds to run the handler
                            ctimeout = 150
                        
                        
                        Severity: Major
                        Found in lib/msf/core/handler/bind_tcp.rb - About 2 hrs to fix

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

                            def start_handler
                          
                              # Maximum number of seconds to run the handler
                              ctimeout = 150
                          
                          
                          Severity: Major
                          Found in lib/msf/core/handler/bind_sctp.rb - About 2 hrs to fix

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

                              def start_handler
                            
                                # Maximum number of seconds to run the handler
                                ctimeout = 150
                            
                            
                            Severity: Major
                            Found in lib/msf/core/handler/bind_aws_ssm.rb - About 2 hrs to fix

                              Method import_retina_xml has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def import_retina_xml(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/retina.rb - About 2 hrs to fix

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

                                  def on_new_session(client)
                                    if client.type != "meterpreter"
                                      print_error("NOTE: you must use a meterpreter payload in order to automatically cleanup.")
                                      print_error("The vbs payload and mof file must be removed manually.")
                                      return
                                modules/exploits/windows/browser/hp_easy_printer_care_xmlcachemgr.rb on lines 72..97

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

                                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 on_new_session(client)
                                    if client.type != "meterpreter"
                                      print_error("NOTE: you must use a meterpreter payload in order to automatically cleanup.")
                                      print_error("The vbs payload and mof file must be removed manually.")
                                      return
                                modules/exploits/windows/browser/hp_easy_printer_care_xmlsimpleaccessor.rb on lines 72..96

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

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

                                      when action.name == 'LISTAUDIOS'
                                        res = http_post('listAudios')
                                        unless res
                                          print_error("#{peer}- Error Connecting")
                                          return
                                modules/auxiliary/scanner/http/es_file_explorer_open_port.rb on lines 94..111
                                modules/auxiliary/scanner/http/es_file_explorer_open_port.rb on lines 112..129

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

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

                                  def build_get_os
                                    builder = Rex::Java::Serialization::Builder.new
                                
                                    object_array = builder.new_array(
                                        values_type: 'java.lang.Object;',
                                Severity: Major
                                Found in modules/exploits/multi/http/jboss_invoke_deploy.rb and 2 other locations - About 2 hrs to fix
                                modules/exploits/multi/http/jboss_invoke_deploy.rb on lines 365..390
                                modules/exploits/multi/http/jboss_invoke_deploy.rb on lines 421..446

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

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

                                  def build_get_version
                                    builder = Rex::Java::Serialization::Builder.new
                                
                                    object_array = builder.new_array(
                                      values_type: 'java.lang.Object;',
                                Severity: Major
                                Found in modules/exploits/multi/http/jboss_invoke_deploy.rb and 2 other locations - About 2 hrs to fix
                                modules/exploits/multi/http/jboss_invoke_deploy.rb on lines 393..418
                                modules/exploits/multi/http/jboss_invoke_deploy.rb on lines 421..446

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

                                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