替换 PcapNGFormatAnalys.py
This commit is contained in:
@@ -124,7 +124,7 @@ def ExtractPacketsCommentStr(input_file_path, appsketch_api, pcap_file_id):
|
|||||||
else:
|
else:
|
||||||
proto = 'other'
|
proto = 'other'
|
||||||
stream_id = ''
|
stream_id = ''
|
||||||
session_dict['session'] = appsketch_api + 'session/' + pcap_file_id + '/' + proto + '/' + stream_id
|
session_dict['session'] = appsketch_api + '/session/' + pcap_file_id + '/' + proto + '/' + stream_id
|
||||||
comment_str_list.append(session_dict)
|
comment_str_list.append(session_dict)
|
||||||
|
|
||||||
return comment_str_list
|
return comment_str_list
|
||||||
@@ -151,12 +151,8 @@ if __name__=="__main__":
|
|||||||
|
|
||||||
input_file_path = TransferPcapNG(sys.argv[1])
|
input_file_path = TransferPcapNG(sys.argv[1])
|
||||||
output_file_path = sys.argv[2]
|
output_file_path = sys.argv[2]
|
||||||
appsketch_api = 'https://sg.appsketch.gdnt-cloud.com/'
|
appsketch_api = sys.argv[3]
|
||||||
|
pcap_file_id = sys.argv[4]
|
||||||
# Get the file name (including extension)
|
|
||||||
file_name_with_extension = os.path.basename(input_file_path)
|
|
||||||
# Remove the extension
|
|
||||||
pcap_file_id = os.path.splitext(file_name_with_extension)[0]
|
|
||||||
|
|
||||||
comment_str_list = ExtractPacketsCommentStr(input_file_path, appsketch_api, pcap_file_id)
|
comment_str_list = ExtractPacketsCommentStr(input_file_path, appsketch_api, pcap_file_id)
|
||||||
# for i, pkt in enumerate(comment_str_list):
|
# for i, pkt in enumerate(comment_str_list):
|
||||||
|
|||||||
Reference in New Issue
Block a user