-
Notifications
You must be signed in to change notification settings - Fork 609
[New] Potential Masquerading as Svchost #5305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Samirbous
wants to merge
11
commits into
main
Choose a base branch
from
qstr_test
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+92
−0
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
9e4afc8
[New] Potential Masquerading as Svchost
Samirbous 2ea8405
Update defense_evasion_masquerading_as_svchost.toml
Samirbous 4de736f
Update defense_evasion_masquerading_as_svchost.toml
Samirbous 40d6981
Update defense_evasion_masquerading_as_svchost.toml
Samirbous 56276ec
Update defense_evasion_masquerading_as_svchost.toml
Samirbous dcc9a21
Update defense_evasion_masquerading_as_svchost.toml
Samirbous 702abec
Update defense_evasion_masquerading_as_svchost.toml
Samirbous 0e67beb
Update defense_evasion_masquerading_as_svchost.toml
Samirbous 86c8f80
Update defense_evasion_masquerading_as_svchost.toml
Samirbous 5e0621b
Update defense_evasion_masquerading_as_svchost.toml
Samirbous 095510c
Merge branch 'main' into qstr_test
eric-forte-elastic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
92 changes: 92 additions & 0 deletions
92
rules/windows/defense_evasion_masquerading_as_svchost.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| [metadata] | ||
| creation_date = "2025/11/12" | ||
| integration = ["windows"] | ||
| maturity = "production" | ||
| updated_date = "2025/11/12" | ||
|
|
||
| [rule] | ||
| author = ["Elastic"] | ||
| description = """ | ||
| Identifies attempts to masquerade as the Service Host process `svchost.exe` to evade detection and blend in with normal system activity. | ||
| """ | ||
| from = "now-9m" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No event deduplication upstream for ESQL. Maybe add |
||
| language = "esql" | ||
| license = "Elastic License v2" | ||
| name = "Potential Masquerading as Svchost" | ||
| note = """ ## Triage and analysis | ||
|
|
||
| > **Disclaimer**: | ||
| > This investigation guide was created using generative AI technology and has been reviewed to improve its accuracy and relevance. While every effort has been made to ensure its quality, we recommend validating the content and adapting it to suit your specific environment and operational needs. | ||
|
|
||
| ### Investigating Potential Masquerading as Svchost | ||
|
|
||
| svchost.exe is a legitimate Windows system process responsible for hosting multiple Windows services. Adversaries may attempt to masquerade as svchost.exe to evade detection and blend in with normal system activity. This is often achieved by renaming a malicious executable to svchost.exe, placing it outside of standard Windows directories or running it with unusual parent processes or command-line arguments. | ||
|
|
||
| ### Possible investigation steps | ||
|
|
||
| - Review the process.executable and process.parent.executable fields to confirm the location and unexpected parents.. | ||
| - Check the process.command_line field for unusual arguments. Legitimate svchost.exe instances typically use the -k parameter followed by a valid service group name. | ||
| - Investigate the process.code_signature field to determine if the binary is signed by Microsoft. Unsigned or invalid signatures are strong indicators of masquerading. | ||
| - Correlate the event with other telemetry from the same host to identify additional indicators such as file creation, network connections, or registry modifications related to the suspicious process. | ||
| - Review related file creation events to determine how and when the fake svchost.exe was introduced to the system (e.g. dropped by another malware component or downloaded from the network). | ||
|
|
||
| ### False positive analysis | ||
|
|
||
| - Some legitimate third-party applications may use executables named svchost.exe within their own installation paths. Verify the vendor, file hash, and digital signature to determine legitimacy. | ||
| - In virtualized or sandboxed environments, custom service hosts may appear with similar naming conventions. Validate these against known baseline configurations. | ||
| - Ensure that system recovery or diagnostic tools using temporary binaries are not misidentified as malicious. Review event timing and system logs to confirm. | ||
| - Regularly maintain an inventory of known legitimate `svchost.exe` locations and hashes to minimize false positives across managed hosts. | ||
|
|
||
| ### Response and remediation | ||
|
|
||
| - Isolate the affected host immediately to prevent lateral movement or further compromise. | ||
| - Terminate any suspicious svchost.exe processes executing from non-standard locations. | ||
| - Quarantine and remove the rogue binary after verification through hash reputation or sandbox analysis. | ||
| - Perform a full system scan to identify additional malicious files or persistence mechanisms associated with the masqueraded process. | ||
| - Review and reset any credentials used by the compromised process if credential theft or impersonation is suspected. | ||
| - Analyze recent network activity from the affected host for potential data exfiltration or commandand-control communication. | ||
| - Escalate the incident to the security operations or incident response team for deeper investigation and forensic analysis. | ||
| - Implement detections to monitor for future attempts of process masquerading, and update security baselines and EDR exclusions accordingly. | ||
| """ | ||
| risk_score = 73 | ||
| rule_id = "32f95776-6498-4f3c-a90c-d4f6083e3901" | ||
| severity = "high" | ||
| tags = [ | ||
| "Domain: Endpoint", | ||
| "OS: Windows", | ||
| "Use Case: Threat Detection", | ||
| "Tactic: Defense Evasion", | ||
| "Resources: Investigation Guide" | ||
| ] | ||
| timestamp_override = "event.ingested" | ||
| type = "esql" | ||
|
|
||
| query = ''' | ||
| FROM logs-* metadata _id, _version, _index | ||
| | where event.category == "process" and event.type == "start" and | ||
| match(process.name, "svchost.exe", { "fuzziness": 1, "max_expansions": 10 }) and | ||
| not process.executable in ("C:\\Windows\\SysWOW64\\svchost.exe", "C:\\Windows\\System32\\svchost.exe") and | ||
| not process.executable like """\\Device\\HarddiskVolume*\\Windows\\System32\\svchost.exe""" and | ||
| not process.executable like """\\Device\\HarddiskVolume*\\Windows\\SysWOW64\\svchost.exe""" | ||
| | keep event.dataset, host.name, host.id, user.id, user.name, process.executable, process.parent.executable, process.command_line | ||
| ''' | ||
|
|
||
|
|
||
| [[rule.threat]] | ||
| framework = "MITRE ATT&CK" | ||
| [[rule.threat.technique]] | ||
| id = "T1036" | ||
| name = "Masquerading" | ||
| reference = "https://attack.mitre.org/techniques/T1036/" | ||
| [[rule.threat.technique.subtechnique]] | ||
| id = "T1036.005" | ||
| name = "Match Legitimate Resource Name or Location" | ||
| reference = "https://attack.mitre.org/techniques/T1036/005/" | ||
|
|
||
|
|
||
|
|
||
| [rule.threat.tactic] | ||
| id = "TA0005" | ||
| name = "Defense Evasion" | ||
| reference = "https://attack.mitre.org/tactics/TA0005/" | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.elastic.co/docs/reference/query-languages/esql/functions-operators/operators#esql-match-operator
May need to add min-stack for 9.1.0.