Detection rules › Elastic

Browser Debugging from Unusual Parent

Source
github.com/elastic/protections-artifacts

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 access web applications or Internet services as an authenticated user without credentials.

MITRE ATT&CK coverage

TacticTechniques
Credential Access

Rule body

[rule]
description = """
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
access web applications or Internet services as an authenticated user without credentials.
"""
id = "09931e34-fe6b-4155-91ec-490d64fb72a2"
license = "Elastic License v2"
name = "Browser Debugging from Unusual Parent"
os_list = ["windows"]
reference = [
    "https://github.com/defaultnamehere/cookie_crimes",
    "https://embracethered.com/blog/posts/2020/cookie-crimes-on-mirosoft-edge/",
    "https://github.com/rapid7/metasploit-framework/blob/master/documentation/modules/post/multi/gather/chrome_cookies.md",
    "https://posts.specterops.io/hands-in-the-cookie-jar-dumping-cookies-with-chromiums-remote-debugger-port-34c4f468844e",
    "https://github.com/BishopFox/sliver/wiki/Cursed",
]
version = "1.0.24"

query = '''
process where event.type == "start" and
   process.name : ("chrome.exe", "msedge.exe") and not user.id : "S-1-5-18" and
   process.code_signature.trusted == true and
   process.parent.executable != null and
   process.args : ("--remote-debugging-port=*",
                   "--remote-debugging-targets=*",
                   "--remote-debugging-pipe=*") and
   process.args : "--user-data-dir=*" and not process.args:"--remote-debugging-port=0" and
   not (process.parent.name == "chrome.exe" and process.parent.args == "--remote-debugging-host=127.0.0.1") and
   not process.parent.executable : ("?:\\Program Files\\Microsoft VS Code\\Code.exe",
                                    "?:\\Program Files (x86)\\PRTG Network Monitor\\Sensor System\\reporter.exe",
                                    "?:\\Program Files\\nodejs\\node.exe",
                                    "?:\\Windows\\System32\\inetsrv\\w3wp.exe",
                                    "?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
                                    "?:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
                                    "?:\\Program Files (x86)\\Brackets\\Brackets.exe",
                                    "?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
                                    "?:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe",
                                    "?:\\Program Files\\OutSystems\\Development Environment*\\Service Studio\\ServiceStudio.exe",
                                    "?:\\Program Files (x86)\\CyberArk\\PSM\\Components\\chromedriver.exe",
                                    "?:\\Program Files\\Microsoft Visual Studio\\*\\node.exe",
                                    "?:\\Program Files (x86)\\Microsoft Visual Studio\\*\\node.exe",
                                    "?:\\Program Files (x86)\\Price Pro\\PricePro.exe",
                                    "?:\\Users\\*\\Versioning_SPCRepository\\SPCProcessor\\SPCEngine\\app.exe",
                                    "E:\\PRTG\\Sensor System\\reporter.exe" ,
                                    "E:\\eclipse\\chromedriver.exe",
                                    "c:\\ibi\\AppStudio82\\bin\\chromedriver.exe",
                                    "C:\\Windows\\chromedriver.exe",
                                    "?:\\Program Files\\Google\\Chrome Dev\\Application\\chrome.exe",
                                    "?:\\ibi\\AppStudio90\\bin\\chromedriver.exe",
                                    "?:\\Users\\*\\AppData\\Roaming\\nvm\\v*\\node.exe",
                                    "?:\\*\\bin\\cache\\dart-sdk\\bin\\dart.exe",
                                    "C:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe",
                                    "C:\\Program Files\\Python3??\\python.exe") and
   not (process.parent.executable : "?:\\Windows\\explorer.exe" and process.command_line : "*VisualStudio*") and
   not (process.parent.name : "chromedriver.exe" and process.parent.command_line : "*chromedriver.exe --port=*") and
   not (process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe" and
        process.parent.command_line : "*--ms-enable-electron-run-as-node*") and
   not (process.parent.name : "node.exe" and process.parent.args : "--code-coverage") and
   not process.args :
             ("--user-data-dir=?:\\Users\\*\\AppData\\Local\\JetBrains\\WebStorm*\\chrome-user-data-*",
              "--user-data-dir=?:\\Users\\*\\AppData\\Local\\Temp\\1\\flutter_tools.*\\flutter_tools_chrome_device.*") and
   not process.parent.args : "?:\\Program Files\\nodejs\\node.exe" and
   not (process.parent.code_signature.subject_name == "Google LLC" and process.parent.code_signature.trusted == true)
'''

min_endpoint_version = "8.14.0"
optional_actions = []
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0

[[actions]]
action = "kill_process"
field = "process.parent.entity_id"
state = 0

