Browse Source

moved summary back to after injection, added some stats, rephrased descriptions

Jonathan Speth 6 years ago
parent
commit
355ebdd2fc
2 changed files with 8 additions and 5 deletions
  1. 5 2
      code/Core/AttackController.py
  2. 3 3
      code/Core/Controller.py

+ 5 - 2
code/Core/AttackController.py

@@ -206,6 +206,7 @@ class AttackController:
         #self.statistics.load_pcap_statistics(False, True, False)
 
         total_packet_count = self.statistics.get_packet_count() + self.total_packets
+        added_packets_share = self.total_packets / total_packet_count * 100
         pdu_count = self.statistics.process_db_query("SELECT SUM(pktCount) FROM unrecognized_pdus")
         pdu_share = pdu_count / total_packet_count * 100
         last_pdu_timestamp = self.statistics.process_db_query(
@@ -213,9 +214,11 @@ class AttackController:
         timespan = self.statistics.get_capture_duration()
 
         summary = [("Total packet count", total_packet_count, "packets"),
-                   ("Total unknown pdu count", pdu_count, "pdus"),
+                   ("Added packet count", self.total_packets, "packets"),
+                   ("Share of added packets", added_packets_share, "%"),
+                   ("Unknown pdu count", pdu_count, "pdus"),
                    ("Share of unknown pdus", pdu_share, "%"),
-                   ("Last unknown pdu occurrence", last_pdu_timestamp, ""),
+                   ("Last unknown pdu", last_pdu_timestamp, ""),
                    ("Capture duration", timespan, "seconds")]
 
         print("\nPCAP FILE STATISTICS SUMMARY  ------------------------------")

+ 3 - 3
code/Core/Controller.py

@@ -58,9 +58,6 @@ class Controller:
         :param time: Measure time for packet generation.
         """
 
-        # print summary of src pcap statistics
-        self.attack_controller.stats_summary(self.pcap_dest_path)
-
         # load attacks sequentially
         i = 0
         for attack in attacks_config:
@@ -113,6 +110,9 @@ class Controller:
         # print status message
         print('\nOutput files created: \n', self.pcap_dest_path, '\n', self.label_manager.label_file_path)
 
+        # print summary statistics
+        self.attack_controller.stats_summary(self.pcap_dest_path)
+
     def process_db_queries(self, query, print_results=False):
         """
         Processes a statistics database query. This can be a standard SQL query or a named query.