|
2 | 2 | creation_date = "2020/11/30" |
3 | 3 | integration = ["endpoint"] |
4 | 4 | maturity = "production" |
5 | | -updated_date = "2025/02/03" |
| 5 | +updated_date = "2025/09/04" |
6 | 6 |
|
7 | 7 | [transform] |
8 | 8 | [[transform.osquery]] |
@@ -133,18 +133,29 @@ type = "eql" |
133 | 133 |
|
134 | 134 | query = ''' |
135 | 135 | sequence by process.entity_id with maxspan=30s |
136 | | -
|
137 | | -[network where host.os.type == "windows" and |
138 | | - process.name : ("powershell.exe", "pwsh.exe", "powershell_ise.exe") and network.protocol == "dns" and |
139 | | - not dns.question.name : ( |
140 | | - "localhost", "*.microsoft.com", "*.azureedge.net", "*.powershellgallery.com", |
141 | | - "*.windowsupdate.com", "metadata.google.internal", "dist.nuget.org", |
142 | | - "artifacts.elastic.co", "*.digicert.com", "packages.chocolatey.org", |
143 | | - "outlook.office365.com" |
144 | | - ) and not user.id : "S-1-5-18"] |
| 136 | +[network where host.os.type == "windows" and |
| 137 | + process.name : ("powershell.exe", "pwsh.exe", "powershell_ise.exe") and |
| 138 | + network.protocol == "dns" and |
| 139 | + not dns.question.name : ( |
| 140 | + "*.microsoft.com", "*.azureedge.net", "*.powershellgallery.com", "*.windowsupdate.com", |
| 141 | + "metadata.google.internal", "dist.nuget.org", "artifacts.elastic.co", "*.digicert.com", |
| 142 | + "*.chocolatey.org", "outlook.office365.com", "cdn.oneget.org", "ci.dot.net", |
| 143 | + "packages.icinga.com", "login.microsoftonline.com", "*.gov", "*.azure.com", "*.python.org", |
| 144 | + "dl.google.com", "sensor.cloud.tenable.com", "*.azurefd.net", "*.office.net", "*.anac*", |
| 145 | + "aka.ms", "dot.net", "*.visualstudio.com", "*.local") and |
| 146 | + not user.id == "S-1-5-18" and |
| 147 | + /* Filter out NetBIOS/LLMNR-style names (e.g. host, localhost, etc.) */ |
| 148 | + dns.question.name regex """.*\.[a-zA-Z]{2,5}"""] |
145 | 149 | [file where host.os.type == "windows" and event.type == "creation" and |
146 | | - process.name : "powershell.exe" and file.extension : ("exe", "dll", "ps1", "bat") and |
147 | | - not file.name : "__PSScriptPolicy*.ps1"] |
| 150 | + process.name : "powershell.exe" and |
| 151 | + (file.extension : ("exe", "dll", "ps1", "bat") or file.Ext.header_bytes : "4d5a*") and |
| 152 | + not file.name : "__PSScriptPolicy*.ps1" and |
| 153 | + not file.path : ( |
| 154 | + "?:\\Users\\*\\AppData\\Local\\Temp\\????????.dll", |
| 155 | + "?:\\Users\\*\\AppData\\Local\\Temp\\*\\????????.dll", |
| 156 | + "?:\\Windows\\TEMP\\ansible-tmp-*\\AnsiballZ*.ps1" |
| 157 | + ) and |
| 158 | + not user.id == "S-1-5-18"] |
148 | 159 | ''' |
149 | 160 |
|
150 | 161 |
|
|
0 commit comments