LoFP LoFP / administrators or support scripts may inspect browser caches for troubleshooting, cleanup, or forensic analysis. review the script content, user, host, and any subsequent file creation or script execution before disposition.

Techniques

Sample rules

Windows PowerShell Script Block Browser Cache Access

Description

This analytic detects PowerShell Script Block Logging events that enumerate or read browser cache directories. PowerShell inspecting Firefox, Chrome, Edge, Brave, or Chromium cache files can indicate cache smuggling, where web content disguised as an image is extracted and staged for execution. The analytic looks for browser cache paths together with file enumeration or read operations, rather than relying on cache markers or a specific payload name.

Detection logic

`powershell`
EventCode=4104
ScriptBlockText IN (
    "*Copy-Item *",
    "*gci *",
    "*Get-ChildItem *",
    "*Get-Content *",
    "*ReadAllBytes*",
    "*ReadAllText*",
    "*ReadBytes*",
    "*Select-String*",
    "*WriteAllBytes*"
)

ScriptBlockText IN (
    "*Cache_Data*",
    "*cache2*entries*"
)


| eval script_block=lower(ScriptBlockText)


| eval cache_family=case(
    like(script_block, "%mozilla%firefox%profiles%") AND like(script_block, "%cache2%entries%"), "Firefox",
    like(script_block, "%google%chrome%user data%") AND like(script_block, "%cache_data%"), "Chrome",
    like(script_block, "%microsoft%edge%user data%") AND like(script_block, "%cache_data%"), "Edge",
    like(script_block, "%bravesoftware%brave-browser%user data%") AND like(script_block, "%cache_data%"), "Brave",
    like(script_block, "%user data%") AND like(script_block, "%cache_data%"), "Chromium"
  )


| where isnotnull(cache_family)


| eval dest=coalesce(dest, Computer, dvc, host)

| eval user=coalesce(user, UserID, User)


| stats count min(_time) as firstTime
              max(_time) as lastTime
              values(cache_family) as cache_family
              values(ScriptBlockText) as ScriptBlockText
              values(Path) as Path values(Guid) as Guid

  by dest user ScriptBlockId ProcessID signature signature_id


| `security_content_ctime(firstTime)`

| `security_content_ctime(lastTime)`

| `windows_powershell_script_block_browser_cache_access_filter`