@@ -110,7 +110,7 @@ class View( object ):
110
110
NETWORK_ANALYSIS_POLICY = 'networkAnalysisPolicy'
111
111
ORIGINAL_CLIENT_SRC_IP = 'originalSrcIP'
112
112
PACKET_DATA = 'packet'
113
- PACKET_DATA_FULL = 'packetHex '
113
+ PACKET_DATA_FULL = 'originalPacket '
114
114
PARENT_DETECTION = 'parentDetection'
115
115
PRIORITY = 'priority'
116
116
PROTOCOL = 'protocol'
@@ -345,7 +345,6 @@ def create( self ):
345
345
346
346
packet = record ['packetData' ]
347
347
packetEncoding = self .settings .subscribePacketEncoding
348
-
349
348
if isinstance (packet , (bytes , bytearray )) :
350
349
351
350
if self .settings .subscribePacketEncoding :
@@ -359,12 +358,17 @@ def create( self ):
359
358
packet = p .getPayloadAsAscii ()
360
359
361
360
elif packetEncoding == 'utf-8' :
362
-
361
+
363
362
binData = binascii .unhexlify ( packet )
364
363
p = Packet (binData )
365
364
packet = p .getPayloadAsUtf8 ()
366
365
else :
367
- packet = record ['packetData' ].decode ('utf-8' )
366
+ binData = binascii .unhexlify ( packet )
367
+ p = Packet (binData )
368
+ packet = p .getPayloadAsHex ()
369
+
370
+ if self .settings .subscribeIncludeOriginalPacket :
371
+ self .__addValue (View .PACKET_DATA_FULL ,record ['packetData' ].decode ('utf-8' ))
368
372
369
373
self .__addValue (View .PACKET_DATA , packet )
370
374
@@ -801,6 +805,12 @@ def create( self ):
801
805
802
806
elif recordTypeId == definitions .RECORD_MALWARE_EVENT :
803
807
# 125
808
+
809
+ for key in record :
810
+ if isinstance (record [key ], (bytes , bytearray )) :
811
+ value = record [key ].decode ('utf-8' )
812
+ record [key ] = value
813
+
804
814
self .__addValueIfAvailable (
805
815
View .CLOUD ,
806
816
[ Cache .CLOUDS , record ['cloudUuid' ]] )
@@ -1147,6 +1157,12 @@ def create( self ):
1147
1157
elif recordTypeId == definitions .RECORD_FILELOG_EVENT or \
1148
1158
recordTypeId == definitions .RECORD_FILELOG_MALWARE_EVENT :
1149
1159
# 500 or 502
1160
+
1161
+ for key in record :
1162
+ if isinstance (record [key ], (bytes , bytearray )) :
1163
+ value = record [key ].decode ('utf-8' )
1164
+ record [key ] = value
1165
+
1150
1166
self .__addValueIfAvailable (
1151
1167
View .FILE_POLICY ,
1152
1168
[ Cache .POLICIES , record ['accessControlPolicyUuid' ]] )
@@ -1229,6 +1245,11 @@ def create( self ):
1229
1245
1230
1246
elif recordTypeId == definitions .METADATA_FILELOG_SHA :
1231
1247
# 511
1248
+ for key in record :
1249
+ if isinstance (record [key ], (bytes , bytearray )) :
1250
+ value = record [key ].decode ('utf-8' )
1251
+ record [key ] = value
1252
+
1232
1253
self .__addValueIfAvailable (
1233
1254
View .DISPOSITION ,
1234
1255
[ Cache .FILE_DISPOSITIONS , record ['disposition' ]] )
0 commit comments