rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method exec_cmd has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def exec_cmd(sql, cmd, d)
    boundary = rand_text_alphanumeric(8)
    method = datastore['METHOD'] ? "VbBusObj.VbBusObjCls.GetRecordset" : "AdvancedDataFactory.Query"
    dsn = Rex::Text.to_unicode(d)
    if (d =~ /driver=\{SQL Server\}/)
Severity: Major
Found in modules/exploits/windows/iis/msadc.rb - About 3 hrs to fix

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

      def exploit
        print_status("Access login page")
        res = send_request_cgi({
          'method' => 'GET',
          'uri'    => normalize_uri(uri),
    Severity: Major
    Found in modules/exploits/linux/http/astium_sqli_upload.rb - About 3 hrs to fix

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

        def initialize(info = {})
          super(
            update_info(
              info,
              'Name' => 'Linux BPF Sign Extension Local Privilege Escalation',
      Severity: Major
      Found in modules/exploits/linux/local/bpf_sign_extension_priv_esc.rb - About 3 hrs to fix

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

          def initialize(info = {})
            super(
              update_info(
                info,
                'Name' => 'SolarView Compact unauthenticated remote command execution vulnerability.',
        Severity: Major
        Found in modules/exploits/linux/http/solarview_unauth_rce_cve_2023_23333.rb - About 3 hrs to fix

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

            def initialize(info = {})
              super(
                update_info(
                  info,
                  'Name' => 'Artica Proxy Unauthenticated PHP Deserialization Vulnerability',
          Severity: Major
          Found in modules/exploits/linux/http/artica_proxy_unauth_rce_cve_2024_2054.rb - About 3 hrs to fix

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

              def exploit
                vprint_status('Recovering the staging key...')
                @staging_key ||= get_staging_key
                if @staging_key.nil?
                  fail_with(Failure::Unknown, 'Failed to recover the staging key')
            Severity: Major
            Found in modules/exploits/linux/http/empire_skywalker.rb - About 3 hrs to fix

              Method escalate_or_deescalate_privs has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def escalate_or_deescalate_privs(deescalate: false)
                  # Establish some variables based on if we need to escalate or deescalate privileges
                  if deescalate
                    use_filesystem = @role_to_add != 'ROLE_FILESYSTEM_EDITOR'
                    mode = 'cleanup'
              Severity: Major
              Found in modules/exploits/linux/http/opennms_horizon_authenticated_rce.rb - About 3 hrs to fix

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

                  def initialize(info = {})
                    super(
                      update_info(
                        info,
                        'Name' => 'Redis Lua Sandbox Escape',
                Severity: Major
                Found in modules/exploits/linux/redis/redis_debian_sandbox_escape.rb - About 3 hrs to fix

                  Method default_dispatch_request has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def default_dispatch_request(client, data)
                            return if data.strip.empty? || data.strip.nil?
                  
                            processed_pdu_data = {
                              ip: client.peerhost,
                  Severity: Major
                  Found in lib/rex/proto/ldap/server.rb - About 3 hrs to fix

                    Method build_unirpc_message has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            def build_unirpc_message(
                              version_byte: 0x6c,
                              other_version_byte: 0x01,
                              body_length_override: nil,
                    
                    
                    Severity: Major
                    Found in lib/msf/core/exploit/remote/unirpc.rb - About 3 hrs to fix

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

                              case rtype
                              when 0x21
                                rcnt = bits.slice!(0,1).unpack("C")[0]
                                1.upto(rcnt) do
                                  tname = bits.slice!(0,15).gsub(/\x00.*/, '').strip
                      Severity: Major
                      Found in modules/auxiliary/scanner/discovery/udp_sweep.rb and 1 other location - About 3 hrs to fix
                      modules/auxiliary/scanner/discovery/udp_probe.rb on lines 242..265

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

                      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

                              case rtype
                              when 0x21
                                rcnt = buff.slice!(0,1).unpack("C")[0]
                                1.upto(rcnt) do
                                  tname = buff.slice!(0,15).gsub(/\x00.*/, '').strip
                      Severity: Major
                      Found in modules/auxiliary/scanner/discovery/udp_probe.rb and 1 other location - About 3 hrs to fix
                      modules/auxiliary/scanner/discovery/udp_sweep.rb on lines 199..222

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

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

                        def setup
                          print_status("Setup")
                      
                          @init_js = ::Rex::Exploitation::Js::Detect.os(<<-ENDJS
                      
                      
                      Severity: Major
                      Found in modules/auxiliary/server/browser_autopwn.rb - About 3 hrs to fix

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

                          def initialize(info = {})
                            super(
                              update_info(
                                info,
                                'Name' => 'Jenkins cli Ampersand Replacement Arbitrary File Read',
                        Severity: Major
                        Found in modules/auxiliary/gather/jenkins_cli_ampersand_arbitrary_file_read.rb - About 3 hrs to fix

                          Method getprocesslist has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def getprocesslist(rhost)
                              print_status("#{rhost}:#{rport} [SAP] Connecting to SAP Management Console SOAP Interface ")
                              success = false
                          
                              soapenv = 'http://schemas.xmlsoap.org/soap/envelope/'
                          Severity: Major
                          Found in modules/auxiliary/scanner/sap/sap_mgmt_con_getprocesslist.rb - About 3 hrs to fix

                            Method get_start_profile has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def get_start_profile(rhost)
                                print_status("#{rhost}:#{rport} [SAP] Connecting to SAP Management Console SOAP Interface")
                                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_startprofile.rb - About 3 hrs to fix

                              Method run_host has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def run_host(_ip)
                                  @tries = 0
                              
                                  service_data = {
                                    address: rhost,
                              Severity: Major
                              Found in modules/auxiliary/scanner/http/surgenews_user_creds.rb - About 3 hrs to fix

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

                                  def run
                                
                                    domain = datastore['DOMAIN']
                                    uri = datastore['TARGETURI']
                                    exchange_version = datastore['EXCHANGE_VERSION']

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

                                    def initialize(info = {})
                                      super(
                                        merge_info(
                                          info,
                                          'Name' => 'Process Herpaderping evasion technique',
                                  Severity: Major
                                  Found in modules/evasion/windows/process_herpaderping.rb - About 3 hrs to fix

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

                                      def initialize(info = {})
                                        super(
                                          update_info(
                                            info,
                                            'Name' => 'MaraCMS Arbitrary PHP File Upload',
                                    Severity: Major
                                    Found in modules/exploits/multi/http/maracms_upload_exec.rb - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language