0
接收輸出時
我的代碼應該追查的數據包,Scapy的聞了聞,並檢查該程序發送/接收數據包,把「未知」如果程序沒有找到蟒蛇 - 錯誤試圖從check_output
代碼:
source_software = check_output(["netstat", "-nb"], shell = True).decode()
source_software = source_software[source_software.find(str(packet_dictionary["Port"])) : ]
source_software = source_software[source_software.find("\n") + 2 : source_software.find("]")]
if "Can not" not in source_software and len(source_software) > MINIMUM_LENGTH:
packet_dictionary["Software"] = source_software
else:
packet_dictionary["Software"] = "Unknown"
錯誤:
File "Client.py", line 44, in add_to_list
source_software = check_output(["netstat", "-nb"], shell = True).decode()
File "C:\Python36\lib\subprocess.py", line 336, in check_output
**kwargs).stdout
File "C:\Python36\lib\subprocess.py", line 418, in run
output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['netstat', '-nb']' returned non-zero
exit status 1.
我忘了調試它,我在幾個星期前編碼這段代碼和今天又回來了,忘了我必須以管理員身份運行它 – NeXoR