rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'Zyxel chained RCE using LFI and weak password derivation algorithm',
Severity: Major
Found in modules/exploits/linux/http/zyxel_lfi_unauth_ssh_rce.rb - About 3 hrs to fix

    Method load_module has 96 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def load_module(parent_path, type, module_reference_name, options = {})
        options.assert_valid_keys(:count_by_type, :force, :recalculate_by_type, :reload, :cached_metadata)
        force = options[:force] || false
        reload = options[:reload] || false
    
    
    Severity: Major
    Found in lib/msf/core/modules/loader/base.rb - About 3 hrs to fix

      Method exec_shellcode_source has 96 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def exec_shellcode_source
          %Q|
            var execShellcode = function(shellcode, bytes) {
              Components.utils.import("resource://gre/modules/ctypes.jsm");
      
      
      Severity: Major
      Found in lib/msf/core/exploit/remote/firefox_privilege_escalation.rb - About 3 hrs to fix

        Method build_pac has 96 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    def build_pac(opts = {})
                      user_name = opts[:client_name] || ''
                      user_id = opts[:user_id] || Rex::Proto::Kerberos::Pac::DEFAULT_ADMIN_RID
                      primary_group_id = opts[:group_id] || Rex::Proto::Kerberos::Pac::DOMAIN_USERS
                      group_ids = opts[:group_ids] || [Rex::Proto::Kerberos::Pac::DOMAIN_USERS]
        Severity: Major
        Found in lib/msf/core/exploit/remote/kerberos/client/pac.rb - About 3 hrs to fix

          Method asm_block_recv_rc4 has 96 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def asm_block_recv_rc4(opts={})
              xorkey = Rex::Text.to_dword(opts[:xorkey]).chomp
              reliable     = opts[:reliable]
              asm = %Q^
                recv:
          Severity: Major
          Found in lib/msf/core/payload/windows/reverse_tcp_rc4.rb - About 3 hrs to fix

            Method each_unfiltered_password_first has 96 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def each_unfiltered_password_first
                  if user_file.present?
                    user_fd = File.open(user_file, 'r:binary')
                  end
            
            
            Severity: Major
            Found in lib/metasploit/framework/credential_collection.rb - About 3 hrs to fix

              Method each_unfiltered_username_first has 96 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def each_unfiltered_username_first
                    if pass_file.present?
                      pass_fd = File.open(pass_file, 'r:binary')
                    end
              
              
              Severity: Major
              Found in lib/metasploit/framework/credential_collection.rb - About 3 hrs to fix

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

                module Payload::Windows::ReflectiveDllInject_x64
                
                  include Msf::ReflectiveDLLLoader
                  include Msf::Payload::Windows
                
                
                lib/msf/core/payload/windows/reflective_dll_inject.rb on lines 13..92

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

                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 initialize(info={})
                    super(update_info(info,
                      'Name'           => "IBM Lotus QuickR qp2 ActiveX Buffer Overflow",
                      'Description'    => %q{
                          This module exploits a buffer overflow vulnerability on the UploadControl
                Severity: Major
                Found in modules/exploits/windows/browser/quickr_qp2_bof.rb and 1 other location - About 3 hrs to fix
                modules/exploits/windows/browser/inotes_dwa85w_bof.rb on lines 25..84

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

                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 initialize(info={})
                    super(update_info(info,
                      'Name'           => "IBM Lotus iNotes dwa85W ActiveX Buffer Overflow",
                      'Description'    => %q{
                          This module exploits a buffer overflow vulnerability on the UploadControl
                Severity: Major
                Found in modules/exploits/windows/browser/inotes_dwa85w_bof.rb and 1 other location - About 3 hrs to fix
                modules/exploits/windows/browser/quickr_qp2_bof.rb on lines 25..82

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

                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

                module Payload::Windows::ReflectiveDllInject
                
                  include Msf::ReflectiveDLLLoader
                  include Msf::Payload::Windows
                
                
                Severity: Major
                Found in lib/msf/core/payload/windows/reflective_dll_inject.rb and 1 other location - About 3 hrs to fix
                lib/msf/core/payload/windows/x64/reflective_dll_inject_x64.rb on lines 13..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 132.

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

                  def handle_intermediate_stage(conn, payload)
                    stager_file = File.join(Msf::Config.data_directory, 'meterpreter', 'aarch64_osx_stage')
                    data = File.binread(stager_file)
                    macho = Msf::Payload::MachO.new(data)
                    output_data = macho.flatten
                Severity: Major
                Found in modules/payloads/stages/osx/aarch64/meterpreter.rb - About 3 hrs to fix

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

                    def initialize(info = {})
                      super(
                        update_info(
                          info,
                          'Name' => 'MyBB Admin Control Code Injection RCE',
                  Severity: Major
                  Found in modules/exploits/multi/http/mybb_rce_cve_2022_24734.rb - About 3 hrs to fix

                    Method make_pdf has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def make_pdf(swf, js)
                    
                        swf_name = rand_text_alpha(8 + rand(8)) + ".swf"
                    
                        xref = []
                    Severity: Major
                    Found in modules/exploits/windows/browser/adobe_flashplayer_newfunction.rb - About 3 hrs to fix

                      Method make_pdf has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def make_pdf(swf, js)
                      
                          swf_name = rand_text_alpha(8 + rand(8)) + ".swf"
                      
                          xref = []
                      Severity: Major
                      Found in modules/exploits/windows/fileformat/adobe_flashplayer_newfunction.rb - About 3 hrs to fix

                        Method make_js has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def make_js
                        
                            # CreateFileMappingA + MapViewOfFile + memcpy rop chain
                            rop_9 = Rex::Text.to_unescape(generate_rop_payload('reader', '', { 'target' => '9' }))
                            rop_10 = Rex::Text.to_unescape(generate_rop_payload('reader', '', { 'target' => '10' }))
                        Severity: Major
                        Found in modules/exploits/windows/fileformat/adobe_toolbutton.rb - About 3 hrs to fix

                          Method make_pdf has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def make_pdf(swf, js)
                          
                              swf_name = rand_text_alpha(8 + rand(8)) + ".swf"
                          
                              xref = []
                          Severity: Major
                          Found in modules/exploits/windows/fileformat/adobe_flashplayer_button.rb - About 3 hrs to fix

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

                              def run
                                unless (flow_file && properties_file) || identity_file
                                  fail_with(Failure::NotFound, 'Unable to find login-identity-providers.xml, nifi.properties and/or flow.json.gz files')
                                end
                            
                            
                            Severity: Major
                            Found in modules/post/linux/gather/apache_nifi_credentials.rb - About 3 hrs to fix

                              Method process_ntlm_hash has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      def process_ntlm_hash(arg = {})
                                        ntlm_ver = arg[:ntlm_ver]
                                        lm_hash = arg[:lm_hash]
                                        nt_hash = arg[:nt_hash]
                                        unless ntlm_ver == NTLM_CONST::NTLM_V1_RESPONSE || ntlm_ver == NTLM_CONST::NTLM_2_SESSION_RESPONSE
                              Severity: Major
                              Found in lib/rex/proto/ldap/auth.rb - About 3 hrs to fix

                                Method cmd_generate has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                          def cmd_generate(*args)
                                            # Parse the arguments
                                            encoder_name = nil
                                            sled_size = nil
                                            pad_nops = nil
                                Severity: Major
                                Found in lib/msf/ui/console/command_dispatcher/payload.rb - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language