Skip to content

Commit

Permalink
[Rule Tuning] Windows DR Tuning - 6 (#3246)
Browse files Browse the repository at this point in the history
* [Rule Tuning] Windows DR Tuning - 6

* Update defense_evasion_masquerading_as_elastic_endpoint_process.toml

* Update defense_evasion_network_connection_from_windows_binary.toml

---------

Co-authored-by: Colson Wilhoit <[email protected]>

(cherry picked from commit 6f4c323)
  • Loading branch information
w0rk3r authored and github-actions[bot] committed Dec 12, 2023
1 parent 60283ae commit dc432c5
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 117 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ integration = ["endpoint", "windows"]
maturity = "production"
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
min_stack_version = "8.3.0"
updated_date = "2023/10/23"
updated_date = "2023/12/11"

[rule]
author = ["Elastic"]
Expand Down Expand Up @@ -34,13 +34,31 @@ type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
process.name : ("esensor.exe", "elastic-endpoint.exe") and
process.parent.executable != null and
process.name : ("esensor.exe", "elastic-endpoint.exe") and
process.parent.executable != null and
/* add FPs here */
not process.parent.executable : ("C:\\Program Files\\Elastic\\*",
"C:\\Windows\\System32\\services.exe",
"C:\\Windows\\System32\\WerFault*.exe",
"C:\\Windows\\System32\\wermgr.exe")
not process.parent.executable : (
"?:\\Program Files\\Elastic\\*",
"?:\\Windows\\System32\\services.exe",
"?:\\Windows\\System32\\WerFault*.exe",
"?:\\Windows\\System32\\wermgr.exe",
"?:\\Windows\\explorer.exe"
) and
not (
process.parent.executable : (
"?:\\Windows\\System32\\cmd.exe",
"?:\\Windows\\System32\\SecurityHealthHost.exe",
"?:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
) and
process.args : (
"test", "version",
"top", "run",
"*help", "status",
"upgrade", "/launch",
"/enable"
)
)
'''


Expand Down
14 changes: 11 additions & 3 deletions rules/windows/defense_evasion_masquerading_trusted_directory.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ integration = ["endpoint", "windows"]
maturity = "production"
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
min_stack_version = "8.3.0"
updated_date = "2023/10/23"
updated_date = "2023/12/11"

[rule]
author = ["Elastic"]
Expand Down Expand Up @@ -35,8 +35,16 @@ type = "eql"

query = '''
process where host.os.type == "windows" and event.type == "start" and
process.executable : "C:\\*Program*Files*\\*.exe" and
not process.executable : ("C:\\Program Files\\*.exe", "C:\\Program Files (x86)\\*.exe", "C:\\Users\\*.exe", "C:\\ProgramData\\*.exe")
process.executable : "C:\\*Program*Files*\\*.exe" and
not process.executable : (
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Users\\*.exe",
"?:\\ProgramData\\*.exe",
"?:\\Windows\\Downloaded Program Files\\*.exe",
"?:\\Windows\\Temp\\.opera\\????????????\\CProgram?FilesOpera*\\*.exe",
"?:\\Windows\\Temp\\.opera\\????????????\\CProgram?Files?(x86)Opera*\\*.exe"
)
'''


Expand Down
51 changes: 0 additions & 51 deletions rules/windows/defense_evasion_msbuild_beacon_sequence.toml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ integration = ["endpoint", "windows"]
maturity = "production"
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
min_stack_version = "8.3.0"
updated_date = "2023/06/22"
updated_date = "2023/10/26"

[transform]
[[transform.osquery]]
Expand Down Expand Up @@ -107,7 +107,7 @@ query = '''
sequence by process.entity_id
[process where host.os.type == "windows" and process.name : "MSBuild.exe" and event.type == "start"]
[network where host.os.type == "windows" and process.name : "MSBuild.exe" and
not cidrmatch(destination.ip, "127.0.0.1", "::1")]
not cidrmatch(destination.ip, "127.0.0.1", "::1", "localhost")]
'''


Expand Down
45 changes: 0 additions & 45 deletions rules/windows/defense_evasion_msxsl_beacon.toml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ integration = ["endpoint", "windows"]
maturity = "production"
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
min_stack_version = "8.3.0"
updated_date = "2023/10/09"
updated_date = "2023/12/11"

[transform]
[[transform.osquery]]
Expand Down Expand Up @@ -140,15 +140,21 @@ sequence by process.entity_id with maxspan=5m
process.name : "iexpress.exe" or
process.name : "installutil.exe" or
process.name : "Microsoft.Workflow.Compiler.exe" or
process.name : "MSBuild.exe" or
(
process.name : "msbuild.exe" and
destination.ip != "127.0.0.1"
) or
process.name : "msdt.exe" or
process.name : "mshta.exe" or
(
process.name : "msiexec.exe" and not
dns.question.name : (
"ocsp.digicert.com", "ocsp.verisign.com", "ocsp.comodoca.com", "ocsp.entrust.net", "ocsp.usertrust.com",
"ocsp.godaddy.com", "ocsp.camerfirma.com", "ocsp.globalsign.com", "ocsp.sectigo.com", "*.local"
)
process.name : "msiexec.exe" and not
dns.question.name : (
"ocsp.digicert.com", "ocsp.verisign.com", "ocsp.comodoca.com", "ocsp.entrust.net", "ocsp.usertrust.com",
"ocsp.godaddy.com", "ocsp.camerfirma.com", "ocsp.globalsign.com", "ocsp.sectigo.com", "*.local"
) and
/* Localhost, DigiCert and Comodo CA IP addresses */
not cidrmatch(destination.ip, "127.0.0.1", "192.229.211.108/32", "192.229.221.95/32",
"152.195.38.76/32", "104.18.14.101/32")
) or
process.name : "msxsl.exe" or
process.name : "odbcconf.exe" or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ integration = ["endpoint"]
maturity = "production"
min_stack_comments = "New fields added: required_fields, related_integrations, setup"
min_stack_version = "8.3.0"
updated_date = "2023/10/09"
updated_date = "2023/10/26"

[transform]
[[transform.osquery]]
Expand Down Expand Up @@ -110,7 +110,15 @@ sequence by host.id with maxspan=5s
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\System32\\svchost.exe",
"?:\\Windows\\System32\\drvinst.exe") and
not file.path : ("?:\\Program Files\\*.exe", "?:\\Program Files (x86)\\*.exe")
not file.path : (
"?:\\Program Files\\*.exe",
"?:\\Program Files (x86)\\*.exe",
"?:\\Windows\\Temp\\*\\DismHost.exe",
"?:\\$WINDOWS.~BT\\Work\\*\\DismHost.exe",
"?:\\$WinREAgent\\Scratch\\*\\DismHost.exe",
"?:\\Windows\\tenable_mw_scan_*.exe",
"?:\\Users\\*\\AppData\\Local\\Temp\\LogiUI\\Pak\\uninstall.exe"
)
] by file.path
'''

Expand Down

0 comments on commit dc432c5

Please sign in to comment.