public static void Main(string[] args) { if (args.Length < 1) { Console.WriteLine(@"Usage: TcpRecon <pcap file> [-nids] -nids -- Uses libnids for the tcp reconstruction e.g: TcpRecon C:\PcapFileDir\SomePcapFile.pcap "); return; } DateTime startTime = DateTime.Now; ReconFunc reconFunc = null; // decide which library to use if (args.Length > 1) { if (args[1].Equals("-nids")) { reconFunc = new ReconFunc(ReconSingleFileLibNids); nidsDict = new Dictionary <Connection, FileStream>(); } } // we are using the built in functionality if (reconFunc == null) { reconFunc = new ReconFunc(ReconSingleFileSharpPcap); sharpPcapDict = new Dictionary <Connection, TcpRecon>(); } string capFile = args[0]; if (!zFile.Exists(capFile)) { Console.WriteLine("Pcap file not found!"); return; } // start the chosen capturing library reconFunc(capFile); DateTime finishTime = DateTime.Now; TimeSpan totalTime = (finishTime - startTime); Console.WriteLine(string.Format("\nTotal reconstruct time: {0} seconds", totalTime.TotalSeconds)); }
static void Main(string[] args) { if (args.Length < 1) { Console.WriteLine(@"Usage: TcpRecon <pcap file> [-nids] -nids -- Uses libnids for the tcp reconstruction e.g: TcpRecon C:\PcapFileDir\SomePcapFile.pcap "); return; } DateTime startTime = DateTime.Now; ReconFunc reconFunc = null; // decide which library to use if (args.Length > 1) { if (args[1].Equals("-nids")) { reconFunc = new ReconFunc(ReconSingleFileLibNids); nidsDict = new Dictionary<Connection, FileStream>(); } } // we are using the built in functionality if (reconFunc == null) { reconFunc = new ReconFunc(ReconSingleFileSharpPcap); sharpPcapDict = new Dictionary<Connection, TcpRecon>(); } string capFile = args[0]; if (!System.IO.File.Exists(capFile)) { Console.WriteLine("Pcap file not found!"); return; } // start the chosen capturing library reconFunc(capFile); DateTime finishTime = DateTime.Now; TimeSpan totalTime = (finishTime - startTime); Console.WriteLine(string.Format("\nTotal reconstruct time: {0} seconds", totalTime.TotalSeconds)); }