rapid7/metasploit-framework

View on GitHub

Showing 18 of 21,757 total issues

Consider simplifying this complex logical expression.
Open

      if hash.nil? || hash.empty? ||
         (hash.start_with?(/{crypt}/i) && hash.length < 10) ||
         hash.start_with?('*****') ||
         hash.start_with?(/yyyyyy/i) ||
         hash == '*' ||
Severity: Critical
Found in modules/auxiliary/gather/ldap_hashdump.rb - About 4 hrs to fix

    Consider simplifying this complex logical expression.
    Open

          if (
               (module_full_name_ref && ref_match.match(/#{module_full_name_ref}/)) ||
               (edb_ref               && ref_match.match(/EXPLOIT\-DB:#{edb_ref}$/)) ||
               (osvdb_ref             && ref_match.match(/OSVDB:#{osvdb_ref}$/)) ||
               (bid_ref               && ref_match.match(/BID:#{bid_ref}$/)) ||
    Severity: Critical
    Found in tools/modules/cve_xref.rb - About 3 hrs to fix

      Consider simplifying this complex logical expression.
      Open

            if (check[j] == '0') || (check[j] == '1') || (check[j] == '2') || (check[j] == '3') || (check[j] == '4') || (check[j] == '5') || (check[j] == '6') || (check[j] == '7') || (check[j] == '8') || (check[j] == '9') || (check[j] == ',')
              if (check[j] == ',') && (check[j + 1] == ',')
                print_error('DATA_REGISTERS cannot contain two consecutive commas')
                return
              end
      Severity: Critical
      Found in modules/auxiliary/scanner/scada/modbusclient.rb - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

            if version < Rex::Version.new('7.0') ||
               (version >= Rex::Version.new('7.0') && version < Rex::Version.new('7.0.121307')) ||
               (version >= Rex::Version.new('7.1') && version < Rex::Version.new('7.1.150')) ||
               (version >= Rex::Version.new('7.2') && version < Rex::Version.new('7.2.103')) ||
               (version >= Rex::Version.new('8.0') && version < Rex::Version.new('8.0.320')) ||
        Severity: Critical
        Found in modules/exploits/unix/http/quest_kace_systems_management_rce.rb - About 2 hrs to fix

          Consider simplifying this complex logical expression.
          Open

                  if !((@user && !@user.empty?) && (@host && !@host.empty?) && (@port && !@port.empty? && (@port.to_i > 0)) && (@pass && !@pass.empty?))
                    print_status('You need to connect to a server first.')
                    ncusage
                    return
                  end
          Severity: Critical
          Found in plugins/nessus.rb - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                    if ((@user && !@user.empty?) && (@host && !@host.empty?) && (@port && !@port.empty? && (@port.to_i > 0)) && (@pass && !@pass.empty?))
                      config = Hash.new
                      config = { group.to_s => { 'username' => @user, 'password' => @pass, 'server' => @host, 'port' => @port } }
                      File.open(nessus_yaml.to_s, 'w+') do |f|
                        f.puts YAML.dump(config)
            Severity: Critical
            Found in plugins/nessus.rb - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                      if !((@user && !@user.empty?) && (@host && !@host.empty?) && (@port && !@port.empty? && (@port.to_i > 0)) && (@pass && !@pass.empty?))
                        ncusage
                        return
                      end
              Severity: Critical
              Found in plugins/nessus.rb - About 1 hr to fix

                Consider simplifying this complex logical expression.
                Open

                        if !((@user && !@user.empty?) && (@host && !@host.empty?) && (@port && !@port.empty? && (@port.to_i > 0)) && (@pass && !@pass.empty?))
                          nexpose_usage
                          return
                        end
                Severity: Critical
                Found in plugins/nexpose.rb - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if ((@user && !@user.empty?) && (@host && !@host.empty?) && (@port && !@port.empty? && (@port.to_i > 0)) && (@pass && !@pass.empty?))
                            config = { group.to_s => { 'username' => @user, 'password' => @pass, 'server' => @host, 'port' => @port, 'trust_cert' => @trust_cert } }
                            ::File.open(Nexpose_yaml.to_s, 'wb') { |f| f.puts YAML.dump(config) }
                            print_good("#{Nexpose_yaml} created.")
                          else
                  Severity: Critical
                  Found in plugins/nexpose.rb - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                          if (str.empty? or str =~ /Null/ or str =~ /^noSuch/)
                            output_data["System date"] = '-'
                          else
                    
                            # RFC 2579 - Textual Conventions for SMIv2
                    Severity: Critical
                    Found in modules/auxiliary/scanner/snmp/snmp_enum.rb - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                          if (version[0] <= 9 && version[0] > 4 && version[2] < 9031 && version[3] == 'sd') ||
                          (version[0] <= 6 && version[2] < 99999 && version[3] == 'ae') ||
                          (version[3] == 'sc' && version[2] < 99999)
                            return Exploit::CheckCode::Appears
                          end
                      Severity: Critical
                      Found in modules/exploits/multi/http/manageengine_auth_upload.rb - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                  if (error[0] == error[1]) and (error[0].empty? or (error[0].unpack('C')[0] & 7) == 0) and # fd_nextsize
                                     (error[2] == error[3]) and (error[2].empty? or (error[2].unpack('C')[0] & 7) == 0) and # fd
                                     (error[4] =~ /\A503 send[^e].?\z/mn) and ((error[4].unpack('C*')[8] & 15) == PREV_INUSE) and # size
                                     (error[5] == "177") # the last \x7F of our BAD1 command, encoded as \\177 by string_printing()
                                    leaked_arch = ARCH_X64
                        Severity: Critical
                        Found in modules/exploits/linux/smtp/exim_gethostbyname_bof.rb - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if (a[i-1]==ooLen && a[i]==0 && a[i+1]==0 // oo[0]==null && oo[1]==null
                                           && a[i+2]!=0 && a[i+3]!=0 && a[i+4]!=0   // oo[2,3,4] != null    
                                           && a[i+5]==0 && a[i+6]==0)               // oo[5,6] == null
                                          {
                                              // read pointer from oo[4]
                          Severity: Critical
                          Found in external/source/exploits/CVE-2013-2465/Exploit.java - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                if release_short >= Rex::Version.new('5.13.0') && release_long < Rex::Version.new('5.13.0-37.42') || # Ubuntu 21.10
                                   release_short >= Rex::Version.new('5.4.0') && release_long < Rex::Version.new('5.4.0-105.119') || # Ubuntu 20.04 LTS
                                   release_short >= Rex::Version.new('4.15.0') && release_long < Rex::Version.new('4.15.0-173.182') || # Ubuntu 18.04 LTS
                                   release_short >= Rex::Version.new('4.4.0') && release_long < Rex::Version.new('4.4.0-222.255') # Ubuntu 16.04 ESM
                                  return CheckCode::Vulnerable("IF host OS is Ubuntu, kernel version #{release} is vulnerable")
                            Severity: Critical
                            Found in modules/exploits/linux/local/docker_cgroup_escape.rb - About 1 hr to fix

                              Consider simplifying this complex logical expression.
                              Open

                                  if (version >= Rex::Version.new('5.0.0') && version < Rex::Version.new('5.1.0')) ||
                                     (version >= Rex::Version.new('6.0.0') && version < Rex::Version.new('6.1.0')) ||
                                     (version >= Rex::Version.new('6.7.0') && version < Rex::Version.new('6.8.0')) ||
                                     (version >= Rex::Version.new('7.0.0') && version < Rex::Version.new('7.0.2'))
                                    return CheckCode::Appears
                              Severity: Critical
                              Found in modules/exploits/linux/http/vinchin_backup_recovery_cmd_inject.rb - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                      if file_contents.nil? || file_contents.empty?
                                        print_warning('Configuration file content is empty')
                                        return
                                      else
                                        config = Rex::Parser::Ini.from_s(file_contents)
                                Severity: Critical
                                Found in modules/post/windows/gather/credentials/moba_xterm.rb - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                      if !(modified || accessed || creation || emodified ||
                                           blank_file_mace || blank_directory_mace || get_file_mace) || help
                                        print_line("\nUsage: timestomp <file(s)> OPTIONS\n" +
                                          @@timestomp_opts.usage)
                                        return nil
                                  Severity: Critical
                                  Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/priv/timestomp.rb - About 1 hr to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                            if s[:last] == :ntlm_type2
                                              lmlength =     ntlmpayload[12, 2].unpack("v")[0]
                                              lmoffset =     ntlmpayload[16, 2].unpack("v")[0]
                                              ntlmlength =     ntlmpayload[20, 2].unpack("v")[0]
                                              ntlmoffset =     ntlmpayload[24, 2].unpack("v")[0]
                                    Severity: Critical
                                    Found in data/exploits/psnuffle/smb.rb - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language