Analyze network problems with Wireshark without installing software on production systems

Often, problems with the public key infrastructure can be found in the underlying network - for example, if a firewall rule is missing from the network.

Thus, it is helpful if one is able to record network traffic in order to analyze it. Excellent tools exist for this purpose, such as Wireshark , but these require that an installation be made on the system in question, which cannot and should not be done easily on a production system.

Fortunately, the Windows Server operating system has a built-in mechanism to capture network packets. However, the resulting files are not compatible with Wireshark. Microsoft's own tool, Message Analyzer, was discontinued on Nov 25, 2019 and the download links removed .

The following therefore describes how such a recording can be generated and subsequently converted into a Wireshark-compatible format in order to be able to analyze the recording away from the server in question.

On the PKI system in question, a packet capture is started as an administrator with the following command line command:

netsh trace start persistent=no report=no capture=yes [maxSize=1024] [ipv4.address={IP-Adresse-Quelle-oder-Ziel}] tracefile={Pfad-zur-Aufgabedatei}.etl

Command prompt: netsh trace start with persistent=yes, capture=yes and tracefile=C:\Temp\NetTrace.etl, status Running

If the "tracefile" parameter is not specified, a file is automatically created in the user's temp directory.

After a short waiting period one can start reproducing the error. Once this has been completed successfully, the recording can be stopped with the following command line command:

netsh trace stop

Command prompt: netsh trace stop reports "Tracing session was successfully stopped."

The created file can now be converted to a Wireshark-compatible format, either on the same system or on another one, with the free Microsoft program etl2pcapng .

etl2pcapng {ETL-Datei}.etl {PCAPNG-Datei}.pcapng

cmd: etl2pcapng.exe converts NetTrace.etl to NetTrace.pcapng, "Converted 1092 frames"

The .pcapng file generated in this step can now be opened and analyzed with Wireshark.

Filtering the recorded data

Do you know TameMyCerts? TameMyCerts is an add-on for the Microsoft certification authority (Active Directory Certificate Services). It extends the function of the certification authority and enables the application of rule sets to realize the secure automation of certificate issuance. TameMyCerts is unique in the Microsoft ecosystem, has already proven itself in countless companies around the world and is available under a free license. It can be downloaded via GitHub and used free of charge. Professional maintenance is also offered.

In case a network firewall silently drops the outgoing data packets, an appropriate filter could look like the following, for example:

ActionSyntax
Show traffic from a specific source system onlyip.src == {IP address of the source system}
Show traffic to a specific target system onlyip.dst == {IP address of the target system}
Show only initiated TCP connectionstcp.flags.syn == 1

Example:

tcp.flags.syn == 1 && ip.dst == {IP-Adresse-des-Zielsystems} && ip.src == {IP-Adresse-des-Quellsystems}

If the filter is now applied to the .pcapng file, the previously described case of a network firewall silently dropping outgoing packets would show up as follows, for example (packets with the SYN flag set repeatedly appear, Wireshark suspects retransmission):

Wireshark (German UI), filter tcp.flags.syn == 1 && ip.dst == 10.55.238.22 && ip.src == 10.2.17.55: SYN packets with TCP Retransmission

External sources