rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method frfxdmp has 122 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def frfxdmp(usrnm)
  sitesvisited = []
  dnldsmade = []
  bkmrks = []
  cookies = []
Severity: Major
Found in scripts/meterpreter/enum_firefox.rb - About 4 hrs to fix

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

      def run
        # check if we already have a socket, if not, create one
        unless @sock
          # create a socket
          res_code, sock_or_msg = create_socket_for_xnode(rhost, rport)
    Severity: Major
    Found in modules/auxiliary/gather/manageengine_datasecurity_plus_xnode_enum.rb - About 4 hrs to fix

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

        def run
          # check if we already have a socket, if not, create one
          unless @sock
            # create a socket
            res_code, sock_or_msg = create_socket_for_xnode(rhost, rport)
      Severity: Major
      Found in modules/auxiliary/gather/manageengine_adaudit_plus_xnode_enum.rb - About 4 hrs to fix

        Method create_library has 122 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def self.create_library(constant_manager, library_path = 'libc.dylib')
            lib = Library.new(library_path, constant_manager)
        
            lib.add_function(
              'calloc',

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

            def run
              host = datastore['HOST']
              port = datastore['PORT']
              local_host = datastore['SRVHOST']
              local_port = datastore['SRVPORT']
          Severity: Major
          Found in modules/auxiliary/server/openssl_altchainsforgery_mitm_proxy.rb - About 4 hrs to fix

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

              def run
                print_status('Attempting to leak the password of the admin user...')
                res = send_request_cgi(
                  'uri' => '/setup.cgi',
                  'method' => 'GET',

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

                def run
                  def check_results(passwords, results, hash_type, method)
                    passwords.each do |password_line|
                      password_line.chomp!
                      next if password_line.blank?
              Severity: Major
              Found in modules/auxiliary/analyze/crack_aix.rb - About 4 hrs to fix

                Method mount_internal_database has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def mount_internal_database
                    # use cve-2023-39265 bypass to mount superset's internal sqlite db
                    res = send_request_cgi(
                      'uri' => normalize_uri(target_uri.path, 'api', 'v1', 'database/'),
                      'method' => 'POST',
                Severity: Major
                Found in modules/exploits/linux/http/apache_superset_cookie_sig_rce.rb - About 4 hrs to fix

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

                    def run
                      return if not check_dependencies
                  
                      name  = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
                      rand1 = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
                  Severity: Major
                  Found in modules/auxiliary/sqli/oracle/lt_mergeworkspace.rb and 1 other location - About 4 hrs to fix
                  modules/auxiliary/sqli/oracle/lt_removeworkspace.rb on lines 32..94

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

                  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 run
                      return if not check_dependencies
                  
                      name  = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
                      rand1 = Rex::Text.rand_text_alpha_upper(rand(10) + 1)
                  Severity: Major
                  Found in modules/auxiliary/sqli/oracle/lt_removeworkspace.rb and 1 other location - About 4 hrs to fix
                  modules/auxiliary/sqli/oracle/lt_mergeworkspace.rb on lines 35..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 162.

                  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 initialize has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def initialize(info={})
                      super(update_info(info,
                        'Name'           => "SerComm Device Remote Code Execution",
                        'Description'    => %q{
                          This module will cause remote code execution on several SerComm devices.
                  Severity: Major
                  Found in modules/exploits/linux/misc/sercomm_exec.rb - About 4 hrs to fix

                    Method arista_eos_config_eater has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def arista_eos_config_eater(thost, tport, config)
                    
                          if framework.db.active
                            credential_data = {
                              address: thost,
                    Severity: Major
                    Found in lib/msf/core/auxiliary/arista.rb - About 4 hrs to fix

                      Method generate has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def generate(*args)
                          @aix = datastore['AIX']
                      
                          #if not assoc_exploit.nil?
                          #    note = find_note(assoc_exploit.rhost, 'AIX')
                      Severity: Major
                      Found in lib/msf/core/payload/aix.rb - About 4 hrs to fix

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

                          def on_request_uri(cli, req)
                        
                            # Create a cached mapping between IP and detected target
                            @targetcache ||= {}
                            @targetcache[cli.peerhost] ||= {}
                        Severity: Major
                        Found in modules/exploits/multi/browser/java_setdifficm_bof.rb and 1 other location - About 4 hrs to fix
                        modules/exploits/multi/browser/java_getsoundbank_bof.rb on lines 99..162

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

                        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_request_uri(cli, req)
                        
                            # Create a cached mapping between IP and detected target
                            @targetcache ||= {}
                            @targetcache[cli.peerhost] ||= {}
                        Severity: Major
                        Found in modules/exploits/multi/browser/java_getsoundbank_bof.rb and 1 other location - About 4 hrs to fix
                        modules/exploits/multi/browser/java_setdifficm_bof.rb on lines 87..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 161.

                        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 run_host has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def run_host(target_host)
                            print_status("Trying #{target_host}")
                            if wordpress_and_online?
                              version = wordpress_version
                              version_string = version || '(no version detected)'
                        Severity: Major
                        Found in modules/auxiliary/scanner/http/wordpress_scanner.rb - About 4 hrs to fix

                          Method on_request_uri has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def on_request_uri(cli, request)
                              #Set target manually or automatically
                              my_target = target
                              if my_target.name == 'Automatic'
                                agent = request.headers['User-Agent']
                          Severity: Major
                          Found in modules/exploits/windows/browser/teechart_pro.rb - About 4 hrs to fix

                            Method on_request_uri has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def on_request_uri(cli, request)
                                #Set target manually or automatically
                                my_target = target
                                if my_target.name == 'Automatic'
                                  agent = request.headers['User-Agent']
                            Severity: Major
                            Found in modules/exploits/windows/browser/intrust_annotatex_add.rb - About 4 hrs to fix

                              Method process_db has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def process_db(db_path, user)
                                  db = SQLite3::Database.new(db_path)
                              
                                  # Extract information for accounts configured in Skype
                                  print_status('Enumerating accounts')
                              Severity: Major
                              Found in modules/post/multi/gather/skype_enum.rb - About 4 hrs to fix

                                Method dcerpc_endpoint_list has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def dcerpc_endpoint_list
                                    res = []
                                
                                    print_status("Connecting to the endpoint mapper service...")
                                    begin
                                Severity: Major
                                Found in lib/msf/core/exploit/remote/dcerpc_epm.rb - About 4 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language