T1059.008

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.

Microsoft Sentinel / Defender
kusto
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
high severity medium confidence

Data Sources

Network Traffic: Network Connection Creation Application Log: Application Log Content Syslog

Required Tables

Syslog

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

Unlock Pro Content

Get the full detection package for T1059.008 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections