rapid7/metasploit-framework

View on GitHub

Showing 22,004 of 22,004 total issues

Method exec_php has 106 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def exec_php(php_code, is_check = false)

    # remove comments, line breaks and spaces of php_code
    payload_clean = php_code.gsub(/(\s+)|(#.*)/, '')

Severity: Major
Found in modules/exploits/multi/http/x7chat2_php_exec.rb - About 4 hrs to fix

    Method set_win32k_offsets has 106 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def set_win32k_offsets
        @set_win32k_offsets ||= proc do |version|
          case version
          when '6.3.9600.17393'
            {
    Severity: Major
    Found in modules/exploits/windows/local/ms15_078_atmfd_bof.rb - About 4 hrs to fix

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

        def on_request_uri(cli, request)
      
          agent = request.headers['User-Agent']
          my_target = get_target(agent)
      
      
      Severity: Major
      Found in modules/exploits/windows/browser/ms12_037_same_id.rb - About 4 hrs to fix

        Method enum_vm_cust_spec has 106 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def enum_vm_cust_spec
            vpx_customization_specs = get_vpx_customization_spec(shell_vcdb_pass, vcdb_user, vcdb_name)
        
            if vpx_customization_specs.nil?
              print_warning('No vpx_customization_spec entries evident')
        Severity: Major
        Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 4 hrs to fix

          Method cmd_set has 106 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def cmd_set(*args)
              # Figure out if these are global variables
              global = false
              append = false
              clear = false
          Severity: Major
          Found in lib/msf/ui/console/command_dispatcher/core.rb - About 4 hrs to fix

            Method cmd_vulns has 106 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def cmd_vulns(*args)
                return unless active?
            
                default_columns = ['Timestamp', 'Host', 'Name', 'References']
                host_ranges = []
            Severity: Major
            Found in lib/msf/ui/console/command_dispatcher/db.rb - About 4 hrs to fix

              File enum_ie.rb has 343 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              class MetasploitModule < Msf::Post
                include Msf::Post::File
                include Msf::Post::Windows::Registry
              
                def initialize(info = {})
              Severity: Minor
              Found in modules/post/windows/gather/enum_ie.rb - About 4 hrs to fix

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

                      if(datastore['JOHNPWFILE'] and user)
                        case ntlm_ver
                        when NTLM_CONST::NTLM_V1_RESPONSE, NTLM_CONST::NTLM_2_SESSION_RESPONSE
                
                          fd = File.open(datastore['JOHNPWFILE'] + '_netntlm', "ab")
                Severity: Major
                Found in modules/auxiliary/server/capture/http_ntlm.rb and 1 other location - About 4 hrs to fix
                modules/auxiliary/server/capture/mssql.rb on lines 305..345

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

                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

                      if(datastore['JOHNPWFILE'] and user)
                        case ntlm_ver
                        when NTLM_CONST::NTLM_V1_RESPONSE, NTLM_CONST::NTLM_2_SESSION_RESPONSE
                          fd = File.open(datastore['JOHNPWFILE'] + '_netntlm', "ab")
                          fd.puts(
                Severity: Major
                Found in modules/auxiliary/server/capture/mssql.rb and 1 other location - About 4 hrs to fix
                modules/auxiliary/server/capture/http_ntlm.rb on lines 353..395

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

                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

                File manageengine_auth_upload.rb has 342 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                class MetasploitModule < Msf::Exploit::Remote
                  Rank = ExcellentRanking
                
                  include Msf::Exploit::Remote::HttpClient
                
                
                Severity: Minor
                Found in modules/exploits/multi/http/manageengine_auth_upload.rb - About 4 hrs to fix

                  File php_unserialize_zval_cookie.rb has 342 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  class MetasploitModule < Msf::Exploit::Remote
                    Rank = AverageRanking
                  
                    include Msf::Exploit::Remote::Tcp
                    include Msf::Exploit::Remote::HttpClient
                  Severity: Minor
                  Found in modules/exploits/multi/php/php_unserialize_zval_cookie.rb - About 4 hrs to fix

                    Method getprocparam has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def getprocparam(rhost)
                        print_status("[SAP] Connecting to SAP Management Console SOAP Interface on #{rhost}:#{rport}")
                        success = false
                        soapenv = 'http://schemas.xmlsoap.org/soap/envelope/'
                        xsi = 'http://www.w3.org/2001/XMLSchema-instance'
                    Severity: Major
                    Found in modules/auxiliary/scanner/sap/sap_mgmt_con_getprocessparameter.rb - About 4 hrs to fix

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

                        def initialize(info={})
                          super(update_info(info,
                            'Name'           => "ManageEngine Desktop Central / Password Manager LinkViewFetchServlet.dat SQL Injection",
                            'Description'    => %q{
                              This module exploits an unauthenticated blind SQL injection in LinkViewFetchServlet,
                      Severity: Major
                      Found in modules/exploits/multi/http/manage_engine_dc_pmp_sqli.rb - About 4 hrs to fix

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

                          def initialize(info = {})
                            super(
                              update_info(
                                info,
                                'Name' => 'Oracle WebLogic Server Administration Console Handle RCE',
                        Severity: Major
                        Found in modules/exploits/multi/http/weblogic_admin_handle_rce.rb - About 4 hrs to fix

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

                            def initialize(info = {})
                              super(
                                update_info(
                                  info,
                                  'Name' => 'Citrix ADC (NetScaler) Forms SSO Target RCE',
                          Severity: Major
                          Found in modules/exploits/freebsd/http/citrix_formssso_target_rce.rb - About 4 hrs to fix

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

                              def on_request_uri(cli, request)
                            
                                if (request.uri.match(/payload/))
                                  return if ((p = regenerate_payload(cli)) == nil)
                                  data = generate_payload_exe({ :code => p.encoded })
                            Severity: Major
                            Found in modules/exploits/windows/browser/ie_createobject.rb - About 4 hrs to fix

                              Method process_propfind has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def process_propfind(cli, request)
                                  path = request.uri
                                  print_status("PROPFIND #{path}")
                                  body = ''
                              
                              
                              Severity: Major
                              Found in modules/exploits/windows/browser/webdav_dll_hijacker.rb - About 4 hrs to fix

                                Method process_propfind has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def process_propfind(cli, request)
                                    path = request.uri
                                    vprint_status("PROPFIND #{path}")
                                    body = ''
                                
                                
                                Severity: Major
                                Found in modules/exploits/windows/browser/ubisoft_uplay_cmd_exec.rb - About 4 hrs to fix

                                  Method process_propfind has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def process_propfind(cli, request)
                                      path = request.uri
                                      print_status("PROPFIND #{path}")
                                      body = ''
                                  
                                  
                                  Severity: Major
                                  Found in modules/exploits/windows/misc/vmhgfs_webdav_dll_sideload.rb - About 4 hrs to fix

                                    Method exploit has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def exploit
                                        downfile = datastore['DOWNFILE'] || rand_text_alpha(8+rand(8))
                                        uri = '/apply.cgi'
                                        user = datastore['HttpUsername']
                                        pass = datastore['HttpPassword']
                                    Severity: Major
                                    Found in modules/exploits/linux/http/linksys_wrt54gl_apply_exec.rb - About 4 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language