Cisco IOS XE BADCANDY Web Shell Implant

CVE-2023-20198 Remote full system compromise Credential theft
Overview
BADCANDY is a malicious Lua-based web shell implant deployed by threat actors on vulnerable Cisco IOS XE devices. Attackers exploit the critical zero-day vulnerability CVE-2023-20198 in the web UI, leading to complete remote compromise of network infrastructure, including routers and switches widely used in enterprise and telecom environments.
Technical Details
| Attribute | Details |
|---|---|
| CVE ID | CVE-2023-20198 |
| Vulnerability Type | Unauthenticated Privilege Escalation, Web Shell Implant |
| Attack Vector | Remote (web UI) |
| Authentication | None required |
| Complexity | Low |
| User Interaction | Not required |
Exploit Method
- Remote, unauthenticated creation of level 15 (highest privilege) accounts via the web interface
- BADCANDY is a small, Lua-scripted web shell, granting attackers remote code execution and configuration control at the system or IOS level
- Not persistent (removed on reboot), but attackers commonly create privileged accounts or alternate implants for continued access
- After exploitation, a non-persistent patch is sometimes applied to mask vulnerability, making detection harder
Attack Scenario
- Initial Access: Attacker scans for unpatched Cisco IOS XE devices exposed to the internet
- Exploitation: Using CVE-2023-20198, attackers create a privileged account via the web UI without authentication
- Payload Delivery: Attacker installs BADCANDY web shell using the new admin account
- Command & Control: BADCANDY implant provides a hidden endpoint for attackers to run arbitrary commands, create more backdoors, or extract credentials
- Concealment & Re-exploitation: Non-persistent masking patch may be applied. If implant is removed or device rebooted, attacker can reinfect at will if device remains unpatched
- Persistence: Privileged accounts or custom tunnels can persist after rebooting, even though BADCANDY itself does not
Impact Assessment
- Unrestricted configuration changes
- Creation of persistent privileged accounts
- Network traffic interception or redirection
- Credential theft (administration and network credentials)
- Extraction of sensitive configuration data
- Device and network disruption
- Repeated reinfection if unpatched
- Large-scale exploitation (over 400 devices in Australia alone as of October 2025)
- Active campaigns targeting telecom, government, and infrastructure sectors
- Sector-wide risk for any organization using vulnerable Cisco IOS XE devices
Mitigation Strategies
Patch and Remediation
- Patch ASAP: Apply Cisco’s security update for CVE-2023-20198 and related vulnerabilities
- Reboot: Cleans BADCANDY but not attacker-created accounts or alternate backdoors
- Configuration audit: Remove unexpected privileged user accounts (e.g.,
cisco_tac_admin,cisco_support,cisco_sys_manager) and unknown tunnel interfaces
Access Controls
- Restrict web UI: Disable local HTTP server unless absolutely needed; limit device internet exposure
- Review logs: Inspect TACACS+ AAA command accounting logs and verify configuration/authentication changes
Technical Recommendations
Immediate Actions
- Patch all exposed Cisco IOS XE devices
- Reboot devices to remove non-persistent implants
- Audit configuration for unauthorized accounts and tunnels
- Restrict or disable web UI access
- Review logs for suspicious activity
Short-term Measures
- Network segmentation: Isolate management interfaces
- Monitor for new privileged accounts
- Incident response: Prepare for rapid remediation if compromise is detected
Long-term Strategy
- Ongoing patch management
- Security architecture review
- Staff training on device security