Potential Cookies Theft via Browser Debugging
Identifies the execution of a Chromium based browser with the debugging process argument, which may indicate an attempt to steal authentication cookies. An adversary may steal web application or service session cookies and use them to gain access web applications or Internet services as an authenticated user without needing credentials.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/12/21"
3integration = ["endpoint", "windows"]
4min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
5min_stack_version = "8.14.0"
6maturity = "production"
7updated_date = "2025/01/15"
8
9[rule]
10author = ["Elastic"]
11description = """
12Identifies the execution of a Chromium based browser with the debugging process argument, which may indicate an attempt
13to steal authentication cookies. An adversary may steal web application or service session cookies and use them to gain
14access web applications or Internet services as an authenticated user without needing credentials.
15"""
16false_positives = ["Developers performing browsers plugin or extension debugging."]
17from = "now-9m"
18index = ["auditbeat-*", "winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*"]
19language = "eql"
20license = "Elastic License v2"
21max_signals = 33
22name = "Potential Cookies Theft via Browser Debugging"
23references = [
24 "https://github.com/defaultnamehere/cookie_crimes",
25 "https://embracethered.com/blog/posts/2020/cookie-crimes-on-mirosoft-edge/",
26 "https://github.com/rapid7/metasploit-framework/blob/master/documentation/modules/post/multi/gather/chrome_cookies.md",
27 "https://posts.specterops.io/hands-in-the-cookie-jar-dumping-cookies-with-chromiums-remote-debugger-port-34c4f468844e",
28]
29risk_score = 47
30rule_id = "027ff9ea-85e7-42e3-99d2-bbb7069e02eb"
31setup = """## Setup
32
33If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
34events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
35Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
36`event.ingested` to @timestamp.
37For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
38"""
39severity = "medium"
40tags = [
41 "Domain: Endpoint",
42 "OS: Linux",
43 "OS: Windows",
44 "OS: macOS",
45 "Use Case: Threat Detection",
46 "Tactic: Credential Access",
47 "Data Source: Elastic Defend",
48 "Resources: Investigation Guide",
49]
50timestamp_override = "event.ingested"
51type = "eql"
52
53query = '''
54process where event.type in ("start", "process_started", "info") and
55 process.name in (
56 "Microsoft Edge",
57 "chrome.exe",
58 "Google Chrome",
59 "google-chrome-stable",
60 "google-chrome-beta",
61 "google-chrome",
62 "msedge.exe") and
63 process.args : ("--remote-debugging-port=*",
64 "--remote-debugging-targets=*",
65 "--remote-debugging-pipe=*") and
66 process.args : "--user-data-dir=*" and not process.args:"--remote-debugging-port=0"
67'''
68note = """## Triage and analysis
69
70> **Disclaimer**:
71> 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.
72
73### Investigating Potential Cookies Theft via Browser Debugging
74
75Chromium-based browsers support debugging features that allow developers to inspect and modify web applications. Adversaries can exploit these features to access session cookies, enabling unauthorized access to web services. The detection rule identifies suspicious browser processes using debugging arguments, which may indicate cookie theft attempts, by monitoring specific process names and arguments across different operating systems.
76
77### Possible investigation steps
78
79- Review the process details to confirm the presence of suspicious debugging arguments such as "--remote-debugging-port=*", "--remote-debugging-targets=*", or "--remote-debugging-pipe=*". Check if these arguments were used in conjunction with "--user-data-dir=*" and ensure "--remote-debugging-port=0" is not present.
80- Identify the user account associated with the suspicious browser process to determine if it aligns with expected behavior or if it might be compromised.
81- Investigate the source IP address and network activity associated with the process to identify any unusual or unauthorized access patterns.
82- Check for any recent changes or anomalies in the user's account activity, such as unexpected logins or access to sensitive applications.
83- Correlate the event with other security alerts or logs to identify if this activity is part of a broader attack pattern or campaign.
84- If possible, capture and analyze the network traffic associated with the process to detect any data exfiltration attempts or communication with known malicious IP addresses.
85
86### False positive analysis
87
88- Development and testing activities may trigger the rule when developers use debugging features for legitimate purposes. To manage this, create exceptions for known developer machines or user accounts frequently involved in web application development.
89- Automated testing frameworks that utilize browser debugging for testing web applications can also cause false positives. Identify and exclude processes initiated by these frameworks by specifying their unique process names or user accounts.
90- Browser extensions or tools that rely on debugging ports for functionality might be flagged. Review and whitelist these extensions or tools if they are verified as safe and necessary for business operations.
91- Remote support or troubleshooting sessions using debugging features can be mistaken for suspicious activity. Implement a policy to log and review such sessions, allowing exceptions for recognized support tools or personnel.
92- Continuous integration/continuous deployment (CI/CD) pipelines that involve browser automation may inadvertently match the rule criteria. Exclude these processes by identifying and filtering based on the CI/CD system's user accounts or process identifiers.
93
94### Response and remediation
95
96- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
97- Terminate any suspicious browser processes identified with debugging arguments to stop potential cookie theft in progress.
98- Conduct a thorough review of access logs for the affected web applications or services to identify any unauthorized access attempts using stolen cookies.
99- Invalidate all active sessions for the affected user accounts and force a re-authentication to ensure that any stolen session cookies are rendered useless.
100- Implement stricter browser security policies, such as disabling remote debugging features in production environments, to prevent similar exploitation in the future.
101- Escalate the incident to the security operations team for further investigation and to determine if additional systems or data have been compromised.
102- Enhance monitoring and alerting for similar suspicious browser activities by refining detection rules and incorporating additional threat intelligence."""
103
104
105[[rule.threat]]
106framework = "MITRE ATT&CK"
107[[rule.threat.technique]]
108id = "T1539"
109name = "Steal Web Session Cookie"
110reference = "https://attack.mitre.org/techniques/T1539/"
111
112
113[rule.threat.tactic]
114id = "TA0006"
115name = "Credential Access"
116reference = "https://attack.mitre.org/tactics/TA0006/"
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 Cookies Theft via Browser Debugging
Chromium-based browsers support debugging features that allow developers to inspect and modify web applications. Adversaries can exploit these features to access session cookies, enabling unauthorized access to web services. The detection rule identifies suspicious browser processes using debugging arguments, which may indicate cookie theft attempts, by monitoring specific process names and arguments across different operating systems.
Possible investigation steps
- Review the process details to confirm the presence of suspicious debugging arguments such as "--remote-debugging-port=", "--remote-debugging-targets=", or "--remote-debugging-pipe=". Check if these arguments were used in conjunction with "--user-data-dir=" and ensure "--remote-debugging-port=0" is not present.
- Identify the user account associated with the suspicious browser process to determine if it aligns with expected behavior or if it might be compromised.
- Investigate the source IP address and network activity associated with the process to identify any unusual or unauthorized access patterns.
- Check for any recent changes or anomalies in the user's account activity, such as unexpected logins or access to sensitive applications.
- Correlate the event with other security alerts or logs to identify if this activity is part of a broader attack pattern or campaign.
- If possible, capture and analyze the network traffic associated with the process to detect any data exfiltration attempts or communication with known malicious IP addresses.
False positive analysis
- Development and testing activities may trigger the rule when developers use debugging features for legitimate purposes. To manage this, create exceptions for known developer machines or user accounts frequently involved in web application development.
- Automated testing frameworks that utilize browser debugging for testing web applications can also cause false positives. Identify and exclude processes initiated by these frameworks by specifying their unique process names or user accounts.
- Browser extensions or tools that rely on debugging ports for functionality might be flagged. Review and whitelist these extensions or tools if they are verified as safe and necessary for business operations.
- Remote support or troubleshooting sessions using debugging features can be mistaken for suspicious activity. Implement a policy to log and review such sessions, allowing exceptions for recognized support tools or personnel.
- Continuous integration/continuous deployment (CI/CD) pipelines that involve browser automation may inadvertently match the rule criteria. Exclude these processes by identifying and filtering based on the CI/CD system's user accounts or process identifiers.
Response and remediation
- Immediately isolate the affected system from the network to prevent further unauthorized access or data exfiltration.
- Terminate any suspicious browser processes identified with debugging arguments to stop potential cookie theft in progress.
- Conduct a thorough review of access logs for the affected web applications or services to identify any unauthorized access attempts using stolen cookies.
- Invalidate all active sessions for the affected user accounts and force a re-authentication to ensure that any stolen session cookies are rendered useless.
- Implement stricter browser security policies, such as disabling remote debugging features in production environments, to prevent similar exploitation in the future.
- Escalate the incident to the security operations team for further investigation and to determine if additional systems or data have been compromised.
- Enhance monitoring and alerting for similar suspicious browser activities by refining detection rules and incorporating additional threat intelligence.
References
Related rules
- AWS SSM `SendCommand` with Run Shell Command Parameters
- Active Directory Forced Authentication from Linux Host - SMB Named Pipes
- Elastic Agent Service Terminated
- Modification of Standard Authentication Module or Configuration
- WebServer Access Logs Deleted