Skip to content

Commit 74040c4

Browse files
committed
Rename the sess command to terminal
Lots of people have been frustrated by the `sess` command as it mucks with the autocomplete for `sessions`. This is a fair concern, especially given that `sess` was intended to be a non-annoying shortcut. This commit changes the `sess` command so that it is instead called `terminal`. I couldn't think of a better option that didn't already clash with another name or meaning. At least `terminal` is something that doesn't clash, doesn't muck with any existin autocomplete rules, and is in some way another name for the existing sessions. Feedback appreciated!
1 parent 3a998fa commit 74040c4

File tree

2 files changed

+10
-10
lines changed
  • lib
    • msf/ui/console/command_dispatcher
    • rex/post/meterpreter/ui/console/command_dispatcher

2 files changed

+10
-10
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ def commands
110110
"quit" => "Exit the console",
111111
"route" => "Route traffic through a session",
112112
"save" => "Saves the active datastores",
113-
"sess" => "Interact with a given session",
114113
"sessions" => "Dump session listings and display information about sessions",
115114
"set" => "Sets a context-specific variable to a value",
116115
"setg" => "Sets a global variable to a value",
117116
"sleep" => "Do nothing for the specified number of seconds",
117+
"terminal" => "Interact with a given session",
118118
"threads" => "View and manipulate background threads",
119119
"unload" => "Unload a framework plugin",
120120
"unset" => "Unsets one or more context-specific variables",
@@ -988,8 +988,8 @@ def cmd_spool(*args)
988988
return
989989
end
990990

991-
def cmd_sess_help
992-
print_line('Usage: sess <session id>')
991+
def cmd_terminal_help
992+
print_line('Usage: terminal <session id>')
993993
print_line
994994
print_line('Interact with the given session ID.')
995995
print_line('This works the same as: sessions -i <session id>')
@@ -999,9 +999,9 @@ def cmd_sess_help
999999
#
10001000
# Helper function to quickly select a session
10011001
#
1002-
def cmd_sess(*args)
1002+
def cmd_terminal(*args)
10031003
if args.length == 0 || args[0].to_i == 0
1004-
cmd_sess_help
1004+
cmd_terminal_help
10051005
else
10061006
cmd_sessions('-i', args[0])
10071007
end

lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def commands
6565
"bgkill" => "Kills a background meterpreter script",
6666
"get_timeouts" => "Get the current session timeout values",
6767
"set_timeouts" => "Set the current session timeout values",
68-
"sess" => "Quickly switch to another session",
68+
"terminal" => "Quickly switch to another session",
6969
"bglist" => "Lists running background scripts",
7070
"write" => "Writes data to a channel",
7171
"enable_unicode_encoding" => "Enables encoding of unicode strings",
@@ -118,17 +118,17 @@ def name
118118
"Core"
119119
end
120120

121-
def cmd_sess_help
122-
print_line('Usage: sess <session id>')
121+
def cmd_terminal_help
122+
print_line('Usage: terminal <session id>')
123123
print_line
124124
print_line('Interact with a different session Id.')
125125
print_line('This works the same as calling this from the MSF shell: sessions -i <session id>')
126126
print_line
127127
end
128128

129-
def cmd_sess(*args)
129+
def cmd_terminal(*args)
130130
if args.length == 0 || args[0].to_i == 0
131-
cmd_sess_help
131+
cmd_terminal_help
132132
elsif args[0].to_s == client.name.to_s
133133
print_status("Session #{client.name} is already interactive.")
134134
else

0 commit comments

Comments
 (0)