============ analyzer.log ============ Dynamic protocol detection (DPD) is a method by which Zeek identifies protocols on ports beyond those used as standard services. Rather than selecting which application protocol analyzer to use based on a connection’s server port, Zeek’s dynamic analyzer framework associates an analyzer tree with every connection. This analyzer tree permits Zeek to perform protocol analysis independently of port numbers. By using a set of signatures which match typical protocol dialogues, Zeek is able to look at payload to find the correct analyzers. When such a signature matches, it turns on the corresponding analyzer to confirm it. Zeek can turn off analyzers when it becomes obvious that they are parsing the wrong protocol. This allows Zeek to use “loose” protocol signatures, and, if in doubt, try multiple analyzers in parallel. Zeek’s :file:`analyzer.log` reports problems with the DPD mechanism. This section provides examples of this reporting in action. For full details on each field in the :file:`analyzer.log` file, please refer to :zeek:see:`Analyzer::Logging::Info`. .. note:: This log underwent a revamp in Zeek 8.0 and resembles what dpd.log provided in older versions of Zeek. Please review Zeek 8.0's release notes for more details on the changes in this log. One Specific Example ==================== The following is an example of traffic that generated a :file:`analyzer.log` entry. :program:`tcpdump` and :program:`tshark` ---------------------------------------- :program:`tcpdump` reports the traffic as follows:: 02:44:24.274569 IP 192.168.4.142.50540 > 184.168.176.1.443: Flags [S], seq 163388510, win 64240, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0 02:44:24.339007 IP 184.168.176.1.443 > 192.168.4.142.50540: Flags [S.], seq 3902980842, ack 163388511, win 14600, options [mss 1460,nop,wscale 8], length 0 02:44:24.340486 IP 192.168.4.142.50540 > 184.168.176.1.443: Flags [.], ack 1, win 513, length 0 02:44:24.340668 IP 192.168.4.142.50540 > 184.168.176.1.443: Flags [P.], seq 1:518, ack 1, win 513, length 517 02:44:24.407539 IP 184.168.176.1.443 > 192.168.4.142.50540: Flags [.], ack 518, win 62, length 0 02:44:24.410681 IP 184.168.176.1.443 > 192.168.4.142.50540: Flags [P.], seq 1:468, ack 518, win 62, length 467 02:44:24.411048 IP 184.168.176.1.443 > 192.168.4.142.50540: Flags [F.], seq 468, ack 518, win 62, length 0 02:44:24.412575 IP 192.168.4.142.50540 > 184.168.176.1.443: Flags [.], ack 469, win 511, length 0 02:44:24.412857 IP 192.168.4.142.50540 > 184.168.176.1.443: Flags [P.], seq 518:525, ack 469, win 511, length 7 02:44:24.412860 IP 192.168.4.142.50540 > 184.168.176.1.443: Flags [F.], seq 525, ack 469, win 511, length 0 02:44:24.477936 IP 184.168.176.1.443 > 192.168.4.142.50540: Flags [.], ack 526, win 62, length 0 On the face of it, there does not appear to be anything unusual about this traffic. It appears to be a brief session to TCP port 443. :program:`tshark` reports the traffic as follows: .. literal-emph:: 2 192.168.4.142 50540 184.168.176.1 443 TCP 66 50540 → 443 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 WS=256 SACK_PERM=1 4 184.168.176.1 443 192.168.4.142 50540 TCP 62 443 → 50540 [SYN, ACK] Seq=0 Ack=1 Win=14600 Len=0 MSS=1460 WS=256 6 192.168.4.142 50540 184.168.176.1 443 TCP 60 50540 → 443 [ACK] Seq=1 Ack=1 Win=131328 Len=0 7 192.168.4.142 50540 184.168.176.1 443 TLSv1 571 Client Hello 9 184.168.176.1 443 192.168.4.142 50540 TCP 60 443 → 50540 [ACK] Seq=1 Ack=518 Win=15872 Len=0 **10 184.168.176.1 443 192.168.4.142 50540 HTTP 521 HTTP/1.1 400 Bad Request (text/html)** 11 184.168.176.1 443 192.168.4.142 50540 TCP 60 443 → 50540 [FIN, ACK] Seq=468 Ack=518 Win=15872 Len=0 13 192.168.4.142 50540 184.168.176.1 443 TCP 60 50540 → 443 [ACK] Seq=518 Ack=469 Win=130816 Len=0 14 192.168.4.142 50540 184.168.176.1 443 TCP 61 50540 → 443 [PSH, ACK] Seq=518 Ack=469 Win=130816 Len=7 15 192.168.4.142 50540 184.168.176.1 443 TCP 60 50540 → 443 [FIN, ACK] Seq=525 Ack=469 Win=130816 Len=0 24 184.168.176.1 443 192.168.4.142 50540 TCP 60 443 → 50540 [ACK] Seq=469 Ack=526 Win=15872 Len=0 :program:`tshark` reveals something weird is happening here. Frame 10 shows that :program:`tshark` decoded a plain-text HTTP message from port 443 TCP. This should not be happening. A second look shows that the TLS session did not appear to complete, as there is no response to the TLS client hello message. Here is frame 10 in detail. I passed :program:`tshark` the ``-x`` switch to provide a hex and ASCII output at the end. .. literal-emph:: Frame 10: 521 bytes on wire (4168 bits), 521 bytes captured (4168 bits) Encapsulation type: Ethernet (1) Arrival Time: Dec 10, 2020 02:44:24.410681000 UTC [Time shift for this packet: 0.000000000 seconds] Epoch Time: 1607568264.410681000 seconds [Time delta from previous captured frame: 0.003142000 seconds] [Time delta from previous displayed frame: 0.003142000 seconds] [Time since reference or first frame: 0.136113000 seconds] Frame Number: 10 Frame Length: 521 bytes (4168 bits) Capture Length: 521 bytes (4168 bits) [Frame is marked: False] [Frame is ignored: False] [Protocols in frame: eth:ethertype:ip:tcp:http:data-text-lines] Ethernet II, Src: fc:ec:da:49:e0:10, Dst: 60:f2:62:3c:9c:68 Destination: 60:f2:62:3c:9c:68 Address: 60:f2:62:3c:9c:68 .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Source: fc:ec:da:49:e0:10 Address: fc:ec:da:49:e0:10 .... ..0. .... .... .... .... = LG bit: Globally unique address (factory default) .... ...0 .... .... .... .... = IG bit: Individual address (unicast) Type: IPv4 (0x0800) Internet Protocol Version 4, Src: 184.168.176.1, Dst: 192.168.4.142 0100 .... = Version: 4 .... 0101 = Header Length: 20 bytes (5) Differentiated Services Field: 0x00 (DSCP: CS0, ECN: Not-ECT) 0000 00.. = Differentiated Services Codepoint: Default (0) .... ..00 = Explicit Congestion Notification: Not ECN-Capable Transport (0) Total Length: 507 Identification: 0xcc4e (52302) Flags: 0x4000, Don't fragment 0... .... .... .... = Reserved bit: Not set .1.. .... .... .... = Don't fragment: Set ..0. .... .... .... = More fragments: Not set ...0 0000 0000 0000 = Fragment offset: 0 Time to live: 55 Protocol: TCP (6) Header checksum: 0x47ce [validation disabled] [Header checksum status: Unverified] Source: 184.168.176.1 Destination: 192.168.4.142 Transmission Control Protocol, Src Port: 443, Dst Port: 50540, Seq: 1, Ack: 518, Len: 467 Source Port: 443 Destination Port: 50540 [Stream index: 1] [TCP Segment Len: 467] Sequence number: 1 (relative sequence number) [Next sequence number: 468 (relative sequence number)] Acknowledgment number: 518 (relative ack number) 0101 .... = Header Length: 20 bytes (5) Flags: 0x018 (PSH, ACK) 000. .... .... = Reserved: Not set ...0 .... .... = Nonce: Not set .... 0... .... = Congestion Window Reduced (CWR): Not set .... .0.. .... = ECN-Echo: Not set .... ..0. .... = Urgent: Not set .... ...1 .... = Acknowledgment: Set .... .... 1... = Push: Set .... .... .0.. = Reset: Not set .... .... ..0. = Syn: Not set .... .... ...0 = Fin: Not set [TCP Flags: ·······AP···] Window size value: 62 [Calculated window size: 15872] [Window size scaling factor: 256] Checksum: 0xde95 [unverified] [Checksum Status: Unverified] Urgent pointer: 0 [SEQ/ACK analysis] [iRTT: 0.065917000 seconds] [Bytes in flight: 467] [Bytes sent since last PSH flag: 467] [Timestamps] [Time since first frame in this TCP stream: 0.136112000 seconds] [Time since previous frame in this TCP stream: 0.003142000 seconds] TCP payload (467 bytes) **Hypertext Transfer Protocol** **[Expert Info (Warning/Security): Unencrypted HTTP protocol detected over encrypted port, could indicate a dangerous misconfiguration.]** **[Unencrypted HTTP protocol detected over encrypted port, could indicate a dangerous misconfiguration.]** **[Severity level: Warning]** **[Group: Security]** **HTTP/1.1 400 Bad Request\r\n** [Expert Info (Chat/Sequence): HTTP/1.1 400 Bad Request\r\n] [HTTP/1.1 400 Bad Request\r\n] [Severity level: Chat] [Group: Sequence] Response Version: HTTP/1.1 Status Code: 400 [Status Code Description: Bad Request] Response Phrase: Bad Request Date: Thu, 10 Dec 2020 02:44:24 GMT\r\n Server: Apache\r\n Content-Length: 301\r\n [Content length: 301] Connection: close\r\n Content-Type: text/html; charset=iso-8859-1\r\n \r\n [HTTP response 1/1] File Data: 301 bytes Line-based text data: text/html (10 lines) \n
\nYour browser sent a request that this server could not understand.
\n
Your browser se
0170 6e 74 20 61 20 72 65 71 75 65 73 74 20 74 68 61 nt a request tha
0180 74 20 74 68 69 73 20 73 65 72 76 65 72 20 63 6f t this server co
0190 75 6c 64 20 6e 6f 74 20 75 6e 64 65 72 73 74 61 uld not understa
01a0 6e 64 2e 3c 62 72 20 2f 3e 0a 3c 2f 70 3e 0a 3c nd.
.