rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'Sitecore Experience Platform (XP) PreAuth Deserialization RCE',
Severity: Major
Found in modules/exploits/windows/http/sitecore_xp_cve_2021_42237.rb - About 3 hrs to fix

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

      def exploit
        return unless check == Exploit::CheckCode::Appears
    
        @encrypted = datastore['ENCRYPTED']
        verification_code = datastore['VERIFICATION_CODE']
    Severity: Major
    Found in modules/exploits/windows/http/dnn_cookie_deserialization_rce.rb - About 3 hrs to fix

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

        def initialize(info = {})
          super(
            update_info(
              info,
              'Name' => 'Microsoft SharePoint Server-Side Include and ViewState RCE',
      Severity: Major
      Found in modules/exploits/windows/http/sharepoint_ssi_viewstate.rb - About 3 hrs to fix

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

          def exploit
            # Encode the shellcode.
            shellcode = Rex::Text.to_unescape(payload.encoded, Rex::Arch.endian(target.arch))
        
            # Make some nops
        Severity: Major
        Found in modules/exploits/windows/fileformat/adobe_u3d_meshdecl.rb - About 3 hrs to fix

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

            def initialize(info = {})
              super(
                update_info(
                  info,
                  'Name' => 'F5 BIG-IP iControl RCE via REST Authentication Bypass',
          Severity: Major
          Found in modules/exploits/linux/http/f5_icontrol_rce.rb - About 3 hrs to fix

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

              def initialize(info = {})
                super(
                  update_info(
                    info,
                    'Name' => 'Cisco ASA-X with FirePOWER Services Authenticated Command Injection',
            Severity: Major
            Found in modules/exploits/linux/http/cisco_asax_sfr_rce.rb - About 3 hrs to fix

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

                def initialize(info = {})
                  super(
                    update_info(
                      info,
                      'Name' => 'Nagios XI Prior to 5.6.6 getprofile.sh Authenticated Remote Command Execution',

                Method master has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def master
                    list_minions_printer
                    gather_minion_data if datastore['GETOS'] || datastore['GETHOSTNAME'] || datastore['GETIP']
                
                    # get sls files
                Severity: Major
                Found in modules/post/multi/gather/saltstack_salt.rb - About 3 hrs to fix

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

                    def run
                      file_path = session.sys.config.getenv('windir') << '\\system32\\win32k.sys'
                      major, minor, _build, _revision, _branch = file_version(file_path)
                      winver = (major.to_s + '.' + minor.to_s).to_f
                  
                  
                  Severity: Major
                  Found in modules/post/windows/gather/bitlocker_fvek.rb - About 3 hrs to fix

                    Method cmd_db_import has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def cmd_db_import(*args)
                        return unless active?
                        openvas_cert = false
                        openvas_dfn = false
                      ::ApplicationRecord.connection_pool.with_connection {
                    Severity: Major
                    Found in lib/msf/ui/console/command_dispatcher/db.rb - About 3 hrs to fix

                      Method cmd_handler has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                                def cmd_handler(*args)
                                  # Display the help banner if no arguments were passed
                                  if args.empty?
                                    cmd_handler_help
                                    return
                      Severity: Major
                      Found in lib/msf/ui/console/command_dispatcher/jobs.rb - About 3 hrs to fix

                        Method authenticate has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def authenticate(service_name, username = 'Fortimanager_Access', password = nil)
                              debug { 'Sending SSH_MSG_USERAUTH_REQUEST (password)' }
                        
                              send_message(userauth_request(
                        =begin
                        Severity: Major
                        Found in lib/msf/core/exploit/remote/ssh/auth_methods/fortinet_backdoor.rb - About 3 hrs to fix

                          Method psexec has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def psexec(command, disconnect=true)
                              remove_socket(self.sock)
                              simple.connect("\\\\#{simple.address}\\IPC$")
                              handle = dcerpc_handle_target('367abb81-9844-35f1-ad32-98f038001003', '2.0', 'ncacn_np', ["\\svcctl"], simple.address)
                              vprint_status("Binding to #{handle} ...")
                          Severity: Major
                          Found in lib/msf/core/exploit/remote/smb/client/psexec.rb - About 3 hrs to fix

                            Method attempt_kerberos_logins has 81 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def attempt_kerberos_logins
                                domain = datastore['DOMAIN'].upcase
                                print_status("Using domain: #{domain} - #{peer}...")
                            
                                cred_collection = build_credential_collection(
                            Severity: Major
                            Found in lib/msf/core/exploit/remote/kerberos/auth_brute.rb - About 3 hrs to fix

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

                                def exploit
                                  if target.name =~ /Windows/
                                    linemax = datastore['PAYLOAD_SPLIT']
                                    vprint_status("#{rhost}:#{rport} - Using custom payload size of #{linemax}") if linemax != 250
                                    print_status("#{rhost}:#{rport} - Sending SOAP SXPG_COMMAND_EXECUTE request")
                              Severity: Major
                              Found in modules/exploits/multi/sap/sap_soap_rfc_sxpg_command_exec.rb and 1 other location - About 3 hrs to fix
                              modules/exploits/multi/sap/sap_soap_rfc_sxpg_call_system_exec.rb on lines 135..154

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

                              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 exploit
                                  if target.name =~ /Windows/
                                    linemax = datastore['PAYLOAD_SPLIT']
                                    vprint_status("#{rhost}:#{rport} - Using custom payload size of #{linemax}") if linemax != 250
                                    print_status("#{rhost}:#{rport} - Sending SOAP SXPG_CALL_SYSTEM request")
                              modules/exploits/multi/sap/sap_soap_rfc_sxpg_command_exec.rb on lines 137..156

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

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

                                def collect_info(user, pass)
                              
                                  vprint_status("#{rhost}:#{rport} - Collecting information from app as #{user.inspect}:#{pass.inspect}...")
                                  begin
                              
                              
                              Severity: Major
                              Found in modules/auxiliary/scanner/http/rfcode_reader_enum.rb - About 3 hrs to fix

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

                                  def initialize(info = {})
                                    super(
                                      update_info(
                                        info,
                                        'Name' => 'Baldr Botnet Panel Shell Upload Exploit',
                                Severity: Major
                                Found in modules/exploits/multi/http/baldr_upload_exec.rb - About 3 hrs to fix

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

                                    def initialize(info = {})
                                      super(
                                        update_info(
                                          info,
                                          'Name' => 'Sonicwall',

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

                                      def initialize(info = {})
                                        super(
                                          update_info(
                                            info,
                                            'Name' => 'Bitbucket Environment Variable RCE',
                                    Severity: Major
                                    Found in modules/exploits/multi/http/bitbucket_env_var_rce.rb - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language