Technical Tip: How to import 'diagnose sniffer packet' data to WireShark
- February 10, 2020
- 0 replies
- 61778 views
Description
This article describes how the output of the 'diagnose sniff packet' command can be imported into Wireshark.
Â
Scope
Â
FortiGate.
Solution
In this example, the test unit is continuously pinging 8.8.8.8.
To check what is happening on the packet using Wireshark, follow these steps (Windows):
Â
Install Wireshark. This is required even if the device performing the conversion will not be used to review the result. The version of fgt2eth.exe attached checks for text2pcap using the path 'C:\Program Files\Wireshark ext2pcap.exe'.
Download fgt2eth.exe.12.2014.zip file attached on this article or download Sniftran from Github repository.
Unzip and save fgt2eth.exe (or sniftran.exe) in a specific folder.
Access the unit using Putty or any other SSH application.
Ensure Putty is set to log all printable output to a file. Save the session where fgteth.exe is saved.
Run the following command (make sure to use the value 6 0 on the sniff):
diagnose sniff packet any ‘host 8.8.8.8 and icmp’ 6 0
The test unit starts pinging 8.8.8.8.

The FortiGate CLI packet sniffer started populating captures.

When finished, use Ctrl-C to stop the sniffer.
Open the command prompt on the Windows machine and navigate to the directory where fgt2eth.exe (or sniftran.exe) and the SSH log are saved. To move between folders, use 'cd', and to verify the list of files in the directory, use 'dir'.
Run the tool in the command prompt.
fgt2eth.exe -in <ssh_log_name.txt> -out <pcap_name.pcap>
sniftran.exe -in <ssh_log_name.txt> -out <pcap_name.pcap>
Go to the folder and open the PCAP using Wireshark.


Â
Sniftran feature:
Automatically adds the interface name and traffic direction to the PCAPng comments section.

Ability to select only some interfaces to include from the capture (--include or --exclude parameters).
Ability to decode captures on p2p (PPP) interfaces.
Ability to decode capture taken with FortiGate sniffer option '5'.
Related articles:
Troubleshooting Tip: Packet capture (CLI sniffer) tips and best practices
Troubleshooting Tip: Using the FortiOS built-in packet sniffer for capturing packets
Technical Tip: How to import 'diagnose sniffer packet' data to WireShark - Ethereal application
Â
Third-Party Links:
