Skip to content

Commit 1bfa84b

Browse files
committed
Land rapid7#5628, sessions -d removal
2 parents 70191bf + dde853b commit 1bfa84b

File tree

1 file changed

+1
-25
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+1
-25
lines changed

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

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class Core
4040
"-l" => [ false, "List all active sessions" ],
4141
"-v" => [ false, "List verbose fields" ],
4242
"-q" => [ false, "Quiet mode" ],
43-
"-d" => [ true, "Detach an interactive session" ],
4443
"-k" => [ true, "Terminate sessions by session ID and/or range" ],
4544
"-K" => [ false, "Terminate all sessions" ],
4645
"-s" => [ true, "Run a script on the session given with -i, or all"],
@@ -1679,9 +1678,6 @@ def cmd_sessions(*args)
16791678
sid = val || false
16801679
when "-K"
16811680
method = 'killall'
1682-
when "-d"
1683-
method = 'detach'
1684-
sid = val || false
16851681
# Run a script on all meterpreter sessions
16861682
when "-s"
16871683
unless script
@@ -1827,26 +1823,6 @@ def cmd_sessions(*args)
18271823
end
18281824
end
18291825
end
1830-
when 'detach'
1831-
print_status("Detaching the following session(s): #{session_list.join(', ')}")
1832-
session_list.each do |sess_id|
1833-
session = verify_session(sess_id)
1834-
# if session is interactive, it's detachable
1835-
if session
1836-
if session.respond_to?(:response_timeout)
1837-
last_known_timeout = session.response_timeout
1838-
session.response_timeout = response_timeout
1839-
end
1840-
print_status("Detaching session #{sess_id}")
1841-
begin
1842-
session.detach
1843-
ensure
1844-
if session.respond_to?(:response_timeout) && last_known_timeout
1845-
session.response_timeout = last_known_timeout
1846-
end
1847-
end
1848-
end
1849-
end
18501826
when 'interact'
18511827
session = verify_session(sid)
18521828
if session
@@ -1981,7 +1957,7 @@ def cmd_sessions_tabs(str, words)
19811957
end
19821958

19831959
case words[-1]
1984-
when "-i", "-k", "-d", "-u"
1960+
when "-i", "-k", "-u"
19851961
return framework.sessions.keys.map { |k| k.to_s }
19861962

19871963
when "-c"

0 commit comments

Comments
 (0)