INNER CODE UNIT · Ruby

connection_initialization

Hackplayers/evil-winrm · evil-winrm.rb:335

  def connection_initialization
    # If using Kerberos and host is an IP, ask user if they want to resolve it to FQDN
    if (!$ccache_file.nil? || !$realm.nil?) && is_ip_address?($host)
      puts
      print_message("IP address detected (#{$host}). Kerberos requires FQDN. Do you want to attempt reverse DNS lookup?", TYPE_WARNING, true, $logger)
      print_message('Press "y" to attempt DNS resolution, press any other key to cancel', TYPE_WARNING, true, $logger)
      response = $stdin.getch.downcase
      puts

      if response == 'y'
        print_message("Attempting reverse DNS lookup to get FQDN for Kerberos...", TYPE_INFO, true, $logger)
        fqdn = resolve_ip_to_fqdn($host, $realm)
        if fqdn
          print_message("[+] Resolved IP #{$host} to FQDN: #{fqdn}", TYPE_SUCCESS, true, $logger)
          $host = fqdn
        else
          print_message("Could not resolve IP #{$host} to FQDN.", TYPE_ERROR, true, $logger)
          print_message("When using Kerberos tickets, you must provide an FQDN instead of an IP address.", TYPE_ERROR, true, $logger)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…