2 Комити 2e4c37a138 ... 072dee6074

Аутор SHA1 Порука Датум
  Stefan Schmidt 072dee6074 Filetime fix fix fix, again пре 6 година
  Stefan Schmidt 40d91bfc5d Fix for incorrect label times пре 6 година
3 измењених фајлова са 4 додато и 3 уклоњено
  1. 2 1
      code/Core/LabelManager.py
  2. 1 1
      code/ID2TLib/Utility.py
  3. 1 1
      code/Test/test_SMBScanAttack.py

+ 2 - 1
code/Core/LabelManager.py

@@ -2,6 +2,7 @@ import importlib
 import datetime as dt
 import datetime as dt
 import os.path
 import os.path
 import xml.dom.minidom as minidom
 import xml.dom.minidom as minidom
+import pytz as pytz
 
 
 import ID2TLib.Label as Label
 import ID2TLib.Label as Label
 import ID2TLib.TestLibrary as Lib
 import ID2TLib.TestLibrary as Lib
@@ -105,7 +106,7 @@ class LabelManager:
 
 
             # add timestamp in human-readable format
             # add timestamp in human-readable format
             timestamp_hr = doc.createElement(self.TAG_TIMESTAMP_HR)
             timestamp_hr = doc.createElement(self.TAG_TIMESTAMP_HR)
-            timestamp_hr_text = dt.datetime.fromtimestamp(timestamp_entry).strftime('%Y-%m-%d %H:%M:%S.%f')
+            timestamp_hr_text = dt.datetime.fromtimestamp(timestamp_entry).astimezone(pytz.timezone('UTC')).strftime('%Y-%m-%d %H:%M:%S.%f')
             timestamp_hr.appendChild(doc.createTextNode(timestamp_hr_text))
             timestamp_hr.appendChild(doc.createTextNode(timestamp_hr_text))
             timestamp_root.appendChild(timestamp_hr)
             timestamp_root.appendChild(timestamp_hr)
 
 

+ 1 - 1
code/ID2TLib/Utility.py

@@ -190,7 +190,7 @@ def get_filetime_format(timestamp):
     :param timestamp: a timestamp in seconds
     :param timestamp: a timestamp in seconds
     :return: MS FILETIME timestamp
     :return: MS FILETIME timestamp
     """
     """
-    boot_datetime = pytz.timezone('UTC').localize(dt.datetime.fromtimestamp(timestamp))
+    boot_datetime = dt.datetime.fromtimestamp(timestamp).astimezone(pytz.timezone('UTC'))
     boot_filetime = 116444736000000000 + (cal.timegm(boot_datetime.timetuple()) * 10000000)
     boot_filetime = 116444736000000000 + (cal.timegm(boot_datetime.timetuple()) * 10000000)
     return boot_filetime + (boot_datetime.microsecond * 10)
     return boot_filetime + (boot_datetime.microsecond * 10)
 
 

+ 1 - 1
code/Test/test_SMBScanAttack.py

@@ -7,7 +7,7 @@ sha_dest_mac_only = 'c42a1775db981a139abd42d031273805cbebd2316b0d8c097217c12193f
 sha_multiple_victims_macos = 'b9a9f423d4154bc38723214124ad74dfdd07a39753563d21f5b453a8c069914a'
 sha_multiple_victims_macos = 'b9a9f423d4154bc38723214124ad74dfdd07a39753563d21f5b453a8c069914a'
 sha_one_victim_linux = '3bb17444446334cf4feee9dd7cbeabd17acbb5ef48525fb3963591f30c37d17a'
 sha_one_victim_linux = '3bb17444446334cf4feee9dd7cbeabd17acbb5ef48525fb3963591f30c37d17a'
 sha_port_shuffle = '08bdecc68fa1a2d1b0dd9802d7d025d42d90b9184d1fb6e1bcab234fac7db1b4'
 sha_port_shuffle = '08bdecc68fa1a2d1b0dd9802d7d025d42d90b9184d1fb6e1bcab234fac7db1b4'
-sha_smb2 = 'ef525fb61612a3db90bd0bbfaf4412f682933954357c941e1d8ac05c9ec373d4'
+sha_smb2 = '315bc052fd045f8738021062e8b5f77a33c649adfed490d3c9da94c97ba32f95'
 sha_ip_src_shuffle = '1d699ca109c62000b77b53002f1087ebf5ccc2c2dead1dbc5c18b5f6311273d0'
 sha_ip_src_shuffle = '1d699ca109c62000b77b53002f1087ebf5ccc2c2dead1dbc5c18b5f6311273d0'
 sha_victim_range_winxp_hosting = 'bd624da4e3b7a3f06b8154ed9d6274d498b589aaaa11c2d0dc207a80ab7205b9'
 sha_victim_range_winxp_hosting = 'bd624da4e3b7a3f06b8154ed9d6274d498b589aaaa11c2d0dc207a80ab7205b9'