[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1539"
name = "Steal Web Session Cookie"
reference = "https://attack.mitre.org/techniques/T1539/"


[threat.tactic]
id = "TA0006"
name = "Credential Access"
reference = "https://attack.mitre.org/tactics/TA0006/"

[internal]
min_endpoint_version = "8.14.0"

Stages and Predicates

Stage 1: process

process where event.type == "start" and
   process.name : ("chrome.exe", "msedge.exe") and not user.id : "S-1-5-18" and
   process.code_signature.trusted == true and
   process.parent.executable != null and
   process.args : ("--remote-debugging-port=*",
                   "--remote-debugging-targets=*",
                   "--remote-debugging-pipe=*") and
   process.args : "--user-data-dir=*" and not process.args:"--remote-debugging-port=0" and
   not (process.parent.name == "chrome.exe" and process.parent.args == "--remote-debugging-host=127.0.0.1") and
   not process.parent.executable : ("?:\\Program Files\\Microsoft VS Code\\Code.exe",
                                    "?:\\Program Files (x86)\\PRTG Network Monitor\\Sensor System\\reporter.exe",
                                    "?:\\Program Files\\nodejs\\node.exe",
                                    "?:\\Windows\\System32\\inetsrv\\w3wp.exe",
                                    "?:\\Program Files\\Google\\Chrome\\Application\\chrome.exe",
                                    "?:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe",
                                    "?:\\Program Files (x86)\\Brackets\\Brackets.exe",
                                    "?:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe",
                                    "?:\\Program Files\\Microsoft\\Edge\\Application\\msedge.exe",
                                    "?:\\Program Files\\OutSystems\\Development Environment*\\Service Studio\\ServiceStudio.exe",
                                    "?:\\Program Files (x86)\\CyberArk\\PSM\\Components\\chromedriver.exe",
                                    "?:\\Program Files\\Microsoft Visual Studio\\*\\node.exe",
                                    "?:\\Program Files (x86)\\Microsoft Visual Studio\\*\\node.exe",
                                    "?:\\Program Files (x86)\\Price Pro\\PricePro.exe",
                                    "?:\\Users\\*\\Versioning_SPCRepository\\SPCProcessor\\SPCEngine\\app.exe",
                                    "E:\\PRTG\\Sensor System\\reporter.exe" ,
                                    "E:\\eclipse\\chromedriver.exe",
                                    "c:\\ibi\\AppStudio82\\bin\\chromedriver.exe",
                                    "C:\\Windows\\chromedriver.exe",
                                    "?:\\Program Files\\Google\\Chrome Dev\\Application\\chrome.exe",
                                    "?:\\ibi\\AppStudio90\\bin\\chromedriver.exe",
                                    "?:\\Users\\*\\AppData\\Roaming\\nvm\\v*\\node.exe",
                                    "?:\\*\\bin\\cache\\dart-sdk\\bin\\dart.exe",
                                    "C:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe",
                                    "C:\\Program Files\\Python3??\\python.exe") and
   not (process.parent.executable : "?:\\Windows\\explorer.exe" and process.command_line : "*VisualStudio*") and
   not (process.parent.name : "chromedriver.exe" and process.parent.command_line : "*chromedriver.exe --port=*") and
   not (process.parent.executable : "?:\\Users\\*\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe" and
        process.parent.command_line : "*--ms-enable-electron-run-as-node*") and
   not (process.parent.name : "node.exe" and process.parent.args : "--code-coverage") and
   not process.args :
             ("--user-data-dir=?:\\Users\\*\\AppData\\Local\\JetBrains\\WebStorm*\\chrome-user-data-*",
              "--user-data-dir=?:\\Users\\*\\AppData\\Local\\Temp\\1\\flutter_tools.*\\flutter_tools_chrome_device.*") and
   not process.parent.args : "?:\\Program Files\\nodejs\\node.exe" and
   not (process.parent.code_signature.subject_name == "Google LLC" and process.parent.code_signature.trusted == true)

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
process.command_linematchVisualStudioexcludes:process.command_line field:"process.command_line" value:"VisualStudio"
process.parent.executableeq?:\Windows\explorer.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\explorer.exe"
process.parent.argseq--code-coverageexcludes:process.parent.args field:"process.parent.args" value:"--code-coverage"
process.parent.nameeqnode.exeexcludes:process.parent.name field:"process.parent.name" value:"node.exe"
process.parent.argseq--remote-debugging-host=127.0.0.1excludes:process.parent.args field:"process.parent.args" value:"--remote-debugging-host=127.0.0.1"
process.parent.nameeqchrome.exeexcludes:process.parent.name field:"process.parent.name" value:"chrome.exe"
process.parent.code_signature.subject_nameeqGoogle LLCexcludes:process.parent.code_signature.subject_name field:"process.parent.code_signature.subject_name" value:"Google LLC"
process.parent.code_signature.trustedeqtrueexcludes:process.parent.code_signature.trusted field:"process.parent.code_signature.trusted" value:"true"
process.parent.command_linematch--ms-enable-electron-run-as-nodeexcludes:process.parent.command_line field:"process.parent.command_line" value:"--ms-enable-electron-run-as-node"
process.parent.executablewildcard?:\Users\*\AppData\Local\Programs\Microsoft VS Code\Code.exeexcludes:process.parent.executable field:"process.parent.executable" value:"?:\Users\*\AppData\Local\Programs\Microsoft VS Code\Code.exe"
process.parent.command_linematchchromedriver.exe --port=excludes:process.parent.command_line field:"process.parent.command_line" value:"chromedriver.exe --port="
process.parent.nameeqchromedriver.exeexcludes:process.parent.name field:"process.parent.name" value:"chromedriver.exe"
process.argseq--remote-debugging-port=0excludes:process.args field:"process.args" value:"--remote-debugging-port=0"
process.argswildcard--user-data-dir=?:\Users\*\AppData\Local\JetBrains\WebStorm*\chrome-user-data-*, --user-data-dir=?:\Users\*\AppData\Local\Temp\1\flutter_tools.*\flutter_tools_chrome_device.*excludes:process.args field:"process.args" value:"--user-data-dir=?:\Users\*\AppData\Local\JetBrains\WebStorm*\chrome-user-data-*" field:"process.args" value:"--user-data-dir=?:\Users\*\AppData\Local\Temp\1\flutter_tools.*\flutter_tools_chrome_device.*"
process.parent.argseq?:\Program Files\nodejs\node.exeexcludes:process.parent.args field:"process.parent.args" value:"?:\Program Files\nodejs\node.exe"
process.parent.executablewildcard?:\Program Files\Microsoft VS Code\Code.exe, ?:\Program Files (x86)\PRTG Network Monitor\Sensor System\reporter.exe, ?:\Program Files\nodejs\node.exe, ?:\Windows\System32\inetsrv\w3wp.exe, ?:\Program Files\Google\Chrome\Application\chrome.exe, ?:\Program Files (x86)\Google\Chrome\Application\chrome.exe, ?:\Program Files (x86)\Brackets\Brackets.exe, ?:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe, ?:\Program Files\Microsoft\Edge\Application\msedge.exe, ?:\Program Files\OutSystems\Development Environment*\Service Studio\ServiceStudio.exe, ?:\Program Files (x86)\CyberArk\PSM\Components\chromedriver.exe, ?:\Program Files\Microsoft Visual Studio\*\node.exe, ?:\Program Files (x86)\Microsoft Visual Studio\*\node.exe, ?:\Program Files (x86)\Price Pro\PricePro.exe, ?:\Users\*\Versioning_SPCRepository\SPCProcessor\SPCEngine\app.exe, E:\PRTG\Sensor System\reporter.exe, E:\eclipse\chromedriver.exe, c:\ibi\AppStudio82\bin\chromedriver.exe, C:\Windows\chromedriver.exe, ?:\Program Files\Google\Chrome Dev\Application\chrome.exe, ?:\ibi\AppStudio90\bin\chromedriver.exe, ?:\Users\*\AppData\Roaming\nvm\v*\node.exe, ?:\*\bin\cache\dart-sdk\bin\dart.exe, C:\Users\*\AppData\Local\Programs\Microsoft VS Code\Code.exe, C:\Program Files\Python3??\python.exeexcludes:process.parent.executable
user.ideqS-1-5-18excludes:user.id field:"user.id" value:"S-1-5-18"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
event.typeeq
  • start corpus 1078 (elastic 1078)
field:"event.type" kind:eq value:"start"
process.argswildcard
  • --remote-debugging-pipe=* corpus 2 (elastic 2)
  • --remote-debugging-port=* corpus 2 (elastic 2)
  • --remote-debugging-targets=* corpus 2 (elastic 2)
  • --user-data-dir=* corpus 2 (elastic 2)
field:"process.args" kind:wildcard
process.code_signature.trustedeq
  • true transforms: boolean corpus 14 (elastic 14)
field:"process.code_signature.trusted" kind:eq value:"true"
process.namewildcard
  • chrome.exe corpus 16 (elastic 14, splunk 2)
  • msedge.exe corpus 12 (elastic 12)
field:"process_name" kind:wildcard
process.parent.executableis_not_null
  • (no value, null check)
field:"ParentImage" kind:is_not_null