Network Device CLI
Adversaries may abuse scripting or built-in command line interpreters (CLI) on network devices to execute malicious commands and payloads. The CLI is the primary means through which users and administrators interact with network devices to view system information, modify device operations, or perform diagnostic and administrative functions. CLIs typically contain various permission levels. Adversaries can use the network CLI to change how devices behave, manipulate traffic flows to intercept data, modify startup configuration, load malicious firmware, or disable security features. The ArcaneDoor campaign (Line Dancer malware) demonstrated sophisticated CLI abuse on Cisco ASA devices.
let SuspiciousCommands = dynamic([
"copy running-config", "copy startup-config",
"configure terminal", "config t",
"no logging", "no ip access-list",
"ip route", "access-list permit any any",
"snmp-server community", "enable secret",
"boot system", "upgrade",
"debug", "undebug all",
"crypto key generate", "username privilege 15",
"line vty", "transport input all",
"no service password-encryption",
"archive download-sw", "copy tftp: flash:"
]);
Syslog
| where TimeGenerated > ago(24h)
| where Facility == "local7" or Facility == "local6" or ProcessName has_any ("cisco", "ios", "nxos", "junos")
| where SyslogMessage has_any (SuspiciousCommands)
| extend ConfigChange = SyslogMessage has_any ("configure terminal", "config t", "copy running-config")
| extend SecurityDisable = SyslogMessage has_any ("no logging", "no ip access-list", "no service password-encryption")
| extend FirmwareChange = SyslogMessage has_any ("boot system", "archive download-sw", "copy tftp: flash:")
| extend PrivEsc = SyslogMessage has_any ("username privilege 15", "enable secret")
| project TimeGenerated, Computer, Facility, SyslogMessage,
ConfigChange, SecurityDisable, FirmwareChange, PrivEsc
| sort by TimeGenerated desc Data Sources
Required Tables
False Positives
- Network engineers performing scheduled maintenance windows with configuration changes
- Automated network management tools (Ansible, NAPALM, Oxidized) making approved configuration backups
- Firmware upgrades during planned change windows
References (5)
- https://attack.mitre.org/techniques/T1059/008/
- https://blogs.cisco.com/security/evolution-of-attacks-on-cisco-ios-devices
- https://tools.cisco.com/security/center/resources/integrity_assurance.html#23
- https://blog.talosintelligence.com/arcanedoor-new-espionage-focused-campaign-found-targeting-perimeter-network-devices/
- https://www.mandiant.com/resources/blog/synful-knock-cisco
Unlock Pro Content
Get the full detection package for T1059.008 including response playbook, investigation guide, and atomic red team tests.