check for empty args to sessions -c
git-svn-id: file:///home/svn/framework3/trunk@8616 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
b391abd32d
commit
cc4b13a0a0
|
@ -1083,10 +1083,12 @@ class Core
|
|||
when "-q"
|
||||
quiet = true
|
||||
|
||||
# Run a command on all sessions
|
||||
when "-c"
|
||||
method = 'cmd'
|
||||
if (val)
|
||||
cmds << val
|
||||
|
||||
end
|
||||
|
||||
when "-v"
|
||||
verbose = true
|
||||
|
@ -1111,6 +1113,7 @@ class Core
|
|||
method = 'detach'
|
||||
sid = val
|
||||
|
||||
# Run a script on all meterpreter sessions
|
||||
when "-s"
|
||||
method = 'scriptall'
|
||||
script = val
|
||||
|
@ -1129,6 +1132,7 @@ class Core
|
|||
case method
|
||||
|
||||
when 'cmd'
|
||||
if (cmds.length > 0)
|
||||
cmds.each do |cmd|
|
||||
framework.sessions.each_sorted do |s|
|
||||
session = framework.sessions.get(s)
|
||||
|
@ -1156,6 +1160,9 @@ class Core
|
|||
# commands on), so don't bother.
|
||||
end
|
||||
end
|
||||
else
|
||||
print_error("No command specified!")
|
||||
end
|
||||
|
||||
when 'kill'
|
||||
if ((session = framework.sessions.get(sid)))
|
||||
|
|
Loading…
Reference in New Issue