Skip to content

Commit 16cdf1c

Browse files
committed
Add help text to cmd_add_data_service
1 parent 5058c2d commit 16cdf1c

File tree

1 file changed

+18
-0
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+18
-0
lines changed

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

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ def cmd_add_data_service(*args)
102102
protocol = "http"
103103
while (arg = args.shift)
104104
case arg
105+
when '--help'
106+
cmd_add_data_service_help
107+
return
105108
when '-h'
106109
host = args.shift
107110
when '-p'
@@ -112,12 +115,27 @@ def cmd_add_data_service(*args)
112115
end
113116
end
114117

118+
if host.nil? || port.nil?
119+
print_error "Host and port are required."
120+
return
121+
end
122+
115123
endpoint = "#{protocol}://#{host}:#{port}"
116124
remote_data_service = Metasploit::Framework::DataService::RemoteHTTPDataService.new(endpoint)
117125
data_service_manager = Metasploit::Framework::DataService::DataProxy.instance
118126
data_service_manager.register_data_service(remote_data_service)
119127
end
120128

129+
def cmd_add_data_service_help
130+
print_line "Usage: add_data_service [ options ] -h <host IP or FQDN> -p <host port>"
131+
print_line
132+
print_line "OPTIONS:"
133+
print_line " -h <IP/FQDN> The IP address or FQDN of the data service server."
134+
print_line " -p <port> The port the data service is listening on."
135+
print_line " -s Enable SSL. Required for HTTPS data services."
136+
print_line
137+
end
138+
121139
def cmd_test_data_service_host(*args)
122140
host = {}
123141
while (arg = args.shift)

0 commit comments

Comments
 (0)