China-linked APT Velvet Ant exploited zero-day to compromise Cisco switches

Pierluigi Paganini August 23, 2024

China-linked APT group Velvet Ant exploited a recently disclosed zero-day in Cisco switches to take over the network appliance.

Researchers at cybersecurity firm Sygnia reported that the China-linked APT group Velvet Ant has exploited the recently disclosed zero-day CVE-2024-20399 in Cisco switches to take over the network devices.

In July 2024, Cisco addressed the NX-OS zero-day CVE-2024-20399 (CVSS score of 6.0) that China-linked group Velvet Ant exploited to deploy previously unknown malware as root on vulnerable switches.

The flaw resides in the CLI of Cisco NX-OS Software, an authenticated, local attacker can exploit the flaw to execute arbitrary commands as root on the underlying operating system of an affected device.

“This vulnerability is due to insufficient validation of arguments that are passed to specific configuration CLI commands. An attacker could exploit this vulnerability by including crafted input as the argument of an affected configuration CLI command.” reads the advisory published by Cisco. “A successful exploit could allow the attacker to execute arbitrary commands on the underlying operating system with the privileges of root.”

The IT giant pointed out that only attackers with Administrator credentials can successfully exploit this vulnerability on a Cisco NX-OS device.

In April 2024, researchers reported to the Cisco Product Security Incident Response Team (PSIRT) that the issue was actively exploited in the wild.

Cybersecurity firm Sygnia observed the attacks on April 2024 and reported them to Cisco.

“Sygnia identified that CVE-2024-20399 was exploited in the wild by a China-nexus threat group as a ‘zero-day’ and shared the details of the vulnerability with Cisco. By exploiting this vulnerability, a threat group – dubbed ‘Velvet Ant’ – successfully executed commands on the underlying operating system of Cisco Nexus devices.” reads the report published by Sygnia. “This exploitation led to the execution of a previously unknown custom malware that allowed the threat group to remotely connect to compromised Cisco Nexus devices, upload additional files, and execute code on the devices.“

The vulnerability impacts the following devices:

  • MDS 9000 Series Multilayer Switches (CSCwj97007)
  • Nexus 3000 Series Switches (CSCwj97009)
  • Nexus 5500 Platform Switches (CSCwj97011)
  • Nexus 5600 Platform Switches (CSCwj97011)
  • Nexus 6000 Series Switches (CSCwj97011)
  • Nexus 7000 Series Switches (CSCwj94682) *
  • Nexus 9000 Series Switches in standalone NX-OS mode (CSCwj97009)

Cisco recommends customers monitor the use of credentials for the administrative users network-admin and vdc-admin.

Cisco provides the Cisco Software Checker to help customers determine if their devices are vulnerable to this flaw.

The U.S. Cybersecurity and Infrastructure Security Agency (CISA) added the flaw to its Known Exploited Vulnerabilities (KEV) catalog.

Sygnia researchers explained that attackers exploited the zero-day exploit using valid administrator credentials to escape the NX-OS command line interface (CLI) on a switch and execute arbitrary commands on the underlying Linux operating system. Once exploited this vulnerability, Velvet Ant deployed custom malware that operates on the underlying OS and remains undetected by typical security tools.

“The zero-day exploit allows an attacker with valid administrator credentials to the Switch management console to escape the NX-OS command line interface (CLI) and execute arbitrary commands on the Linux underlying operating system. Following the exploitation, ‘Velvet Ant’ deploy tailored malware, which runs on the underlying OS and is invisible to common security tools.” reads a new report published by Sygnia.

“In recently observed attacks , Velvet Ant transitioned to operating from Cisco Nexus switch appliances and exploited a zero-day vulnerability, in order to access the underlying Linux layer of the switch to install their malware – named ‘VELVETSHELL’ by Sygnia.”

The switch appliances prevent users from accessing the underlying operating system, making it nearly impossible to scan for indicators of compromise. This shift towards using network appliances highlights the group’s sophistication and determination to maintain persistence in compromised environments for ongoing espionage activities.

The researchers discovered several suspicious Base64-encoded commands in the affected systems’ accounting logs. These commands were executed with valid administrative credentials as part of an exploit that leveraged a command injection vulnerability. The threat actor used this technique to run a malicious script, which loaded and executed a backdoor binary, effectively bypassing standard security mechanisms.

Velvet Ant Cisco zero-day

Sygnia managed to reconstruct the VELVETSHELL malware from device memory despite the threat actor’s efforts to delete it. The malware is a hybrid of two open-source tools, TinyShell and 3proxy, combined into a single binary. VELVETSHELL supports multiple capabilities, including executing arbitrary commands, downloading and uploading files, and establishing network traffic tunnels. These functionalities allowed the threat actor to maintain persistent access and control over the compromised system, facilitating data exfiltration and ongoing espionage activities.

“Over the years of espionage activities ‘Velvet Ant’ increased their sophistication, using evolving tactics to continue their cyber operations in a victim network – from operating on ordinary endpoints, shifting operations to legacy servers and finally moving towards network appliances and using 0-days.” concludes the report that includes Indicators of Compromise (IoCs). “The determination, adaptability and persistence of such threat actors highlights the sensitivity of a holistic response plan to not only contain and mitigate the threat but also monitor the network for additional attempts to exploit the network.”

Pierluigi Paganini

Follow me on Twitter: @securityaffairs and Facebook and Mastodon

(SecurityAffairs – hacking, CISA)



you might also like

leave a comment