Defacement
Adversaries may modify visual content available internally or externally to an enterprise network, thus affecting the integrity of the original content. Reasons for defacement include delivering messaging, intimidation, or claiming (possibly false) credit for an intrusion. Disturbing or offensive images may be used as part of defacement to cause user discomfort or to pressure compliance with accompanying messages. Internal defacement targets assets visible within an enterprise (desktop wallpapers, screensavers, logon banners), while external defacement targets publicly accessible web content (web server root files, CMS templates, hosted images).
What is T1491 Defacement?
Defacement (T1491) maps to the Impact tactic — the adversary is trying to manipulate, interrupt, or destroy your systems and data in MITRE ATT&CK.
This page provides production-ready detection logic for Defacement, covering the data sources and telemetry it touches: File: File Modification, File: File Creation, Process: Process Creation, Windows Registry: Windows Registry Key Modification, Microsoft Defender for Endpoint. 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
- Impact
- Technique
- T1491 Defacement
- Canonical reference
- https://attack.mitre.org/techniques/T1491/
let WebRootPaths = dynamic([
"\\inetpub\\wwwroot\\", "\\htdocs\\", "\\www\\", "\\public_html\\",
"\\nginx\\html\\", "\\apache2\\htdocs\\", "/var/www/", "/srv/http/",
"/usr/share/nginx/", "/home/www/"
]);
let WebFileExtensions = dynamic([
".html", ".htm", ".php", ".asp", ".aspx", ".jsp",
".js", ".css", ".png", ".jpg", ".gif", ".svg", ".ico"
]);
let SuspiciousWriterProcesses = dynamic([
"cmd.exe", "powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe",
"mshta.exe", "curl.exe", "wget.exe", "certutil.exe", "bitsadmin.exe",
"python.exe", "python3", "perl.exe", "ruby.exe", "bash", "sh"
]);
let RegistryDefacementKeys = dynamic([
"Wallpaper", "ScreenSaveActive", "SCRNSAVE.EXE",
"legalnoticecaption", "legalnoticetext"
]);
// Branch 1: Web content file modifications in web root directories
let WebFileDefacement = DeviceFileEvents
| where Timestamp > ago(24h)
| where ActionType in ("FileCreated", "FileModified", "FileRenamed")
| where FolderPath has_any (WebRootPaths)
| where FileName has_any (WebFileExtensions)
| where InitiatingProcessFileName has_any (SuspiciousWriterProcesses)
or InitiatingProcessParentFileName has_any (SuspiciousWriterProcesses)
| extend DefacementType = "WebContentModification"
| project Timestamp, DeviceName, AccountName, FileName, FolderPath, ActionType,
InitiatingProcessFileName, InitiatingProcessCommandLine,
InitiatingProcessParentFileName, DefacementType;
// Branch 2: Registry modifications for internal defacement (wallpaper, logon banner)
let RegistryDefacement = DeviceRegistryEvents
| where Timestamp > ago(24h)
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| where RegistryKey has_any (
"\\Control Panel\\Desktop",
"SYSTEM\\CurrentControlSet\\Control\\Terminal Server",
"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Winlogon",
"SOFTWARE\\Policies\\Microsoft\\Windows\\Personalization"
)
| where RegistryValueName has_any (RegistryDefacementKeys)
| where InitiatingProcessFileName has_any (SuspiciousWriterProcesses)
or InitiatingProcessAccountName !in ("SYSTEM", "LOCAL SERVICE", "NETWORK SERVICE")
| extend DefacementType = "RegistryWallpaperChange"
| project Timestamp, DeviceName, AccountName=InitiatingProcessAccountName,
FileName=RegistryValueName, FolderPath=RegistryKey,
ActionType, InitiatingProcessFileName, InitiatingProcessCommandLine,
InitiatingProcessParentFileName, DefacementType;
// Branch 3: Web server process writing unexpected files (index.html replacement)
let WebServerSpawn = DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName in~ ("w3wp.exe", "nginx.exe", "httpd.exe", "apache2", "tomcat")
| where FileName in~ (SuspiciousWriterProcesses)
| extend DefacementType = "WebServerChildProcess"
| project Timestamp, DeviceName, AccountName, FileName, FolderPath="",
ActionType="ProcessSpawn", InitiatingProcessFileName,
InitiatingProcessCommandLine=ProcessCommandLine,
InitiatingProcessParentFileName, DefacementType;
union WebFileDefacement, RegistryDefacement, WebServerSpawn
| sort by Timestamp desc Detects web content defacement and internal defacement activity across three signal branches. Branch 1 monitors file creation/modification events in web root directories (IIS wwwroot, Apache htdocs, nginx html, PHP public_html) initiated by shells or scripting engines rather than legitimate web processes. Branch 2 detects registry modifications to wallpaper, screensaver, and Windows logon notice keys initiated by suspicious processes — a pattern used in internal defacement campaigns. Branch 3 identifies web server worker processes (IIS w3wp.exe, nginx, Apache httpd) spawning command shells or scripting engines, indicating web shell execution that may precede or constitute defacement. Uses DeviceFileEvents, DeviceRegistryEvents, and DeviceProcessEvents from Microsoft Defender for Endpoint.
Data Sources
Required Tables
False Positives
- Legitimate web application deployments via CI/CD pipelines or deployment tools (Octopus Deploy, Jenkins) that write directly to web roots
- System administrators using PowerShell or cmd.exe to manually update web content or static assets during maintenance windows
- Content management system (CMS) plugins or update processes that use scripting engines to modify HTML/CSS/JS files
- IT policy tools (SCCM, Intune, GPO) legitimately modifying logon banners or desktop wallpaper for compliance branding
- Web application frameworks that spawn shells for legitimate tasks (asset compilation, template rendering)
Sigma rule & cross-platform mapping
The detection logic for Defacement (T1491) 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 T1491
References (6)
- https://attack.mitre.org/techniques/T1491/
- https://attack.mitre.org/techniques/T1491/001/
- https://attack.mitre.org/techniques/T1491/002/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1491/T1491.md
- https://github.com/SigmaHQ/sigma/tree/master/rules/windows/file
- https://www.cisa.gov/news-events/cybersecurity-advisories/aa22-321a
Testing Methodology
Validate this detection against 5 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 1Replace Web Server Default Page (Windows IIS)
Expected signal: Sysmon Event ID 11: FileCreate with TargetFilename=C:\inetpub\wwwroot\index.html, Image=cmd.exe. DeviceFileEvents: ActionType=FileModified, FolderPath contains \wwwroot\, InitiatingProcessFileName=cmd.exe. Security Event ID 4663 (if object access auditing enabled on wwwroot directory).
- Test 2Internal Defacement via Wallpaper Registry Modification
Expected signal: Sysmon Event ID 13: RegistryValueSet with TargetObject=HKCU\Control Panel\Desktop\Wallpaper, Details=C:\Windows\Temp\defaced_wallpaper.jpg, Image=powershell.exe. DeviceRegistryEvents: ActionType=RegistryValueSet, RegistryKey contains Control Panel\Desktop, RegistryValueName=Wallpaper, InitiatingProcessFileName=powershell.exe.
- Test 3Web Shell Simulation — Web Server Spawning Command Shell
Expected signal: Sysmon Event ID 1: Process Create with Image=cmd.exe, ParentImage=powershell.exe, CommandLine containing 'whoami'. DeviceProcessEvents: FileName=cmd.exe, InitiatingProcessFileName=powershell.exe. File creation event for webshell-test.txt.
- Test 4Linux Web Root File Replacement via Bash
Expected signal: Linux auditd: syscall=openat with path=/var/www/html/index.html and WRITE flag, uid/euid of calling user. Sysmon for Linux Event ID 11: FileCreate with TargetFilename=/var/www/html/index.html, Image=/usr/bin/bash. Linux file integrity monitoring (FIM) alert on /var/www/html/ if configured.
- Test 5Mass Internal Defacement via Logon Banner Registry Modification
Expected signal: Sysmon Event ID 13: RegistryValueSet with TargetObject=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LegalNoticeCaption and LegalNoticeText, Image=reg.exe. Security Event ID 4657 (Registry value modified) if object access auditing is enabled on the Winlogon key. DeviceRegistryEvents: ActionType=RegistryValueSet, RegistryValueName=LegalNoticeCaption/LegalNoticeText.
Response Playbook
Triage
- Identify the defacement type — is this external web defacement (public-facing web server content modified), internal defacement (desktop wallpaper/screensaver/logon banner changed), or both? Check the DefacementType field in alerts.
- For web defacement alerts: determine which files were modified (index.html, default.php, etc.) and whether the web server is public-facing or internal. Check file contents for injected messages, images, or redirects using: `curl -s http://<server>/<path> | head -100`.
- Identify the initiating process — was the web content written by a web shell (w3wp.exe or nginx/httpd spawning cmd.exe/powershell.exe), a legitimate deployment tool, or an interactive attacker session? Web shell spawns are highest priority.
- Check the user account context — was this a service account (IIS_IUSRS, www-data, apache), a domain admin, or an interactive user? Service accounts writing shell-spawning processes indicate web shell compromise.
- Review file modification timestamps and correlate with recent deployment events, git commits, or change tickets. Defacement events outside of change windows are highly suspicious.
- For registry-based internal defacement: check if the change was system-wide (HKLM affecting all users) or user-specific (HKCU). Determine if corresponding Group Policy objects exist that could explain the change.
- Scope the blast radius — query for the same initiating process or user across all endpoints in the past 24h to determine if this is isolated or a widespread campaign.
Containment
- If web shell activity confirmed (web server process spawning shells): immediately take the web server offline or place behind a maintenance page to prevent further adversary access while preserving evidence.
- Isolate the affected host from the network using EDR isolation or VLAN change to prevent lateral movement and exfiltration of web server credentials.
- Revoke and rotate all credentials stored on the web server — database connection strings, API keys, service account passwords — as these are frequently harvested during web server compromise.
- Block the attacker's source IP(s) at the edge firewall and WAF. If a web shell was used, review web server access logs for the shell URL and block it at the WAF level.
- For internal defacement via GPO or registry: identify the originating GPO or script and disable/revert it. If a user account was compromised, disable the account and revoke all active sessions and tokens.
- Restore defaced content from last known-good backup and verify integrity using file hashes. Do not restore from backup until the web shell or entry vector is identified and removed.
Evidence Collection
- Web server access logs — collect all logs from the web server (IIS: C:\inetpub\logs\LogFiles\, Apache: /var/log/apache2/access.log, nginx: /var/log/nginx/access.log) covering 48h before the incident. Look for web shell access patterns (POST requests to non-standard .php/.aspx files).
- File system timeline — collect MFT or inode change records for the web root directory to identify all files created, modified, or deleted during the intrusion window.
- Web shell artifacts — search for recently created or modified script files in the web root: `find /var/www -name '*.php' -newer /var/www/index.html -ls` or PowerShell: `Get-ChildItem C:\inetpub\wwwroot -Recurse | Where-Object {$_.LastWriteTime -gt (Get-Date).AddDays(-7)}`.
- Process creation logs — Sysmon Event ID 1 or Windows Security Event ID 4688 (with command line auditing) for the web server host, focusing on child processes of w3wp.exe, nginx.exe, or httpd.exe.
- Network connection logs — Sysmon Event ID 3 or firewall logs for outbound connections from the web server. Web shells often beacon out to C2 or pull additional payloads after initial defacement.
- Registry hive snapshots — for internal defacement, export the affected registry hives (HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon, HKCU\Control Panel\Desktop) for forensic comparison.
- Backup/integrity comparison — compare current web root contents against last deployment artifact or source control commit to identify all injected or modified files.
- Authentication logs — Windows Security Event ID 4624/4625 for logon attempts to the web server, IIS authentication logs, and SSH auth logs (/var/log/auth.log) to identify initial access vector.
Escalation Criteria
- ! Web shell confirmed — a web server process (w3wp.exe, nginx, httpd) is executing command shells or scripting engines, indicating persistent remote access beyond simple file modification.
- ! Public-facing website defaced with adversary messaging, credentials, or politically motivated content — this is an active impact event requiring immediate PR and executive notification.
- ! Evidence of lateral movement from the web server — outbound network connections to internal hosts, credential harvesting tools (mimikatz, LaZagne), or discovery commands following defacement.
- ! Multiple systems defaced simultaneously — indicates either a shared Group Policy compromise, domain admin account compromise, or an automated worm/ransomware-like campaign.
- ! Defacement accompanied by data exfiltration indicators — large outbound transfers, database dumps, or access to sensitive files beyond the web root.
- ! Logon banner or screensaver modification across multiple endpoints — suggests domain-level Group Policy Object compromise requiring immediate Active Directory forensics.
Investigation Guide
Forensic Artifacts
- >
Web server access logs with POST requests to unknown .php/.aspx/.jsp files — indicates web shell upload preceding defacement - >
File System: web root directory (C:\inetpub\wwwroot\ on IIS, /var/www/html/ on Apache/nginx) — newly created or recently modified files - >
File System: C:\Windows\Prefetch\ — prefetch entries for cmd.exe, powershell.exe with recent timestamps if launched from web server context - >
Registry: HKCU\Control Panel\Desktop\Wallpaper — path to current wallpaper image, modified timestamp - >
Registry: HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LegalNoticeCaption and LegalNoticeText — logon banner content - >
Registry: HKLM\SOFTWARE\Policies\Microsoft\Windows\Personalization\LockScreenImage — Group Policy-enforced lock screen - >
Event Log: Microsoft-Windows-GroupPolicy/Operational — GPO processing events if internal defacement deployed via Group Policy - >
Event Log: Security Event ID 4670 (Permissions on an object were changed) — for web root directory ACL modifications - >
Linux: /var/log/auth.log or /var/log/secure — SSH authentication events around the time of defacement - >
Linux: bash_history for www-data, apache, or nginx service accounts — attacker commands executed via web shell
Tuning Guidance
The primary source of false positives for web defacement detections is legitimate deployment pipelines. To reduce noise, build an allowlist of authorized deployment service accounts (e.g., deploy-user, jenkins-agent, octopus-worker) and their parent processes. Only exclude specific account+process combinations, never entire directories. For the web server child process detection, maintain a baseline of expected child processes per web server binary — PHP-FPM spawning php-cgi.exe is normal; IIS w3wp.exe spawning powershell.exe is not. For internal defacement via registry, suppress changes originating from known GPO enforcement processes (lsass.exe, svchost.exe hosting gpsvc) and from Intune Management Extension (IntuneManagementExtension.exe). Consider adding a volume threshold: trigger only when multiple web files are modified within a short time window (e.g., 5+ files within 10 minutes), which distinguishes bulk defacement from routine single-file updates. For environments with active web application deployments, integrate with your change management system — suppress alerts for hosts tagged as 'in active deployment' during approved windows. On Linux web servers, ensure Sysmon for Linux or auditd is deployed with rules covering the web root directories, as this detection depends on endpoint telemetry that may not be present by default.
Hunting Queries
Hunt for server-side script files (PHP, ASP, ASPX, JSP) created or modified in web root directories by processes other than legitimate web server executables. This identifies web shell uploads and script-based defacement payloads placed by attackers using shells, scripting engines, or download tools.
DeviceFileEvents
| where Timestamp > ago(7d)
| where ActionType in ("FileCreated", "FileModified")
| where FolderPath has_any ("\\wwwroot\\", "\\htdocs\\", "/var/www/", "/srv/http/")
| where FileName endswith ".php" or FileName endswith ".aspx" or FileName endswith ".asp" or FileName endswith ".jsp"
| where InitiatingProcessFileName !in~ ("w3wp.exe", "nginx.exe", "httpd", "apache2", "php-cgi.exe", "php.exe")
| summarize FileCount=count(), UniqueFiles=dcount(FileName), Devices=dcount(DeviceName),
FileList=make_set(FileName, 20), Earliest=min(Timestamp), Latest=max(Timestamp)
by InitiatingProcessFileName, InitiatingProcessAccountName
| where FileCount > 0
| sort by FileCount desc index=sysmon sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=11
| eval FilePath=lower(TargetFilename)
| where match(FilePath, "(\\\\wwwroot|\\\\htdocs|\/var\/www\/|\/srv\/http\/)")
| where match(FilePath, "\.(php|aspx|asp|jsp)$")
| eval InitProc=lower(Image)
| where NOT match(InitProc, "(w3wp\.exe|nginx\.exe|httpd|apache2|php-cgi\.exe|php\.exe)")
| stats count as FileCount, dc(TargetFilename) as UniqueFiles, dc(host) as Devices,
values(TargetFilename) as FileList, earliest(_time) as Earliest, latest(_time) as Latest
by Image, User
| sort - FileCount Hunt for web server processes spawning unexpected child processes over the past 7 days. Legitimate web servers should rarely spawn shells, scripting engines, or system utilities. This broader temporal view (vs the 24h detection window) helps identify low-and-slow campaigns or forgotten web shells that have been dormant.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where InitiatingProcessFileName in~ ("w3wp.exe", "nginx.exe", "httpd.exe", "apache2", "tomcat", "php-cgi.exe")
| summarize CommandLines=make_set(ProcessCommandLine, 50), ChildProcesses=make_set(FileName, 20),
Count=count(), Devices=dcount(DeviceName), Earliest=min(Timestamp), Latest=max(Timestamp)
by InitiatingProcessFileName, DeviceName
| where array_length(ChildProcesses) > 0
| mvexpand ChildProcess=ChildProcesses
| where ChildProcess !in~ ("conhost.exe", "WerFault.exe", "SearchProtocolHost.exe")
| project Timestamp=Earliest, DeviceName, InitiatingProcessFileName, ChildProcess,
Count, CommandLines
| sort by Count desc index=sysmon sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
| eval ParentProc=lower(ParentImage)
| where match(ParentProc, "(w3wp\.exe|nginx\.exe|httpd\.exe|apache2|tomcat|php-cgi\.exe)")
| eval ChildProc=lower(Image)
| where NOT match(ChildProc, "(conhost\.exe|werfault\.exe|searchprotocolhost\.exe)")
| stats count as SpawnCount, values(CommandLine) as Commands, dc(host) as Devices,
earliest(_time) as Earliest by ParentImage, Image
| sort - SpawnCount Hunt for mass wallpaper, logon banner, or screensaver registry changes affecting more than 3 devices — a strong indicator of Group Policy-based internal defacement or a compromised domain admin account pushing configuration changes across the enterprise. Single-device changes may be benign IT management; multi-device simultaneous changes warrant investigation.
DeviceRegistryEvents
| where Timestamp > ago(7d)
| where ActionType == "RegistryValueSet"
| where RegistryKey has_any (
"\\Control Panel\\Desktop",
"\\Windows NT\\CurrentVersion\\Winlogon",
"Policies\\Microsoft\\Windows\\Personalization"
)
| where RegistryValueName in ("Wallpaper", "LegalNoticeCaption", "LegalNoticeText",
"ScreenSaveActive", "SCRNSAVE.EXE", "LockScreenImage")
| summarize ChangeCount=count(), AffectedDevices=dcount(DeviceName),
DeviceList=make_set(DeviceName, 20), Values=make_set(RegistryValueData, 10),
Earliest=min(Timestamp), Latest=max(Timestamp)
by RegistryValueName, InitiatingProcessFileName, InitiatingProcessAccountName
| where AffectedDevices > 3
| sort by AffectedDevices desc index=sysmon sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=13
| eval RegPath=lower(TargetObject)
| where match(RegPath, "(\\\\control panel\\\\desktop|\\\\windows nt\\\\currentversion\\\\winlogon|\\\\policies\\\\microsoft\\\\windows\\\\personalization)")
| where match(RegPath, "(wallpaper|legalnoticecaption|legalnoticetext|screensaveactive|scrnsave\.exe|lockscreenimage)")
| stats count as ChangeCount, dc(host) as AffectedDevices, values(host) as DeviceList,
values(Details) as Values, earliest(_time) as Earliest by TargetObject, Image, User
| where AffectedDevices > 3
| sort - AffectedDevices Atomic Red Team Tests
Simulates external web defacement by overwriting the IIS default page with adversary messaging content. This represents the most common form of web defacement where attackers replace index.html or default.aspx with their own content after gaining web server access. Uses cmd.exe (a suspicious writer process) to perform the write, which matches the detection pattern.
Command
echo ^<html^>^<body^>^<h1^>DEFACED by Test - df00tech Atomic^</h1^>^</body^>^</html^> > C:\inetpub\wwwroot\index.html Cleanup
echo ^<html^>^<body^>^<h1^>Welcome to IIS^</h1^>^</body^>^</html^> > C:\inetpub\wwwroot\index.html Expected Telemetry
Sysmon Event ID 11: FileCreate with TargetFilename=C:\inetpub\wwwroot\index.html, Image=cmd.exe. DeviceFileEvents: ActionType=FileModified, FolderPath contains \wwwroot\, InitiatingProcessFileName=cmd.exe. Security Event ID 4663 (if object access auditing enabled on wwwroot directory).
Expected Detection
Branch 1 (WebFileModification) alert fires: FolderPath matches \wwwroot\, FileName ends with .html, InitiatingProcessFileName=cmd.exe. DefacementType=WebContentModification.
Simulates internal defacement by modifying the desktop wallpaper registry key using PowerShell — a technique used by threat actors to display adversary messaging or intimidation content on endpoint desktops. The wallpaper path is set to a non-existent file to avoid visual impact while still generating the expected telemetry.
Command
powershell.exe -Command "Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name 'Wallpaper' -Value 'C:\Windows\Temp\defaced_wallpaper.jpg' -Force" Cleanup
powershell.exe -Command "Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name 'Wallpaper' -Value '' -Force" Expected Telemetry
Sysmon Event ID 13: RegistryValueSet with TargetObject=HKCU\Control Panel\Desktop\Wallpaper, Details=C:\Windows\Temp\defaced_wallpaper.jpg, Image=powershell.exe. DeviceRegistryEvents: ActionType=RegistryValueSet, RegistryKey contains Control Panel\Desktop, RegistryValueName=Wallpaper, InitiatingProcessFileName=powershell.exe.
Expected Detection
Branch 2 (RegistryWallpaperChange) alert fires: RegistryKey matches \Control Panel\Desktop, RegistryValueName=Wallpaper, InitiatingProcessFileName=powershell.exe (suspicious writer).
Simulates the process creation pattern generated by a web shell executing commands on a compromised web server. Creates a cmd.exe child process under a simulated w3wp.exe parent context. In real attacks, this occurs when an attacker uploads a PHP/ASPX web shell and sends HTTP requests that cause the web server worker process to execute system commands for defacement or further compromise. This test uses PowerShell to spawn cmd.exe with IIS context simulation.
Command
powershell.exe -Command "Start-Process -FilePath 'cmd.exe' -ArgumentList '/c whoami > C:\Windows\Temp\webshell-test.txt' -NoNewWindow -Wait" Cleanup
Remove-Item C:\Windows\Temp\webshell-test.txt -ErrorAction SilentlyContinue Expected Telemetry
Sysmon Event ID 1: Process Create with Image=cmd.exe, ParentImage=powershell.exe, CommandLine containing 'whoami'. DeviceProcessEvents: FileName=cmd.exe, InitiatingProcessFileName=powershell.exe. File creation event for webshell-test.txt.
Expected Detection
Branch 3 (WebServerShellSpawn) fires if initiated from w3wp.exe parent context in production. In test context, use the hunting query to identify the spawned cmd.exe. Verify by checking DeviceProcessEvents for cmd.exe spawned by web server processes.
Simulates external defacement on a Linux web server by replacing the nginx/Apache default index page with adversary content using bash. This reflects real-world attacks where adversaries gain SSH or web shell access to Linux web servers and overwrite web root content with defacement messages.
Command
echo '<html><body><h1>DEFACED - df00tech Atomic Test</h1></body></html>' | sudo tee /var/www/html/index.html > /dev/null Cleanup
echo '<html><body><h1>Default Page</h1></body></html>' | sudo tee /var/www/html/index.html > /dev/null Expected Telemetry
Linux auditd: syscall=openat with path=/var/www/html/index.html and WRITE flag, uid/euid of calling user. Sysmon for Linux Event ID 11: FileCreate with TargetFilename=/var/www/html/index.html, Image=/usr/bin/bash. Linux file integrity monitoring (FIM) alert on /var/www/html/ if configured.
Expected Detection
KQL Branch 1 fires if Sysmon for Linux is deployed: FolderPath matches /var/www/, FileName=index.html, InitiatingProcessFileName=bash. SPL Branch 1 fires with same pattern via linux_secure or Sysmon for Linux sourcetype.
Simulates internal defacement by setting Windows logon notice text — a technique used by threat actors to display ransom messages, political statements, or intimidation text on every logon screen across compromised systems. This registry key is well-known for use in wiper/defacement campaigns and is monitored by the detection.
Command
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v LegalNoticeCaption /t REG_SZ /d "SYSTEM COMPROMISED" /f && reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v LegalNoticeText /t REG_SZ /d "Your system has been accessed. df00tech Atomic Test." /f Cleanup
reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v LegalNoticeCaption /f && reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v LegalNoticeText /f Expected Telemetry
Sysmon Event ID 13: RegistryValueSet with TargetObject=HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\LegalNoticeCaption and LegalNoticeText, Image=reg.exe. Security Event ID 4657 (Registry value modified) if object access auditing is enabled on the Winlogon key. DeviceRegistryEvents: ActionType=RegistryValueSet, RegistryValueName=LegalNoticeCaption/LegalNoticeText.
Expected Detection
Branch 2 (RegistryWallpaperChange) fires: RegistryKey matches Windows NT\CurrentVersion\Winlogon, RegistryValueName matches legalnoticecaption/legalnoticetext, InitiatingProcessFileName=reg.exe (SuspiciousWriterProcesses). Hunting query 3 triggers if same modification observed across multiple devices.