In June, threat actors exploited this vulnerability (CVE-2023-3519) as a Zero Day to drop a webshell on a critical infrastructure organization’s non-production environment NetScaler ADC appliance, according to an advisory released by the Cybersecurity and Infrastructure Security Agency (CISA).
The webshell enabled the attackers to perform discovery on the victim’s active directory (AD) and collect and exfiltrate AD data, according to the advisory. 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 on July 18.
CISA’s advisory provides tactics, techniques, and procedures (TTPs) and detection methods shared with CISA by the victim.
In July, a critical infrastructure organization reported 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 the actors exploited CVE-2023-3519 for which Citrix released a patch July 18.
CVE-2023-3519 is an unauthenticated RCE vulnerability affecting the following versions of NetScaler ADC and NetScaler Gateway:
- NetScaler ADC and NetScaler Gateway 13.1 before 13.1-49.13
- NetScaler ADC and NetScaler Gateway 13.0 before 13.0-91.13
- NetScaler ADC and NetScaler Gateway version 12.1, now end of life
- NetScaler ADC 13.1-FIPS before 13.1-37.159
- NetScaler ADC 12.1-FIPS before 12.1-65.36
- NetScaler ADC 12.1-NDcPP before 12.65.36
The affected appliance must end up configured as a Gateway (VPN virtual server, ICA Proxy, CVPN, RDP Proxy) or authentication, authorization, and auditing (AAA) virtual server for exploitation.
As part of their initial exploit chain, the threat actors uploaded a TGZ file containing a generic webshell, discovery script, and setuid binary on the ADC appliance and conducted SMB scanning on the subnet.
- The actors used the webshell for AD enumeration and to exfiltrate AD data. Specifically, the actors:
- Viewed NetScaler configuration files /flash/nsconfig/keys/updated/* and /nsconfig/ns.conf. These configuration files contain an encrypted password that can be decrypted by the key stored on the ADC appliance.
- Viewed the NetScaler decryption keys (to decrypt the AD credential from the configuration file).
- Used the decrypted AD credential to query the AD via ldapsearch. The actors queried for:
— Users (objectClass=user) (objectcategory=person)
— Computers (objectClass=computer)
— Groups (objectClass=group)
— Subnets (objectClass=subnet)
— Organizational Units (objectClass=organizationalUnit)
— Contacts (objectClass=contact)
— Partitions (objectClass=partition)
— Trusts (objectClass=trustedDomain) - Used the following command to encrypt discovery data collected via openssl in “tar ball”: 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.)
- Exfiltrated collected data by uploading as an image file to a web-accessible path [T1074]: 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:
- Execute a subnet-wide curl command to identify what was accessible from within the network as well as potential lateral movement targets
- Verified outbound network connectivity with a ping command (ping -c 1 google.com)
- Executed host commands for a subnet-wide DNS lookup
The actors also attempted to delete their artifacts. 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). 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 also ended up blocked by network-segmentation controls.
The actors implanted a second webshell on the victim 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 (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.
Click here for more on the cybersecurity advisory from CISA.

