rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

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

  def initialize(info = {})
    super(
      update_info(
        info,
        {
Severity: Major
Found in modules/exploits/windows/local/ms16_075_reflection_juicy.rb - About 2 hrs to fix

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

      def initialize(info = {})
        super(
          update_info(
            info,
            'Name' => 'ManageEngine ADAudit Plus Authenticated File Write RCE',

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

        def initialize(info = {})
          super(
            update_info(
              info,
              'Name' => 'Microsoft Exchange Server DlpUtils AddTenantDlpPolicy RCE',
      Severity: Major
      Found in modules/exploits/windows/http/exchange_ecp_dlp_policy.rb - About 2 hrs to fix

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

          def initialize(info = {})
            super(update_info(info,
              'Name'           => 'MS11-006 Microsoft Windows CreateSizedDIBSECTION Stack Buffer Overflow',
              'Description'    => %q{
                  This module exploits a stack-based buffer overflow in the handling of thumbnails
        Severity: Major
        Found in modules/exploits/windows/fileformat/ms11_006_createsizeddibsection.rb - About 2 hrs to fix

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

            def exploit
          
              pl = generate_payload_exe
              exe_path = "#{datastore['WritableDir']}/.#{rand_text_alphanumeric 5..10}"
              print_status("Writing payload executable to '#{exe_path}'")
          Severity: Major
          Found in modules/exploits/linux/local/ueb_bpserverd_privesc.rb - About 2 hrs to fix

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

              def initialize(info = {})
                super(
                  update_info(
                    info,
                    'Name' => 'F5 BIG-IP TMUI Directory Traversal and File Upload RCE',
            Severity: Major
            Found in modules/exploits/linux/http/f5_bigip_tmui_rce_cve_2020_5902.rb - About 2 hrs to fix

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

                def initialize(info = {})
                  super(
                    update_info(
                      info,
                      'Name' => 'VMware vRealize Log Insight Unauthenticated RCE',
              Severity: Major
              Found in modules/exploits/linux/http/vmware_vrli_rce.rb - About 2 hrs to fix

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

                  def initialize(info = {})
                    super(
                      update_info(
                        info,
                        'Name' => 'TAR Path Traversal in Zimbra (CVE-2022-41352)',
                Severity: Major
                Found in modules/exploits/linux/http/zimbra_cpio_cve_2022_41352.rb - About 2 hrs to fix

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

                    def run
                      # setup creds for making IAM API calls
                      creds = metadata_creds
                      if datastore['AccessKeyId'].empty?
                        unless creds.include?('AccessKeyId')
                  Severity: Major
                  Found in modules/post/multi/escalate/aws_create_iam_user.rb - About 2 hrs to fix

                    Method parse_accounts has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def parse_accounts(data)
                        creds = []
                    
                        doc = begin
                          REXML::Document.new(data).root
                    Severity: Major
                    Found in modules/post/multi/gather/filezilla_client_cred.rb - About 2 hrs to fix

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

                        def run
                          unless is_root?
                            fail_with Failure::NoAccess, 'This module requires root permissions.'
                          end
                      
                      
                      Severity: Major
                      Found in modules/post/android/gather/hashdump.rb - About 2 hrs to fix

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

                          def run
                            # syinfo is only on meterpreter sessions
                            print_status("Running module against #{sysinfo['Computer']}") if !sysinfo.nil?
                        
                            # Set variables
                        Severity: Major
                        Found in modules/post/windows/manage/shellcode_inject.rb - About 2 hrs to fix

                          Method cmd_isotpsend has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def cmd_isotpsend(*args)
                              bus = ''
                              id = ''
                              ret = ''
                              data = ''
                          Severity: Major
                          Found in lib/rex/post/hwbridge/ui/console/command_dispatcher/automotive.rb - About 2 hrs to fix

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

                              def self.create_library(constant_manager, library_path = 'winspool.drv')
                                dll = Library.new(library_path, constant_manager)
                            
                                dll.add_function('AddPrinterA', 'HANDLE',[
                                  ["PCHAR","pName","in"],

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

                                  def self.generate(cmd)
                                    inner = GadgetChains::TextFormattingRunProperties.generate(cmd)
                                    system_data = Assemblies::VERSIONS['4.0.0.0'].fetch('System.Data')
                                    library = Types::RecordValues::BinaryLibrary.new(
                                      library_id: 3,

                                Method cmd_grep has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def cmd_grep(*args)
                                    match_mods = {:insensitive => false}
                                    output_mods = {:count => false, :invert => false}
                                
                                    opts = OptionParser.new do |opts|
                                Severity: Major
                                Found in lib/msf/ui/console/command_dispatcher/core.rb - About 2 hrs to fix

                                  Method import_qualys_scan_xml has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def import_qualys_scan_xml(args={}, &block)
                                      data = args[:data]
                                      wspace = Msf::Util::DBManager.process_opts_workspace(args, framework).name
                                      bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []
                                  
                                  
                                  Severity: Major
                                  Found in lib/msf/core/db_manager/import/qualys/scan.rb - About 2 hrs to fix

                                    Method adaudit_plus_grab_configured_domains has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def adaudit_plus_grab_configured_domains(adapcsrf_cookie, only_get_cookie = false)
                                        vprint_status('Attempting to obtain the list of configured domains...') unless only_get_cookie
                                    
                                        res = send_request_cgi({
                                          'uri' => adaudit_plus_configured_domains_uri,

                                      Method asm_reverse_tcp_dns has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        def asm_reverse_tcp_dns(opts={})
                                      
                                          retry_count  = [opts[:retry_count].to_i, 1].max
                                          encoded_port = "0x%.8x" % [opts[:port].to_i,2].pack("vn").unpack("N").first
                                      
                                      
                                      Severity: Major
                                      Found in lib/msf/core/payload/windows/reverse_tcp_dns.rb - About 2 hrs to fix

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

                                          def on_request_uri(cli, request)
                                        
                                            mytarget = target
                                            if target.name == 'Automatic'
                                              mytarget = auto_target(cli, request)
                                        modules/exploits/windows/browser/ms10_022_ie_vbscript_winhlp32.rb on lines 101..140

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

                                        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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language