rapid7/metasploit-framework

View on GitHub

Showing 7,361 of 22,177 total issues

Method check has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def check
    def mounts_exist?()
      vprint_status('Checking if mount points exist')
      if target.name == 'CVE-2015-1328'
        if not directory?('/tmp/ns_sploit')
Severity: Major
Found in modules/exploits/linux/local/overlayfs_priv_esc.rb - About 3 hrs to fix

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

      def initialize(info = {})
        super(
          update_info(
            info,
            'Name' => 'GL.iNet Unauthenticated Remote Command Execution via the logread module.',
    Severity: Major
    Found in modules/exploits/linux/http/glinet_unauth_rce_cve_2023_50445.rb - About 3 hrs to fix

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

        def exploit
          # This is an important check...
          fail_with(Failure::BadConfig, 'SRVHOST can\'t be localhost') if datastore['SRVHOST'] =~ /(127|0)\.0\.0\.(0|1)|localhost/
      
          # Step 1 generate malicious TAR archive
      Severity: Major
      Found in modules/exploits/linux/http/vmware_vrli_rce.rb - About 3 hrs to fix

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

          def initialize(info = {})
            super(
              update_info(
                info,
                'Name' => 'Cisco IOX XE Unauthenticated RCE Chain',
        Severity: Major
        Found in modules/exploits/linux/misc/cisco_ios_xe_rce.rb - About 3 hrs to fix

          Method send_tcp has 84 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def send_tcp(packet, packet_data, nameservers, prox = @config[:proxies])
                ans = nil
                length = [packet_data.size].pack("n")
                nameservers.each do |ns, socket_options|
                  socket = nil
          Severity: Major
          Found in lib/rex/proto/dns/resolver.rb - About 3 hrs to fix

            Method win32_rwx_exec has 84 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def self.win32_rwx_exec(code)
                stub_block = Rex::Payloads::Shuffle.from_graphml_file(
                  File.join(Msf::Config.install_root, 'data', 'shellcode', 'block_api.x86.graphml'),
                  arch: ARCH_X86,
                  name: 'api_call'
            Severity: Major
            Found in lib/msf/util/exe.rb - About 3 hrs to fix

              Method report_auth_info has 84 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def report_auth_info(opts={})
                  return if not active
                  raise ArgumentError.new("Missing required option :host") if opts[:host].nil?
                  raise ArgumentError.new("Missing required option :port") if (opts[:port].nil? and opts[:service].nil?)
              
              
              Severity: Major
              Found in lib/msf/core/db_manager/cred.rb - About 3 hrs to fix

                Method asm_block_recv_rc4 has 84 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/bind_tcp_rc4.rb - About 3 hrs to fix

                  Method jtr_format_to_hashcat_format has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          def jtr_format_to_hashcat_format(format)
                            case format
                            # nix
                            when 'md5crypt'
                              '500'
                  Severity: Major
                  Found in lib/metasploit/framework/password_crackers/cracker.rb - About 3 hrs to fix

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

                      def login_it360
                        # Do we already have a valid cookie? If yes, just return that.
                        unless datastore['IAMAGENTTICKET'].nil?
                          cookie_name = get_it360_cookie_name
                          cookie = 'IAMAGENTTICKET' + cookie_name + '=' + datastore['IAMAGENTTICKET'] + ';'
                    Severity: Major
                    Found in modules/auxiliary/admin/http/manageengine_dir_listing.rb and 1 other location - About 3 hrs to fix
                    modules/auxiliary/admin/http/manageengine_file_download.rb on lines 136..174

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

                    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

                        stream_1 = 'stream' << eol
                        stream_1 << '0.000 0.000 0.000 rg 0.000 0.000 0.000 RG q 265.000 0 0 229.000 41.000 522.000 cm /I0 Do Q' << eol
                        stream_1 << 'endstream' << eol
                        add_object(6, "<</Length 91>>#{stream_1}")
                        stream = '<<' << eol
                    modules/exploits/windows/fileformat/shaper_pdf_bof.rb on lines 97..124

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

                    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

                        stream_1 = "stream" << eol
                        stream_1 << "0.000 0.000 0.000 rg 0.000 0.000 0.000 RG q 265.000 0 0 229.000 41.000 522.000 cm /I0 Do Q" << eol
                        stream_1 << "endstream" << eol
                        add_object(6, "<</Length 91>>#{stream_1}")
                        stream = "<<" << eol
                    Severity: Major
                    Found in modules/exploits/windows/fileformat/shaper_pdf_bof.rb and 1 other location - About 3 hrs to fix
                    modules/exploits/windows/fileformat/documalis_pdf_editor_and_scanner.rb on lines 107..134

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

                    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

                      def login_it360
                        # Do we already have a valid cookie? If yes, just return that.
                        unless datastore['IAMAGENTTICKET'].nil?
                          cookie_name = get_it360_cookie_name
                          cookie = 'IAMAGENTTICKET' + cookie_name + '=' + datastore['IAMAGENTTICKET'] + ';'
                    Severity: Major
                    Found in modules/auxiliary/admin/http/manageengine_file_download.rb and 1 other location - About 3 hrs to fix
                    modules/auxiliary/admin/http/manageengine_dir_listing.rb on lines 138..176

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

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

                          def cmd_token_hunt_user(*args)
                            opts = Rex::Parser::Arguments.new(
                              '-h' => [ false, 'This help menu'],
                              '-f' => [ true, 'A file containing a list of users to search for (one per line)']
                            )
                    Severity: Major
                    Found in plugins/token_hunter.rb - About 3 hrs to fix

                      Method js has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def js
                          target_files = parse_target_files
                          js_target_files = target_files * ','
                      
                          %Q|
                      Severity: Major
                      Found in modules/auxiliary/gather/ms14_052_xmldom.rb - About 3 hrs to fix

                        Method osexecute has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def osexecute(rhost, cmd_to_run)
                        
                            print_status("[SAP] Connecting to SAP Management Console SOAP Interface on #{rhost}:#{rport}")
                            success = false
                        
                        
                        Severity: Major
                        Found in modules/auxiliary/admin/sap/sap_mgmt_con_osexec.rb - About 3 hrs to fix

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

                            def run_host(target_host)
                              begin
                                iplist = Rex::Socket::RangeWalker.new(datastore['RANGE'])
                                portlist = Rex::Socket.portspec_crack(datastore['PORTS'])
                                dead = false
                          Severity: Major
                          Found in modules/auxiliary/scanner/http/squid_pivot_scanning.rb - About 3 hrs to fix

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

                              def run_host(ip)
                                checkcode = Exploit::CheckCode::Unknown
                                details = {}
                            
                                begin
                            Severity: Major
                            Found in modules/auxiliary/scanner/smb/smb_ms17_010.rb - About 3 hrs to fix

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

                                def initialize(_info = {})
                                  super(
                                    'Name' => 'Log4Shell HTTP Header Injection',
                                    'Description' => %q{
                                      Versions of Apache Log4j2 impacted by CVE-2021-44228 which allow JNDI features used in configuration,
                              Severity: Major
                              Found in modules/exploits/multi/http/log4shell_header_injection.rb - About 3 hrs to fix

                                Method check has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def check
                                    sysinfo_value = sysinfo['OS']
                                
                                    if sysinfo_value !~ /windows/i
                                      # Non-Windows systems are definitely not affected.
                                Severity: Major
                                Found in modules/exploits/windows/local/cve_2022_26904_superprofile.rb - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language