The Cybersecurity and Infrastructure Security Agency (CISA) is releasing this Cybersecurity Advisory to warn network defenders about exploitation of CVE-2023-3519, an unauthenticated remote code execution (RCE) vulnerability affecting NetScaler (formerly Citrix) Application Delivery Controller (ADC) and NetScaler Gateway. In June 2023, threat actors exploited this vulnerability as a zero-day to drop a webshell on a critical infrastructure organization's non-production environment NetScaler ADC appliance. The webshell enabled the actors to perform discovery on the victim's active directory (AD) and collect and exfiltrate AD data. The actors attempted to move laterally to a domain controller but network-segmentation controls for the appliance blocked movement.
The victim organization identified the compromise and reported the activity to CISA and Citrix. Citrix released a patch for this vulnerability on July 18, 2023.
This advisory provides tactics, techniques, and procedures (TTPs) and detection methods shared with CISA by the victim. CISA encourages critical infrastructure organizations to use the detection guidance included in this advisory for help with determining system compromise. If potential compromise is detected, organizations should apply the incident response recommendations provided in this CSA. If no compromise is detected, organizations should immediately apply patches provided by Citrix.
Download the PDF version of this report:
Note: This advisory uses the MITRE ATT&CK for Enterprise framework, version 13. See the MITRE ATT&CK Tactics and Techniques section for a table of the threat actors' activity mapped to MITRE ATT&CK® tactics and techniques. For assistance with mapping malicious cyber activity to the MITRE ATT&CK framework, see CISA and MITRE ATT&CK's Best Practices for MITRE ATT&CK Mapping and CISA's Decider Tool.
In July 2023, a critical infrastructure organization reported to CISA that threat actors may have exploited a zero-day vulnerability in NetScaler ADC to implant a webshell on their non-production NetScaler ADC appliance. Citrix confirmed that the actors exploited a zero-day vulnerability: CVE-2023-3519. Citrix released a patch on July 18, 2023.[1]
CVE-2023-3519 is an unauthenticated RCE vulnerability affecting the following versions of NetScaler ADC and NetScaler Gateway:[1]
The affected appliance must be configured as a Gateway (VPN virtual server, ICA Proxy, CVPN, RDP Proxy) or authentication, authorization, and auditing (AAA) virtual server for exploitation.[1]
CISA added CVE-2023-3519 to its Known Exploited Vulnerabilities Catalog on July 19, 2023.
As part of their initial exploit chain [T1190], the threat actors uploaded a TGZ file [T1105] containing a generic webshell [T1505.003], discovery script [TA0007], and setuid
binary [T1548.001] on the ADC appliance and conducted SMB scanning on the subnet [T1046].
The actors used the webshell for AD enumeration [T1016] and to exfiltrate AD data [TA0010]. Specifically, the actors:
/flash/nsconfig/keys/updated/*
and /nsconfig/ns.conf
[T1005]. Note: These configuration files contain an encrypted password that can be decrypted by the key stored on the ADC appliance [T1552.001].ldapsearch
. The actors queried for:objectClass=user
) (objectcategory=person
) [T1033]objectClass=computer
) [T1018]objectClass=group
) [T1069.002]objectClass=subnet
)objectClass=organizationalUnit
)objectClass=contact
)objectClass=partition
)objectClass=trustedDomain
) [T1482]tar -czvf - /var/tmp/all.txt | openssl des3 -salt -k <> -out /var/tmp/test.tar.gz
. (A "tar ball" is a compressed and zipped file used by threat actors for collection and exfiltration.)cp /var/tmp/test.tar.gz /netscaler/ns_gui/vpn/medialogininit.png
.The actors' other discovery activities were unsuccessful due to the critical infrastructure organization's deployment of their NetScaler ADC appliance in a segmented environment. The actors attempted to:
ping -c 1 google.com
) [T1016.001].The actors also attempted to delete their artifacts [TA0005]. The actors deleted the authorization configuration file (/etc/auth.conf
)—likely to prevent configured users (e.g., admin) from logging in remotely (e.g., CLI) [T1531]. To regain access to the ADC appliance, the organization would normally reboot into single use mode, which may have deleted artifacts from the device; however, the victim had an SSH key readily available that allowed them into the appliance without rebooting it.
The actors' post-exploitation lateral movement attempts were also blocked by network-segmentation controls. The actors implanted a second webshell on the victim that they later removed. This was likely a PHP shell with proxying capability. The actors likely used this to attempt proxying SMB traffic to the DC [T1090.001] (the victim observed SMB connections where the actors attempted to use the previously decrypted AD credential to authenticate with the DC from the ADC via a virtual machine). Firewall and account restrictions (only certain internal accounts could authenticate to the DC) blocked this activity.
See Table 1–Table 9 for all referenced threat actor tactics and techniques in this advisory.
Technique Title | ID | Use |
---|---|---|
Exploit Public-Facing Application | The threat actors exploited CVE-2023-3519 to implant a webshell on the organization's NetScaler ADC appliance. |
Technique Title | ID | Use |
---|---|---|
Server Software Component: Web Shell | The threat actors implanted a generic webshell on the organization's NetScaler ADC appliance. |
Technique Title | ID | Use |
---|---|---|
Abuse Elevation Control Mechanism: Setuid and Setgid | As part of their initial exploit chain uploaded a TGZ file contain a |
Technique Title | ID | Use |
---|---|---|
Masquerading: Masquerade File Type | The threat actors exfiltrated data by uploading it as an image file to a web-accessible path. |
Technique Title | ID | Use |
---|---|---|
Unsecured Credentials: Credentials In Files | The threat actors obtained encrypted passwords from NetScaler ADC configuration files, and the decryption key was stored on the ADC appliance. | |
Unsecured Credentials: Private Keys | The threat actors obtained decryption keys to decrypt the AD credential obtained from the NetScaler ADC configuration files. |
Technique Title | ID | Use |
---|---|---|
Domain Trust Discovery | The threat actors queried the AD for trusts. | |
Permission Groups Discovery: Domain Groups | The threat actors quired the AD for groups. | |
Remote System Discovery | The threat actors queried the AD for computers. The threat actors attempted to execute a subnet-wide curl command to identify what was accessible from within the network as well as potential lateral movement targets. Network-segmentation controls prevented this activity. | |
System Network Configuration Discovery | The actors used a webshell for AD enumeration. | |
System Network Configuration Discovery: Internet Connection Discovery | The threat actors attempted to verify outbound network connectivity with a ping command and executed host commands for a subnet-wide DNS lookup. Network-segmentation controls prevented this activity. | |
Network Service Discovery | The threat actors conducted SMB scanning on the organization's subnet. | |
Account Discovery: Domain Account | The threat actors queried the AD for users. |
Technique Title | ID | Use |
---|---|---|
Archive Collected Data: Archive via Utility | The threat actors encrypted discovery data collected via openssl in "tar ball." | |
Data from Local System | The threat actors viewed NetScaler ADC configuration files | |
Data Staged | The threat actors uploaded data as an image file to a web-accessible path: |
Technique Title | ID | Use |
---|---|---|
Ingress Tool Transfer | The threat actors exploited CVE-2023-3519 to upload a TGZ file containing a generic webshell, discovery script, and setuid binary on the ADC appliance. | |
Proxy: Internal Proxy | The actors likely used a PHP shell with proxying capability to attempt proxying SMB traffic to the DC (the traffic was blocked by a firewall and account restrictions). |
Technique Title | ID | Use |
---|---|---|
Account Access Removal | The threat actors deleted the authorization configuration file (/etc/auth.conf)—likely to prevent configured users from logging in remotely (e.g., CLI). |
Run the following victim-created checks on the ADC shell interface to check for signs of compromise:
-newermt
parameter with the date that corresponds to your last installation:find /netscaler/ns_gui/ -type f -name *.php -newermt [YYYYMMDD] -exec ls -l {} \;
find /var/vpn/ -type f -newermt [YYYYMMDD] -exec ls -l {} \;
find /var/netscaler/logon/ -type f -newermt [YYYYMMDD] -exec ls -l {} \;
find /var/python/ -type f -newermt [YYYYMMDD] -exec ls -l {} \;
zgrep '\.sh' /var/log/httperror.log*
zgrep '\.php' /var/log/httperror.log*
post-ex
commands, for example:grep '/flash/nsconfig/keys' /var/log/sh.log*
setuid
binaries dropped:find /var -perm -4000 -user root -not -path "/var/nslog/*" -newermt [YYYYMMDD] -exec ls -l {} \;
4625
where the failure reason is "User not allowed to logon at this computer."sh.log*
, bash.log*
) for traces of potential malicious activity (some example keywords for grep
are provided below): database.php
ns_gui/vpn
/flash/nsconfig/keys/updated
LDAPTLS_REQCERT
ldapsearch
openssl + salt
httpaccess-vpn.log*
) for 200 successful access of unknown web resources.If compromise is detected, organizations should:
CISA recommends all organizations:
In addition to applying mitigations, CISA recommends exercising, testing, and validating your organization's security program against the threat behaviors mapped to the MITRE ATT&CK for Enterprise framework in this advisory. CISA recommends testing your existing security controls inventory to assess how they perform against the ATT&CK techniques described in this advisory.
To get started:
CISA recommends continually testing your security program, at scale, in a production environment to ensure optimal performance against the MITRE ATT&CK techniques identified in this advisory.
[1] Citrix Security Bulletin CTX561482: Citrix ADC and Citrix Gateway Security Bulletin for CVE-2023-3519, CVE-2023-3466, CVE-2023-3467
July 20, 2023: Initial version.
July 24, 2023: Updated affected NetScaler ADC 12.1-FIPS and NetScaler ADC 12.1-NDcPP version numbers. Updated Step 3 in Detection Methods to use zgrep
instead of grep
.