-
Notifications
You must be signed in to change notification settings - Fork 14k
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
Ivanti Connect Secure - Authenticated RCE via OpenSSL CRLF Injection (CVE-2024-37404) #19595
base: master
Are you sure you want to change the base?
Ivanti Connect Secure - Authenticated RCE via OpenSSL CRLF Injection (CVE-2024-37404) #19595
Conversation
Valid administrative credentials are required. A non-administrative | ||
user is also required and can be created using the administrative | ||
account, if needed. |
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.
I think it would be neat if the exploit could create/destroy the non-administrative user if none is specified.
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.
I first considered doing it but finally changed my mind. The user creation steps can be very different from on installation to another. Connect Secure can use multiple authentication servers and finding the right one where to create a user can be tricky.
I found that it would be safer to let the operator create the user himself and avoid breaking something in the administrative interface with a sketchy automation.
I would be more confident if I had access to multiple versions of the product to test, but I could only test against one version (22.3R1).
'Notes' => { | ||
'Stability' => [CRASH_SAFE], | ||
'Reliability' => [REPEATABLE_SESSION], | ||
'SideEffects' => [ARTIFACTS_ON_DISK, IOC_IN_LOGS] |
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.
Could we add a new side effect here? e.g.
'SideEffects' => [ARTIFACTS_ON_DISK, IOC_IN_LOGS] | |
'SideEffects' => [ARTIFACTS_ON_DISK, IOC_IN_LOGS, ACCOUNT_LOGOUT] |
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.
I added a new side effect in f5ac33e. Thanks!
return CheckCode::Detected("Version number not found: #{e}") | ||
end | ||
|
||
unless version < Rex::Version.new('22.3R2') |
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.
unless version < Rex::Version.new('22.3R2') | |
unless version < Rex::Version.new('22.7R2.2') |
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.
Addressed in f5ac33e
begin | ||
csrf_token = delete_log_file | ||
rescue IvantiError => e | ||
print_warning("Unable to cleanup properly, this will need to be done manually: #{e}") |
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.
Could we print out the path of the uploaded log file, so the user knows what to delete?
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.
Absolutely, good call! Addressed in f5ac33e.
This module exploits a CRLF injection vulnerability in Ivanti Connect Secure to achieve remote code execution (CVE-2024-37404). Versions prior to 22.7R2.1 and 22.7R2.2 are vulnerable. Note that Ivanti Policy Secure versions prior to 22.7R1.1 are also vulnerable but this module doesn't support this software.
Valid administrative credentials are required. A non-administrative user is also required and can be created using the administrative account, if needed.
Finally, the
Client Log Upload
feature needs to be enabled. This can also be done using the administrative interface (see the Installation Steps section below), if it is not enabled already.Process Overview
First, the module will log into the administrative interface and check if the version is vulnerable. Then, it will connect to the user interface using non-privileged credentials and upload a log file archive containing the payload. This file is stored as a known path on the server, which can be retrieved from the administrative interface. Then, it leverages the CRLF vulnerability by creating a Certificate Signing Request and passing a specially crafted OpenSSL configuration. This configuration instructs OpenSSL to use a custom cryptographic engine, which points to the log file path (our payload). The payload is immediately executed, giving RCE as the root user on the appliance. This has been successfully tested against Ivanti Connect Secure version 22.3R1 (build 1647).
This has been successfully tested against Ivanti Connect Secure version 22.3R1 (build 1647).
Installation Steps
Get an Ivanti Security Appliance (ISA) or a Virtual Appliances (ISA-V Series) with a vulnerable Ivanti Connect Secure installed.
Note that it is not possible to download a trial version of a Virtual Appliance unless you contact sales and request a demo.
Log into to the admin interface (https://admin) to proceed with the following requirements:
Create a normal user
Authentication
menu, selectAuth. Servers
.System Local
Authentication/Authorization Servers
or any server with the typeLocal Authentication
. Don't select theAdministrators
server since we need a non-administrative account.Users
tab and thenNew
.Save Changes
.Enable Client Log
Users
>User Roles
and click on theUsers
role.General
>Session Options
.Enable Upload Logs
under theUpload logs
section.Save Changes
.Verification Steps
use linux/http/ivanti_connect_secure_rce_cve_2024_37404
run verbose=true lhost=<local host> rhosts=<remote host> admin_username=<admin username> admin_password=<admin password> username=<normal user> password=<user password>
System
>Log/Monitoring
Scenarios
Ivanti Connect Secure version 22.3R1 (build 1647)