Detection rules › Splunk
Windows Hosts File Access
This Analytic detects the execution of a process attempting to access the hosts file. The hosts file is a critical file for network configuration and DNS resolution. If an attacker gains access to it, they can redirect traffic to malicious websites, serve fake content or block legitimate security websites.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Discovery | T1012 Query Registry |
Event coverage
| Provider | Event ID | Title |
|---|---|---|
| Security-Auditing | 4663 | An attempt was made to access an object. |
Stages and Predicates
Stage 1: search
search NOT process_path IN ("*:\\Windows\\SysWow64\\SearchIndexer.exe", "*:\\Windows\\SysWow64\\svchost.exe", "*:\\Windows\\System32\\SearchIndexer.exe", "*:\\Windows\\System32\\lsass.exe", "*:\\Windows\\System32\\services.exe", "*:\\Windows\\System32\\svchost.exe", "*:\\Windows\\explorer.exe") EventCode=4663 object_file_path="*:\\Windows\\System32\\drivers\\etc\\hosts"
Stage 2: stats
stats BY _time, object_file_path, object_file_name, dest, process_name, process_path, process_id, EventCode
Stage 3: eval
eval ...
Stage 4: lookup
lookup <lookup> browser_process_path, is_valid_browser_path, process_path
Stage 5: eval
eval ...
Stage 6: where
where is_valid_browser_path="false"
Stage 7: search
search
Stage 8: search
search
Stage 9: search
search `macro`
Exclusions
Top-level NOT(...) conjuncts — predicates this rule actively suppresses.
| Stage | Field | Kind | Excluded values |
|---|---|---|---|
| 1 | process_name | in | "*:\\Windows\\SysWow64\\SearchIndexer.exe", "*:\\Windows\\SysWow64\\svchost.exe", "*:\\Windows\\System32\\SearchIndexer.exe", "*:\\Windows\\System32\\lsass.exe", "*:\\Windows\\System32\\services.exe", "*:\\Windows\\System32\\svchost.exe", "*:\\Windows\\explorer.exe" |
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
EventCode | eq |
|
is_valid_browser_path | eq |
|
object_file_path | eq |
|
Neighbors
Broader alternatives (more inclusive than this rule)
These rules match a superset of what this rule catches. They cover the same events plus more. Use them if you want wider coverage and can absorb more false positives.
- Windows Credential Access From Browser Password Store (drops 2 filters this rule applies)