Skip to content

Commit 8aa6fca

Browse files
committed
Minor fixes and status update
Minor tweaks after the PR from @kernelsmith Remaining items: 1. Handle empty session IDs correctly, for example 'sessions -d' or 'sessions -k' 2. Find a method of explaining the range options in the help text 3. Retest all changed code areas 4. Edit PR Summary to reflect changes to the scope
1 parent ff6bc5c commit 8aa6fca

File tree

1 file changed

+7
-8
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+7
-8
lines changed

lib/msf/ui/console/command_dispatcher/core.rb

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1613,7 +1613,7 @@ def cmd_sessions(*args)
16131613
method = 'killall'
16141614
when "-d"
16151615
method = 'detach'
1616-
sid = val
1616+
sid = val || nil
16171617
# Run a script on all meterpreter sessions
16181618
when "-s"
16191619
unless script
@@ -1698,8 +1698,8 @@ def cmd_sessions(*args)
16981698
end
16991699
end
17001700
when 'kill'
1701+
print_status("Killing the following session(s): #{session_list.join(', ')}")
17011702
session_list.each do |sess_id|
1702-
print_status("Killing the following session(s): #{session_list.join(', ')}")
17031703
session = framework.sessions.get(sess_id)
17041704
if session
17051705
print_status("Killing session #{sess_id}")
@@ -2973,12 +2973,11 @@ def cmd_go_pro(*args)
29732973
protected
29742974

29752975
#
2976-
# verifies that a given session_id is valid and that the session is interactive
2977-
# interactive. The various return values allow the caller to make better
2978-
# decisions on what action can & should be taken depending on the capabilities
2979-
# of the session and the caller's objective while making it simple to use in
2980-
# the nominal case where the caller needs session_id to match an interactive
2981-
# session
2976+
# verifies that a given session_id is valid and that the session is interactive.
2977+
# The various return values allow the caller to make better decisions on what
2978+
# action can & should be taken depending on the capabilities of the session
2979+
# and the caller's objective while making it simple to use in the nominal case
2980+
# where the caller needs session_id to match an interactive session
29822981
#
29832982
# @param session_id [String] A session id, which is an integer as a string
29842983
# @param quiet [Boolean] True means the method will produce no error messages

0 commit comments

Comments
 (0)