FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
mriha
Staff
Staff
Article Id 422317
Description This article describes how to troubleshoot an AP_REQ by decoding it.
Scope FortiOS.
Solution

When Kerberos authentication is configured in an explicit proxy on FortiOS and a client received a Service Ticket from Ticket Granting Server, the client sends the Service ticket (encrypted by Service Secret Key - keytab) along with User Authenticator (encrypted by Service Session Key) to the Service (in this case explicit proxy). The proxy decodes the Service Ticket by a keytab (imported previously from AD, for example via ktpass command). After decryption of the Service Ticket, it is possible to read mostly the following Service Ticket attributes:

  • Username/ID
  • Service Name/ID
  • Timestamp
  • User IP address
  • Lifetime of Service Ticket
  • Service Session Key

Service Session Key is then used to decrypt the User Authenticator message, which mostly contains:

  • Username/ID
  • Timestamp

 

The decryption can be done in Wireshark by following the steps below:

 

  1. Get the keytab from a server, which is imported in FortiGate, and save it to a file
  2. Run a packet capture and capture traffic between the client and FortiGate
  3. Identify the corresponding CONNECT request that does contain the Authentication Service Request (AP_REQ)

     

 

CONNECT www.fortinet.com:443 HTTP/1.1

User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:145.0) Gecko/20100101 Firefox/145.0

Proxy-Connection: keep-alive

Connection: keep-alive

Host: www.fortinet.com:443

Proxy-Authorization: Negotiate YIIHMQYGKwYBBQUCoIIHJTCCByGgMDAuBgkqhkiC9xIBAgIGCSqGSIb3EgECAgYKKwYBBAGCN

wICHgYKKwYBBAGCNwICCqKCBusEg

gbnYIIG4wYJKoZIhvcSAQICAQBuggbSMIIGzqADAgEFoQMCAQ6iBwMFACAAAACjggUKYYIFBjCCBQKgAwIBBaEOGwxJTlRFUk5BTC5MQ

UKiIzAhoAMCAQKhGjAYGwRIVFRQGxBmZ3QuaW50ZXJuYWwubGFio4IExDCCBMCgAwIBF6EDAgEIooIEsgSCBK62wA5g9ECZAFy7WBTKG

ZdqwjxPzb2IKOVaHrNXT34/xur0husDYhyePFmrP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-> Protocols -> KRB5; enable 'Try to decrypt Kerberos blobs' and select the keytab file.

If applied correctly, the Authentication Service Request is decoded and can be further inspected.

 

krb.png

Contributors