From 388ba6a4c8ed4459ad2c3d4c038e1404bcba5a4e Mon Sep 17 00:00:00 2001 From: springzfx Date: Sat, 23 May 2020 13:49:09 +0800 Subject: [PATCH] execsnoop: fix get_pid --- execsnoop.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/execsnoop.py b/execsnoop.py index e584e07..ef50a9b 100644 --- a/execsnoop.py +++ b/execsnoop.py @@ -89,7 +89,10 @@ def attach(pid, path, proxy=True): def processAlreadyRunning(): from subprocess import check_output def get_pid(name): - return map(int,check_output(["pidof",name]).split()) + try: + return map(int,check_output(["pidof",name]).split()) + except: + return [] global exec_path_proxy, exec_path_noproxy for path in exec_path_proxy: for pid in get_pid(path):