File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
lib/msf/ui/console/command_dispatcher Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -102,6 +102,9 @@ def cmd_add_data_service(*args)
102
102
protocol = "http"
103
103
while ( arg = args . shift )
104
104
case arg
105
+ when '--help'
106
+ cmd_add_data_service_help
107
+ return
105
108
when '-h'
106
109
host = args . shift
107
110
when '-p'
@@ -112,12 +115,27 @@ def cmd_add_data_service(*args)
112
115
end
113
116
end
114
117
118
+ if host . nil? || port . nil?
119
+ print_error "Host and port are required."
120
+ return
121
+ end
122
+
115
123
endpoint = "#{ protocol } ://#{ host } :#{ port } "
116
124
remote_data_service = Metasploit ::Framework ::DataService ::RemoteHTTPDataService . new ( endpoint )
117
125
data_service_manager = Metasploit ::Framework ::DataService ::DataProxy . instance
118
126
data_service_manager . register_data_service ( remote_data_service )
119
127
end
120
128
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
+
121
139
def cmd_test_data_service_host ( *args )
122
140
host = { }
123
141
while ( arg = args . shift )
You can’t perform that action at this time.
0 commit comments