def clean_path(self, subpath, binary):
print "[-] Deleting the path and cleaning up\n"
for pid in psutil.pids():
if binary in psutil.Process(pid).name():
try:
print "Killing the process..."
subprocess.check_call(["taskkill", "/t", "/f", "/pid", str(pid)])
except subprocess.CalledProcessError:
self.print_ko("[!!] The process %s can't be killed" % binary)
subprocess.check_call(
["powershell", "-C", "rm", "-r", "-Force", subpath])
评论列表
文章目录