jimtangshfx / 5G_ciphered_NAS_decipher_tool

A python tool to decipher/decrypt 5G ciphered NAS message and export plain 5G NAS into wireshark pcap file
75 stars 29 forks source link

FileNotFoundError due to subprocess.Popen format #2

Open lemur117 opened 2 years ago

lemur117 commented 2 years ago

Thanks for making this tool available! I haven't decrypted anything with it yet, but I think it will be very useful. There is one small issue I found while pre-testing it with Python 3.8.10. I had to comment out line 539 as below:

538: parameters = [tshark_path, '-r', '"'+file_name+'"', '-2', '-R', 'ngap', '-w', '"'+self.filtered_file_name+'"']
539: #parameters = ' '.join(parameters)
540: tshark_process = subprocess.Popen(parameters)

Otherwise I received this error:

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "5G_NAS_decipher_3gpp_standard.py", line 556, in main_test
    if self.filter_pcap():
  File "5G_NAS_decipher_3gpp_standard.py", line 539, in filter_pcap
    tshark_process = subprocess.Popen(parameters)
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/tshark -r "/home/myhome/Traces/merged.pcap" -2 -R ngap -w "/home/myhome/Traces/merged_filtered.pcap"'

But after commenting out the parameters = ' '.join(parameters) line, it worked fine.

Thanks!