Get _ws.col.Info, plus all packet fields, as a .json exported file
Hi again guys!
I'm making a little C# code to export expanded PCAP files to a Database.
So far I have succeeded in creating the JSON, however, I noticed that a very nice Wireshark column, _ws.col.Info, is missing on the generated file.
This column would contain very important information for DIAMETER and CAMEL analysis, for example, "SACK invoke InitialDP","invoke eventReportBCSM",""SACK invoke release call", among others.
On previous projects where I was required to export the PCAP as CSV, I was able to do so by using switches like the following one:
-e frame.number -e frame.time -e _ws.col.Info -e diameter.Session-Id -e e164.msisdn -e e212.imsi
However, when I apply the aforementioned filters, I stop getting the whole PCAP file translated as JSON, and only get whichever field is indicated on the filter.
Instead, I would like to get the whole PCAP contents (plus the-e _ws.col.Info field). In that way the user could navigate through the file in a visual way, and later export whatever field he/she wants.
Let me show you some pictures of how the program looks
This is part of the code I came up with, if anybody finds it useful
String fileNameWithoutExtension = Path.GetFileNameWithoutExtension(pcapFilePath);
String fileNameWithExtension = Path.GetFileName(pcapFilePath);
String pathWorkingFolder = pcapFilePath.Replace(fileNameWithExtension, "");
String pathFilteredPcap = "\"" + pathWorkingFolder + fileNameWithoutExtension + "_filtered.pcap\"";
String argumentsPcapToFilteredPcap = "-r \"" + pcapFilePath + "\" -Y camel -w " + pathFilteredPcap;
String consoleOutputPcapToFilteredPcap = await new UtilsIO().executeExe(SHARK_INSTALL_FOLDER, argumentsPcapToFilteredPcap);
Console.WriteLine(consoleOutputPcapToFilteredPcap);
Console.WriteLine("Filtered PCAP ready...");
String pathJsonFile = pathWorkingFolder + fileNameWithoutExtension + ".json";
String argumentsFilteredPcapToJson = "-r " + pathFilteredPcap + " -T json ";
Console.WriteLine("Generating JSON...");
String consoleOutputFromPcapToJson = await new UtilsIO().executeExe(SHARK_INSTALL_FOLDER, argumentsFilteredPcapToJson);
UtilsIO.saveTextFile(consoleOutputFromPcapToJson, pathJsonFile);
Console.WriteLine("JSON Ready...");
As always thank you very much!
Edited the question's title and added some screenshots to properly explain my problem