Modify System Image
This detection identifies adversary attempts to modify the operating system image of embedded network devices such as routers, switches, and firewalls. Adversaries may replace or patch the monolithic OS binary to weaken defenses, implant backdoors, or add new capabilities. Detection focuses on unauthorized TFTP/SCP image transfers to network devices, unexpected system image version changes logged via syslog, privilege escalation events on device management interfaces, and anomalous file copy operations on network management hosts. Both live in-memory modifications and persistent storage-based changes (applied on next boot) are targeted.
let NetworkDeviceImageKeywords = dynamic(["copy tftp", "copy ftp", "copy scp", "copy flash", "copy bootflash", "archive tar", "boot system flash", "boot system tftp", "verify /md5", "upgrade fpd", "install add file", "install activate", "request system software", "issu changeversion", "image upgrade"]);
let SyslogImageEvents = Syslog
| where Facility == "local7" or Facility == "local6" or SyslogMessage has_any ("FILESYS", "SYS-6-BOOTTIME", "SYS-5-RELOAD", "IMAGE", "INSTALL", "IOS_RESILIENCE")
| where SyslogMessage has_any ("copy", "upgrade", "install", "boot", "flash", "tftp", "verify", "archive")
| extend DeviceVendor = extract(@"^(\S+)", 1, Computer)
| project TimeGenerated, Computer, HostName, HostIP, SyslogMessage, ProcessName, Severity, Facility;
let CefImageEvents = CommonSecurityLog
| where DeviceVendor in~ ("Cisco", "Juniper", "Palo Alto Networks", "Fortinet", "F5", "Arista", "HPE", "Huawei")
| where Activity has_any ("image", "upgrade", "install", "copy", "boot", "firmware", "flash", "reload")
or Message has_any (NetworkDeviceImageKeywords)
| project TimeGenerated, DeviceVendor, DeviceProduct, DeviceVersion, Activity, Message, SourceIP, DestinationIP, DestinationPort, SourceUserName, ExternalID;
let TftpTransfers = DeviceNetworkEvents
| where RemotePort == 69 or InitiatingProcessCommandLine has "tftp"
| where InitiatingProcessCommandLine has_any (".bin", ".img", ".tar", ".pkg", ".spa", ".vm", ".swx")
| extend SuspiciousImageTransfer = iff(InitiatingProcessCommandLine has_any ("tftp", "scp", "ftp") and InitiatingProcessCommandLine has_any (".bin", ".img", ".tar", ".pkg"), true, false)
| project TimeGenerated, DeviceName, InitiatingProcessCommandLine, InitiatingProcessFileName, RemoteIP, RemotePort, SuspiciousImageTransfer, InitiatingProcessAccountName;
let ManagementHostActivity = DeviceProcessEvents
| where ProcessCommandLine has_any ("copy tftp:", "copy scp:", "copy ftp:", "send-image", "tftpd", "cisco-image", "ios-image", "nxos", "junos-upgrade")
or FileName has_any ("tftp", "tftpd", "tftpboot")
| project TimeGenerated, DeviceName, AccountName, FileName, ProcessCommandLine, ParentProcessName;
union kind=outer isfuzzy=true SyslogImageEvents, CefImageEvents, TftpTransfers, ManagementHostActivity
| extend AlertSeverity = case(
isnotempty(SuspiciousImageTransfer) and SuspiciousImageTransfer == true, "High",
SyslogMessage has_any ("SYS-5-RELOAD", "SYS-6-BOOTTIME", "IOS_RESILIENCE-3"), "High",
Activity has_any ("firmware", "upgrade", "install") or Message has_any ("boot system", "install add"), "Medium",
"Low"
)
| where AlertSeverity != "Low"
| sort by TimeGenerated desc Data Sources
Required Tables
False Positives
- Authorized network engineers performing scheduled firmware upgrades during maintenance windows via TFTP/SCP
- Network management platforms (Cisco Prime, SolarWinds, Ansible AWX) performing automated image distribution and version compliance enforcement
- Legitimate disaster recovery operations restoring a known-good baseline image after hardware failure
- Vendor-assisted software update procedures conducted by authorized third-party contractors with change tickets
References (8)
- https://attack.mitre.org/techniques/T1601/
- https://attack.mitre.org/techniques/T1601/001/
- https://attack.mitre.org/techniques/T1601/002/
- https://blogs.cisco.com/security/synful-knock
- https://www.fireeye.com/blog/threat-research/2015/09/synful_knock_-_acis.html
- https://www.cisco.com/c/en/us/support/docs/ios-nx-os-software/ios-software-releases-121-mainline/12839-ios-integrity.html
- https://www.cisa.gov/sites/default/files/publications/Network_Device_Integrity_NDI_Methodology.pdf
- https://www.cisco.com/c/en/us/td/docs/ios-xml/ios/sec_usr_aaa/configuration/xe-16/sec-usr-aaa-xe-16-book/sec-usr-aaa-xe-16-book_chapter_01.html
Unlock Pro Content
Get the full detection package for T1601 including response playbook, investigation guide, and atomic red team tests.