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.
What is T1601 Modify System Image?
Modify System Image (T1601) maps to the Defense Evasion tactic — the adversary is trying to avoid being detected in MITRE ATT&CK.
This page provides production-ready detection logic for Modify System Image, covering the data sources and telemetry it touches: Microsoft Sentinel Syslog, Microsoft Defender for Endpoint, Common Event Format (CEF) Connector. The queries below are rated high severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1601 Modify System Image
- Canonical reference
- https://attack.mitre.org/techniques/T1601/
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 Detects network device OS image modification attempts by correlating syslog messages from network infrastructure (Cisco IOS/NX-OS, Juniper JunOS, etc.) indicating image copy/upgrade/install operations, TFTP transfers of binary image files from management hosts, and CEF-formatted logs from security devices reporting firmware or image changes. Covers both in-memory live modifications and storage-based changes queued for next boot.
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
Sigma rule & cross-platform mapping
The detection logic for Modify System Image (T1601) above is provided in a vendor-neutral
form so you can deploy it on any SIEM. The same logic is shipped here as native
KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the
following logsource:
logsource:
category: process_creation
product: windows Browse the community-maintained Sigma rules for this technique:
Platform-specific guides for T1601
References (7)
- 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
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Simulate Unauthorized IOS Image Copy via TFTP on Management Host
Expected signal: DeviceNetworkEvents: UDP port 69 connection attempt to target IP. DeviceProcessEvents: atftp process with command line containing .bin filename. Syslog: copy tftp message.
- Test 2Inject Cisco IOS System Image Modification Syslog Messages
Expected signal: Syslog table in Microsoft Sentinel (or Splunk syslog index) should receive entries with FILESYS, SYS-5-RELOAD, and SYS-6-BOOTTIME facility/message patterns from ROUTER-01.
- Test 3Network Device Image Downgrade Simulation via SNMP Write
Expected signal: CommonSecurityLog or Syslog: SNMP write attempts to network device. Syslog: MGMTBOOTERROR and downgrade notification messages. DeviceNetworkEvents: SNMP (UDP 161/162) traffic to test device.
Response Playbook
Triage
- Step 1: Identify the exact network device(s) involved — extract hostname, management IP, device type, and OS version from syslog source fields. Cross-reference against CMDB to confirm asset ownership, criticality tier, and authorized management IPs.
- Step 2: Determine the image operation type — distinguish between a live in-memory patch (rare, requires kernel exploit level access), a storage copy replacing the boot image file, a boot system command change (deferred to next reload), or an install activate operation. Review the raw syslog messages for exact IOS/NX-OS facility codes (FILESYS, SYS, IOS_RESILIENCE).
- Step 3: Correlate with change management — query the ITSM system (ServiceNow, Jira) for approved change requests covering this device and timeframe. If a matching approved change window exists, verify the executing engineer's identity via TACACS+/RADIUS AAA logs and compare the source IP of the TFTP server against the authorized management network.
- Step 4: Check AAA authentication logs — pull TACACS+ or RADIUS logs for the device during the alert window. Identify which account authenticated, from which source IP, and whether privilege level 15 (enable mode) was obtained. Look for authentication failures preceding a success (brute force) or authentication from unusual source IPs.
- Step 5: Inspect the image file itself — if a new image was transferred, obtain a copy from the TFTP server or device flash. Compute MD5/SHA256 hashes and compare against Cisco/Juniper/vendor published golden image hashes for that version. Any mismatch is a critical indicator of a patched system image (T1601.001).
- Step 6: Review for downgrade to vulnerable version — if the image version changed, determine whether the new version is older than the current version (T1601.002). Cross-reference the new version against PSIRT advisories for known CVEs that may have motivated the downgrade. Check for CVE-2023-20198 (IOS XE web UI), CVE-2022-20821, or other known exploitable vulnerabilities in the target version.
- Step 7: Examine timing and context — determine if a reload occurred after the image modification. Check device uptime via SNMP polling history. A sudden uptime reset concurrent with an image copy operation strongly suggests the change was activated. Review NetFlow or traffic anomalies before and after the event for C2 beacon patterns that may indicate a compromised image with an implant.
Containment
- Immediately block management access to the affected device by restricting the ACL on the management VRF/VLAN to known-good management IPs only, or shutting management interfaces if the device is confirmed compromised.
- If compromise is confirmed, remove the device from production traffic by redistributing routing around it or failing over to redundant paths before taking it offline for forensics — abrupt removal may cause outages.
- Disable or lock the account used in the unauthorized access via TACACS+/RADIUS if credential compromise is suspected. Force password rotation for all accounts that have authenticated to network devices in the past 30 days if shared credentials are in use.
- If a TFTP server was involved in transferring the malicious image, isolate that server immediately — it may be a lateral pivot point or contain additional malicious images intended for other devices.
- Preserve device state before any remediation: run 'show version', 'show flash', 'verify /md5 flash:', 'show running-config', 'show startup-config' and capture all output. Export logging buffer contents. If feasible, take a memory forensics snapshot before reboot.
Evidence Collection
- Collect full TACACS+/RADIUS authentication logs for the device covering 72 hours before the alert — include all authentication attempts, privilege escalations, and command authorization records.
- Export all syslog messages from the affected device for the past 7 days. For Cisco IOS/NX-OS, run 'show logging' and capture to a secure collection host.
- Capture TFTP server access logs showing all file transfer requests (source IP, timestamp, filename, transfer result). Preserve the actual image files transferred — do not delete even if confirmed malicious.
- Run SNMP polling to collect: ifTable (interface state history), sysUpTime (uptime reset timestamps), entPhysicalTable (hardware inventory), and software version OIDs (cisco-flash-mib, ENTITY-MIB) to document pre/post state.
- If the device supports it, collect 'show platform integrity' output (Cisco IOS XE 16.x+) which reports boot integrity measurements and hash of loaded image. This is the definitive indicator for T1601.001.
- Capture NetFlow/IPFIX records showing traffic to/from the device's management interfaces over the past 30 days. Look for unexpected outbound connections on unusual ports that may indicate an implanted backdoor or SYNful Knock style persistence.
Escalation Criteria
- ! Escalate immediately to CISO and IR team if image hash does not match vendor-published golden image hash — this indicates a patched/trojanized image (T1601.001) and constitutes a critical network infrastructure compromise.
- ! Escalate if the device is a perimeter firewall, core router, or VPN concentrator handling sensitive traffic — the blast radius of a compromised network OS image on critical infrastructure requires executive notification.
- ! Escalate if multiple network devices show image modification activity within the same window — coordinated modification of multiple devices suggests a sophisticated, persistent threat actor with prior network access.
- ! Escalate if no change ticket exists and no authorized engineer can be identified for the operation — unattributed changes to network device images are always high-severity incidents requiring full IR engagement.
- ! Escalate if the device has been running a modified image for an extended period (uptime analysis shows the modification predates discovery by days or weeks) — indicates dwell time and requires broader investigation scope.
Investigation Guide
Forensic Artifacts
- >
Device flash filesystem contents — 'show flash:' or 'dir flash:' output listing all image files with sizes and timestamps - >
IOS/NX-OS platform integrity report — 'show platform integrity' on supported Cisco platforms (16.x+) showing cryptographic measurements of loaded image - >
TACACS+ command accounting logs showing every command executed on the device, especially 'copy', 'install', 'boot system', and 'reload' commands - >
TFTP server access logs and the actual transferred image files stored on the TFTP/SCP server - >
SNMP MIB data: sysUpTime OID (uptime reset indicates reload after image change), entPhysicalSoftwareRev OID (OS version), ciscoFlashMIB (flash file details) - >
Device startup-configuration and running-configuration exports showing 'boot system' statements which indicate the configured boot image path - >
NetFlow/IPFIX records for management interface traffic — look for unexpected outbound connections post-image-change indicating active implant C2 - >
Syslog buffer contents from device — 'show logging' output including timestamps of all system events around the modification window - >
Any coredump or crashinfo files on device flash that may contain memory artifacts from the modification operation
Tuning Guidance
The highest-volume false positive source is authorized maintenance windows. Suppress by creating a reference list of approved TFTP server IPs and management workstation IPs in your SIEM, then exclude transfers originating from those sources during approved change windows. Integrate with your ITSM (ServiceNow/Jira) to auto-suppress alerts when a matching approved change ticket exists for the device. For Cisco environments, whitelist Cisco DNA Center, Prime Infrastructure, and NSO automation platform IPs. For Junos environments, whitelist Junos Space and Paragon Automation server IPs. Set the minimum TFTP transfer size threshold at 5MB to exclude configuration file transfers (typically <100KB) and focus on actual OS image transfers. Consider creating a dedicated saved search or lookup table of each network device's authorized OS image hash to immediately flag any hash mismatch without manual comparison.
Hunting Queries
Hunts for network devices that logged OS version changes or boot-time image transitions over the past 30 days, identifying devices where the running software version was modified. This catches both authorized upgrades needing review and unauthorized modifications that successfully completed.
// Hunt: Network devices with unexpected version changes detected via syslog over past 30 days
Syslog
| where TimeGenerated > ago(30d)
| where SyslogMessage has_any ("Cisco IOS", "NX-OS", "Junos", "FortiOS", "PAN-OS")
| where SyslogMessage has_any ("Version", "version", "Software", "firmware")
| where SyslogMessage has_any ("changed", "upgraded", "downgraded", "installed", "booted")
| parse SyslogMessage with * "Version " OldVersion " to " NewVersion " on " *
| project TimeGenerated, Computer, HostIP, SyslogMessage, OldVersion, NewVersion
| where isnotempty(OldVersion) or isnotempty(NewVersion)
| sort by TimeGenerated desc index=syslog OR index=network_devices sourcetype IN ("syslog", "cisco:ios", "cisco:nxos", "juniper:junos")
earliest=-30d
| search (_raw="*version*changed*" OR _raw="*software*upgraded*" OR _raw="*image*loaded*" OR _raw="*sys-6-boottime*" OR _raw="*installed image*")
| rex field=_raw "(?i)version[:\s]+(?<FromVersion>[\d\.\(\)a-zA-Z]+)\s+to\s+(?<ToVersion>[\d\.\(\)a-zA-Z]+)"
| stats count, values(FromVersion) AS PreviousVersions, values(ToVersion) AS NewVersions, earliest(_time) AS FirstSeen BY host
| where isnotnull(PreviousVersions) OR isnotnull(NewVersions)
| sort - count Hunts for TFTP network activity (UDP port 69) involving large file transfers that could represent OS image distribution to network devices. Filters for transfers over 1MB to focus on actual image files rather than small config transfers. Large TFTP transfers to network device management IPs warrant investigation.
// Hunt: TFTP traffic from management hosts to network device management IPs
DeviceNetworkEvents
| where TimeGenerated > ago(14d)
| where RemotePort == 69 or LocalPort == 69
| extend IsTftpServer = iff(LocalPort == 69, true, false)
| extend IsTftpClient = iff(RemotePort == 69, true, false)
| join kind=leftouter (
DeviceProcessEvents
| where TimeGenerated > ago(14d)
| where ProcessCommandLine has_any (".bin", ".img", ".tar", ".pkg", ".spa")
| project DeviceName, TimeGenerated, ProcessCommandLine, AccountName
) on DeviceName
| project TimeGenerated, DeviceName, LocalIP, RemoteIP, RemotePort, IsTftpServer, IsTftpClient, ProcessCommandLine, AccountName
| order by TimeGenerated desc index=network OR index=firewall sourcetype IN ("stream:udp", "stream:ip", "paloalto:firewall", "cisco:asa")
earliest=-14d
(dest_port=69 OR src_port=69)
| eval TransferDirection=if(dest_port=69, "TFTP_PUT_REQUEST", "TFTP_RESPONSE")
| stats count AS TransferCount, values(src_ip) AS Sources, values(dest_ip) AS Destinations, earliest(_time) AS FirstSeen, latest(_time) AS LastSeen BY TransferDirection, bytes
| where bytes > 1000000
| eval SizeMB=round(bytes/1048576, 2)
| sort - SizeMB Hunts for network device management authentication and command activity originating from unexpected source IPs or involving accounts accessing an unusually large number of devices. Adversaries modifying system images typically need privileged access to multiple devices and may authenticate from jump hosts not in the normal management IP range.
// Hunt: Network device management commands from non-standard source IPs
CommonSecurityLog
| where TimeGenerated > ago(7d)
| where DeviceVendor in~ ("Cisco", "Juniper", "Palo Alto Networks", "Fortinet", "Arista", "F5 Networks")
| where Activity has_any ("login", "authentication", "privilege", "enable", "configure", "copy", "install")
| summarize CommandCount = count(),
UniqueActivities = dcount(Activity),
Activities = make_set(Activity),
SourceIPs = make_set(SourceIP)
by DestinationIP, SourceUserName, bin(TimeGenerated, 1h)
| where UniqueActivities > 3
| extend IsUnexpectedSource = iff(array_length(SourceIPs) > 2, true, false)
| sort by CommandCount desc index=network_devices OR index=tacacs sourcetype IN ("cisco:acs", "cisco:ise", "syslog")
earliest=-7d
| search (_raw="*AUTHEN*" OR _raw="*AUTHOR*" OR _raw="*privilege*15*" OR _raw="*enable*" OR _raw="*copy*" OR _raw="*install*")
| rex field=_raw "(?i)user[=:\s]+(?<Username>[\w\-\.@]+)"
| rex field=_raw "(?i)from[=:\s]+(?<SourceIP>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})"
| stats count AS AuthCount, dc(SourceIP) AS UniqueSourceIPs, values(SourceIP) AS IPs, dc(host) AS DevicesAccessed BY Username
| where UniqueSourceIPs > 2 OR DevicesAccessed > 5
| sort - AuthCount Atomic Red Team Tests
Simulates an attacker copying a network device OS image via TFTP from a management workstation, generating the TFTP network traffic and process execution artifacts that the detection targets. Uses atftp or tftpd-hpa client to initiate a TFTP transfer mimicking a Cisco IOS .bin image upload.
Command
# Install TFTP client if not present
apt-get install -y atftp 2>/dev/null || yum install -y tftp 2>/dev/null
# Create a fake large binary file simulating an IOS image
dd if=/dev/urandom of=/tmp/c2960x-universalk9-mz.152-7.E9.bin bs=1M count=15
# Attempt TFTP transfer to a target IP (use a test device or loopback)
atftp --put --local-file /tmp/c2960x-universalk9-mz.152-7.E9.bin 192.168.1.1 c2960x-universalk9-mz.152-7.E9.bin 2>&1 || true
# Also trigger the process-based detection
echo 'Simulating: copy tftp flash: c2960x-universalk9-mz.152-7.E9.bin' >> /var/log/syslog Cleanup
rm -f /tmp/c2960x-universalk9-mz.152-7.E9.bin Expected Telemetry
DeviceNetworkEvents: UDP port 69 connection attempt to target IP. DeviceProcessEvents: atftp process with command line containing .bin filename. Syslog: copy tftp message.
Expected Detection
Alert on TFTP transfer of .bin image file from non-management host. TftpTransfers subquery in KQL should fire. SPL query should match on .bin file transfer pattern.
Injects crafted syslog messages that a Cisco IOS device would generate during an unauthorized OS image modification, allowing validation of the detection logic against real-world log patterns without requiring an actual Cisco device.
Command
# Install logger if not present (usually pre-installed)
# Send syslog messages simulating Cisco IOS image copy and reload events
logger -p local7.notice -t 'ROUTER-01' '%SYS-5-CONFIG_I: Configured from console by admin on vty0 (192.168.1.200)'
logger -p local7.notice -t 'ROUTER-01' '%FILESYS-3-CPYFAIL: File copy operation from tftp://10.0.0.99/c2960x-universalk9-mz.152-7.E9.bin to flash:/c2960x-universalk9-mz.152-7.E9.bin succeeded'
logger -p local7.notice -t 'ROUTER-01' 'boot system flash:/c2960x-universalk9-mz.152-7.E9.bin'
logger -p local7.notice -t 'ROUTER-01' '%SYS-5-RELOAD: Reload requested by admin on vty0 (192.168.1.200). Reload reason: Load new software'
sleep 2
logger -p local7.notice -t 'ROUTER-01' '%SYS-6-BOOTTIME: Time taken to reboot after reload = 127 seconds' Cleanup
# No cleanup needed - syslog entries are ephemeral Expected Telemetry
Syslog table in Microsoft Sentinel (or Splunk syslog index) should receive entries with FILESYS, SYS-5-RELOAD, and SYS-6-BOOTTIME facility/message patterns from ROUTER-01.
Expected Detection
KQL SyslogImageEvents subquery should match on FILESYS and SYS-5-RELOAD message patterns. SPL query should score ROUTER-01 at HIGH risk due to matching reload and copy patterns.
Simulates detection of a T1601.002 downgrade attack by sending SNMP SET commands to modify the boot image configuration on a test network device, combined with syslog generation to test the correlation detection pipeline. Requires SNMP v2c write community string access to a test device.
Command
# Install snmp tools
apt-get install -y snmp 2>/dev/null
# Define test device (replace with actual test device IP, NOT production)
TEST_DEVICE="192.168.10.254"
SNMP_WRITE_COMMUNITY="argus-test-write"
# Query current boot image OID (ciscoFlashMIB: .1.3.6.1.4.1.9.9.10)
snmpget -v2c -c public $TEST_DEVICE .1.3.6.1.2.1.1.1.0 2>&1 || echo 'SNMP query attempt logged'
# Attempt SNMP write to boot variable (this will fail on most devices without correct community)
snmpset -v2c -c $SNMP_WRITE_COMMUNITY $TEST_DEVICE .1.3.6.1.4.1.9.2.1.73.0 s 'tftp://10.0.0.99/c2960x-mz.122-55.SE12.bin' 2>&1 || true
# Generate corresponding syslog to simulate device-side log
logger -p local7.warning -t 'SWITCH-CORE-01' '%SYS-3-MGMTBOOTERROR: Boot variable modified: boot system tftp://10.0.0.99/c2960x-mz.122-55.SE12.bin'
logger -p local7.notice -t 'SWITCH-CORE-01' 'DOWNGRADE DETECTED: Current version 15.2(7)E9, boot set to 12.2(55)SE12' Cleanup
# Remove test syslog entries if persistent logging is enabled
# snmpset -v2c -c $SNMP_WRITE_COMMUNITY $TEST_DEVICE .1.3.6.1.4.1.9.2.1.73.0 s '' 2>/dev/null || true Expected Telemetry
CommonSecurityLog or Syslog: SNMP write attempts to network device. Syslog: MGMTBOOTERROR and downgrade notification messages. DeviceNetworkEvents: SNMP (UDP 161/162) traffic to test device.
Expected Detection
SPL query should flag SWITCH-CORE-01 at HIGH risk. KQL should surface the MGMTBOOTERROR syslog entry. SNMP traffic to network device management IP should appear in network detection layer.