Skip to content

Commit 3da96d6

Browse files
committed
separate check_kill
1 parent dbad052 commit 3da96d6

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

lib/cli/console.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,18 @@ def completer(text, state):
117117
atexit.register(readline.write_history_file, HISTFILE)
118118

119119

120+
# kill process by name
121+
def check_kill_process(pstring):
122+
'''
123+
cross-platform way of killing process by name
124+
'''
125+
import psutil
126+
127+
for proc in psutil.process_iter():
128+
if pstring in str(proc.cmdline):
129+
proc.kill()
130+
131+
120132
def debug_except():
121133
'''
122134
display traceback info

lib/cli/main.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import lib.cli.console as console
1515
import lib.tools.baidu as baidu
1616
import lib.tools.exploits as ExecExp
17-
from lib.cli.console import debug_except, input_check
17+
from lib.cli.console import debug_except, input_check, check_kill_process
1818
from lib.tools import zoomeye
1919

2020

@@ -37,18 +37,6 @@ class SessionParameters:
3737
'\\data\\ss.json'
3838

3939

40-
# kill process by name
41-
def check_kill_process(pstring):
42-
'''
43-
cross-platform way of killing process by name
44-
'''
45-
import psutil
46-
47-
for proc in psutil.process_iter():
48-
if pstring in str(proc.cmdline):
49-
proc.kill()
50-
51-
5240
def list_exp():
5341
'''
5442
list all labeled exploits under the root of your exploit dir

0 commit comments

Comments
 (0)