tklab-tud / ID2T

Official ID2T repository. ID2T creates labeled IT network datasets that contain user defined synthetic attacks.
MIT License
56 stars 22 forks source link

Loading a pcap with labels crashes ID2T #91

Closed UndeadKernel closed 5 years ago

UndeadKernel commented 5 years ago

The crash is due to self.statistics being null in BaseAttack.py line 386.

The erro backtrace is:

Label file found. Loading labels...
Traceback (most recent call last):
  File "/home/boy/id2t/code/CLI.py", line 228, in <module>
    main(sys.argv[1:])
  File "/home/boy/id2t/code/CLI.py", line 223, in main
    cli.parse_arguments(args)
  File "/home/boy/id2t/code/CLI.py", line 107, in parse_arguments
    self.process_arguments()
  File "/home/boy/id2t/code/CLI.py", line 118, in process_arguments
    self.process_pcap()
  File "/home/boy/id2t/code/CLI.py", line 171, in process_pcap
    self.args.debug)
  File "/home/boy/id2t/code/Core/Controller.py", line 41, in __init__
    self.label_manager = LabelManager.LabelManager(self.pcap_src_path)
  File "/home/boy/id2t/code/Core/LabelManager.py", line 46, in __init__
    self.load_labels()
  File "/home/boy/id2t/code/Core/LabelManager.py", line 247, in load_labels
    attack.add_param_value(param_name, param_value, param_userspecified)
  File "/home/boy/id2t/code/Attack/BaseAttack.py", line 386, in add_param_value
    elif param_name != atkParam.Parameter.INTERVAL_SELECT_STRATEGY and self.statistics.is_query(value):
AttributeError: 'NoneType' object has no attribute 'is_query'
pepper-jk commented 5 years ago

Moving the query elif case to the bottom of the if construct fixed the issue.

However there are other issues now:

ERROR: Parameter ip.src or parameter value [] not valid. Skipping parameter.
ERROR: Parameter mac.src or parameter value ['3c:50:94:e5:96:b5', 'd0:75:31:87:e0:53', '14:67:9a:9c:34:3f'] not valid. Skipping parameter.

UPDATE: Also fixed those issues. Gonna merge the fixes into master today.

pepper-jk commented 5 years ago

There is another issue with the labels: #92