Skip to content

Commit e5836fb

Browse files
committed
Removed session -d from core.rb
Ticket rapid7#4423
1 parent ea4d135 commit e5836fb

File tree

1 file changed

+2
-26
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+2
-26
lines changed

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

Lines changed: 2 additions & 26 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"
@@ -3274,7 +3250,7 @@ def launch_metasploit_browser
32743250
browser_pid = ::Process.spawn(cmd, "https://localhost:3790")
32753251
::Process.detach(browser_pid)
32763252
elsif timeout >= 200 # 200 * 3 seconds is 10 minutes and that is tons of time.
3277-
print_line
3253+
print_linee
32783254
print_warning "For some reason, Community / Pro didn't start in a timely fashion."
32793255
print_warning "You might want to restart the Metasploit services by typing"
32803256
print_warning "'service metasploit restart'. Sorry it didn't work out."

0 commit comments

Comments
 (0)