summaryrefslogtreecommitdiff
path: root/PcapNGFormatAnalys.py
diff options
context:
space:
mode:
author何勇 <[email protected]>2024-08-21 07:56:53 +0000
committer何勇 <[email protected]>2024-08-21 07:56:53 +0000
commitbbaf8eac816c6cae6d8458e0beebd4f483dc1365 (patch)
treea252e4b9cbb217f8f744d1c9922940037c0ef02e /PcapNGFormatAnalys.py
parent61df337ee00db0cbca3acdfe48d654797ecc6da6 (diff)
替换 PcapNGFormatAnalys.py
Diffstat (limited to 'PcapNGFormatAnalys.py')
-rw-r--r--PcapNGFormatAnalys.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/PcapNGFormatAnalys.py b/PcapNGFormatAnalys.py
index 21ee58b..ccb3837 100644
--- a/PcapNGFormatAnalys.py
+++ b/PcapNGFormatAnalys.py
@@ -124,7 +124,7 @@ def ExtractPacketsCommentStr(input_file_path, appsketch_api, pcap_file_id):
else:
proto = 'other'
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)
return comment_str_list
@@ -151,12 +151,8 @@ if __name__=="__main__":
input_file_path = TransferPcapNG(sys.argv[1])
output_file_path = sys.argv[2]
- appsketch_api = 'https://sg.appsketch.gdnt-cloud.com/'
-
- # 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]
+ appsketch_api = sys.argv[3]
+ pcap_file_id = sys.argv[4]
comment_str_list = ExtractPacketsCommentStr(input_file_path, appsketch_api, pcap_file_id)
# for i, pkt in enumerate(comment_str_list):