Skip to content

Commit 46361c1

Browse files
committed
Final round of documentation
1 parent 6ccc4af commit 46361c1

File tree

7 files changed

+147
-140
lines changed

7 files changed

+147
-140
lines changed

lib/msf/core/rpc/v10/client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def initialize(info={})
4040
end
4141

4242

43-
# Logs in by calling the 'auth.login' API.
43+
# Logs in by calling the 'auth.login' API. The authentication token will expire 5 minutes
44+
# after the last request was made.
4445
#
4546
# @param [String] user Username.
4647
# @param [String] pass Password.

lib/msf/core/rpc/v10/rpc_auth.rb

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ class RPC_Auth < RPC_Base
1111
rescue ::LoadError
1212
end
1313

14-
# Handles client authentication.
14+
# Handles client authentication. The authentication token will expire 5 minutes after the
15+
# last request was made.
1516
#
1617
# @param [String] user The username.
1718
# @param [String] pass The password.
@@ -79,7 +80,8 @@ def rpc_logout(token)
7980
end
8081

8182

82-
# Returns a list of authentication tokens.
83+
# Returns a list of authentication tokens including the temporary ones, permanent, or the ones
84+
# stored in the backend.
8385
#
8486
# @return [Hash] A hash that contains a list of authentication tokens. It contains the following key:
8587
# * 'tokens' [Array<string>] An array of tokens.
@@ -128,10 +130,10 @@ def rpc_token_add(token)
128130
end
129131

130132

131-
# Generates a unique token, and automatically saved to the database.
133+
# Generates a random 32-byte authentication token, and automatically saved to the database.
132134
#
133135
# @return [Hash] A hash indicating the action was successful, also the new token.
134-
# It contains the following keys:
136+
# It contains the following keys:
135137
# * 'result' [String] The successful message: 'success'
136138
# * 'token' [String] A new token.
137139
# @example Here's how you would use this from the client:
@@ -158,8 +160,10 @@ def rpc_token_generate
158160
end
159161

160162

161-
# Removes a token from the database.
163+
# Removes a token from the database. Similar to what #rpc_logout does internally, except this
164+
# can remove tokens stored in the database backend (Mdm).
162165
#
166+
# @see #rpc_logout
163167
# @param [String] token The token to delete.
164168
# @return [Hash] A hash indicating the action was successful. It contains the following key:
165169
# * 'result' [String] The successful message: 'success'

lib/msf/core/rpc/v10/rpc_console.rb

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize(*args)
1515
@console_driver = Msf::Ui::Web::Driver.new(:framework => framework)
1616
end
1717

18-
# Creates a new framework console.
18+
# Creates a new framework console instance.
1919
#
2020
# @param [Hash] opts See Msf::Ui::Web::Driver#create_console
2121
# @return [Hash] Information about the new console. It contains the following keys:
@@ -58,7 +58,7 @@ def rpc_list
5858
end
5959

6060

61-
# Deletes a framework console.
61+
# Deletes a framework console instance.
6262
#
6363
# @param [Fixnum] cid Framework console ID.
6464
# @return [Hash] A result indicating whether the action was successful or not.
@@ -74,7 +74,7 @@ def rpc_destroy(cid)
7474
end
7575

7676

77-
# Returns the framework console output.
77+
# Returns the framework console output in raw form.
7878
#
7979
# @param [Fixnum] cid Framework console ID.
8080
# @return [Hash] There are two different hashes you might get:
@@ -143,15 +143,12 @@ def rpc_tabs(cid, line)
143143
end
144144

145145

146-
# Kills a framework session.
146+
# Kills a framework session that serves the same purpose as [CTRL]+[C] to abort an interactive session.
147+
# You might also want to considering using the session API calls instead of this.
147148
#
148149
# @param [Fixnum] cid Framework console ID.
149-
# @return [Hash] There are two different hashes you might get:
150-
#
151-
# If the console ID is invalid, you will get a hash like the following:
152-
# * 'result' [String] A value that says 'failure'.
153-
# If the console ID is valid, you will get the following that indicates the action was successful.
154-
# * 'result' [String] A value that says 'success'.
150+
# @return [Hash] A hash indicating whether the action was successful or not. It contains:
151+
# * 'result' [String] A message that says 'success' if the console ID is valid (and successfully killed, otherwise 'failed')
155152
# @example Here's how you would use this from the client:
156153
# rpc.call('console.session_kill', 4)
157154
def rpc_session_kill(cid)
@@ -162,15 +159,11 @@ def rpc_session_kill(cid)
162159
end
163160

164161

165-
# Detaches a framework session.
162+
# Detaches a framework session that serves the same purpos as [CTRL]+[Z] to background an interactive session.
166163
#
167164
# @param [Fixnum] cid Framework console ID.
168-
# @return [Hash] There are two different hashes you might get:
169-
#
170-
# If the console ID is invalid, you will get a hash like the following:
171-
# * 'result' [String] A value that says 'failure'.
172-
# If the console ID is valid, you will get the following that indicates the action was successful.
173-
# * 'result' [String] A value that says 'success'.
165+
# @return [Hash] A hash indicating whether the action was successful or not. It contains:
166+
# * 'result' [String] A message that says 'success' if the console ID is valid (and successfully detached, otherwise 'failed')
174167
# @example Here's how you would use this from the client:
175168
# rpc.call('console.session_detach', 4)
176169
def rpc_session_detach(cid)

lib/msf/core/rpc/v10/rpc_core.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ def rpc_reload_modules
9898
end
9999

100100

101-
# Adds a new module path.
101+
# Adds a new local file system path (local to the server) as a module path. The module must be
102+
# accessible to the user running the Metasploit service, and contain a top-level directory for
103+
# each module type such as: exploits, nop, encoder, payloads, auxiliary, post. Also note that
104+
# this will not unload modules that were deleted from the file system that were previously loaded.
102105
#
103106
# @param [String] path The new path to load.
104107
# @return [Hash] Module stats that contain the following keys:

0 commit comments

Comments
 (0)