PCAP Search

This playbook is used to parse and search within PCAP files. Supported file types are pcap, cap, pcapng. The playbook can handle one PCAP file per incident. The user inputs which objects the playbook should search for in the PCAP. The values to search are IP addresses, CIDR ranges, and TCP or UDP ports or protocols. In the event that more than one input type was specified, specify in the QueryOperator input (such as IP addresses and TCP ports) if the PCAP filter query will use an AND or an OR operator between the inputs. Another option is to use advanced filters just like in Wireshark to use refined filters or for objects not specified in other inputs. Additional inputs allow the user to provide the WPA password for decrypting 802.11 (wireless) traffic and adding an RSA certificate to decrypt SSL traffic. To display the results within the relevant incident fields, the playbook needs to run in a PCAP Analysis incident type. For handling of PCAP files larger than 30 MB, refer to the PcapMinerV2 documentation.

PCAP Analysis · 29 tasks · 10 inputs · 6 outputs

Inputs

  • QueryOperator — In case the playbook has several search inputs provided such as IPAddressToSearch, TCPPortsToSearch ,UDPPortsToSearch, ProtocolToSearch and AdvancedSearchFilter. This input will specify if the inputs will be treated as an AND or an OR search for all the PCAP search filter. value can be "and" or "or". The default value is "and", If the IPAddressToSearch was defined as 192.168.1.1,192.168.1.2 The TCPPortsToSearch was defined as 445,443 And the QueryOperator was defined as "and" The resultant query will be (ip.addr == 192.168.1.1 or ip.addr == 192.168.1.2) and (tcp.port == 445 or tcp.port == 443) If the QueryOperator was defined as "or" The resultant query will be (ip.addr == 192.168.1.1 or ip.addr == 192.168.1.2) or (tcp.port == 445 or tcp.port == 443)
  • IPAddressToSearch — The value of an IP address to search. Can be a single IP or a comma delimited list of IP addresses. CIDR ranges are also acceptable. All IPs will be treated with the OR operator.
  • TCPPortsToSearch — The value of a TCP port number to search. Can be a single port or a comma delimited list of ports. All TCP ports will be treated with the OR operator.
  • UDPPortsToSearch — The value of a UDP port number to search. Can be a single port or a comma delimited list of ports. All UDP ports will be treated with the OR operator.
  • ProtocolToSearch — The protocols to search for within the PCAP file. Can be a single protocol or a comma delimited list of protocols. The protocol names should be the same as searching in Wireshark. For example smb2, dns etc. All protocols will be treated with the OR operator.
  • WpaPassword — This input value is used to provide a WPA (Wi-Fi Protected Access) password to decrypt encrypted 802.11 Wi-FI traffic.
  • AdvancedSearchFilter — Filter to apply on PCAP. Wireshark syntax as can be found here: https://www.wireshark.org/docs/man-pages/wireshark-filter.html This input is meant to handle more complex filters not covered by the other inputs. For example search by an attribute such as http.host, arp.dst.hw etc.
  • RsaDecryptKeyEntryID — This input specifics the file entry id for the RSA decrypt key if the user provided the key in the incident.
  • PcapFileEntryID — This input specifics the file entry id for the PCAP file if the user provided the file in the incident. One PCAP file can run per incident.
  • InternalIPRange — A list of internal IP ranges to check IP addresses against. The list should be provided in CIDR format, separated by commas. An example of a list of ranges could be: 172.16.0.0/12,10.0.0.0/8,192.168.0.0/16. If a list of IP ranges is not provided, the list provided in the IsIPInRanges script (the known IPv4 private address ranges) is used by default.

Outputs

  • InternalIPAddresses — The internal IP addresses that were found in the PCAP.
  • ExternalIPAddresses — The external IP addresses that were found in the PCAP.
  • DestinationTcpPorts — A list of destination TCP ports that were found in the PCAP
  • DestinationUdpPorts — A list of destination UDP ports that were found in the PCAP
  • DetectedProtocols — A list of protocols that were found in the PCAP
  • PcapQuery — The filter used for querying the PCAP file.

Flowchart

yes yes yes yes yes yes yes yes yes yes yes yes yes Start Start Is there a PCAP file? Is there a PCAP file? Set incident fields - SetGridField Set incident fields SetGridField Create TCP ports query - SetAndHandleEmpty Create TCP ports query SetAndHandleEmpty Set protocols to array - SetAndHandleEmpty Set protocols to array SetAndHandleEmpty PCAP Miner execution - PcapMinerV2 PCAP Miner execution PcapMinerV2 Protocol search Protocol search UDP port search UDP port search TCP port search TCP port search IP search IP search Done Done Advanced query filter search Advanced query filter search Create UDP ports query - SetAndHandleEmpty Create UDP ports query SetAndHandleEmpty Is there a value to search? Is there a value to search? Create free text query - SetAndHandleEmpty Create free text query SetAndHandleEmpty Create IP query - SetAndHandleEmpty Create IP query SetAndHandleEmpty Are there flow results? Are there flow results? Is there an advanced query filter? Is there an advanced quer... Is there a protocol to search? Is there a protocol to se... Is there an IP to search? Is there an IP to search? Is there a UDP port to search? Is there a UDP port to se... Is there a TCP port to search? Is there a TCP port to se... Check if IP addresses are internal or external - IsIPInRanges Check if IP addresses are... IsIPInRanges Is this a PCAP analysis incident type? Is this a PCAP analysis i... Set internal IP addresses - SetAndHandleEmpty Set internal IP addresses SetAndHandleEmpty Set external IP addresses - SetAndHandleEmpty Set external IP addresses SetAndHandleEmpty Set destination TCP ports - SetAndHandleEmpty Set destination TCP ports SetAndHandleEmpty Set destination UDP ports - SetAndHandleEmpty Set destination UDP ports SetAndHandleEmpty Set detected protocols - SetAndHandleEmpty Set detected protocols SetAndHandleEmpty