BrowserCache

Author: Bjorn Vanhaeren, Reece394

description

Browser Caches

paths

15 paths
paths use Windows environment syntax

collection commands

# PowerShell Artifact Collection Script
# Target: BrowserCache
# Run as Administrator

#Requires -RunAsAdministrator

$ErrorActionPreference = "SilentlyContinue"
$DestBase = "D:\Evidence"

# Function to handle artifact collection with robocopy
function Collect-Artifact {
    param (
        [string]$SourceDir,
        [string]$FolderName,
        [string]$FileMask = "*"
    )
    $FullDest = Join-Path -Path $DestBase -ChildPath $FolderName
    robocopy "$SourceDir" "$FullDest" "$FileMask" /E /COPY:DAT /R:0 /W:0 /NP /NFL /NDL /NJH /NJS | Out-Null
}

# 1. Chrome Cache Folder
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Google\Chrome\User Data\*\Cache\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "Chrome_Cache_Folder"

# 2. Chrome Beta Cache Folder
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Google\Chrome Beta\User Data\*\Cache\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "Chrome_Beta_Cache_Folder"

# 3. Chrome Dev Cache Folder
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Google\Chrome Dev\User Data\*\Cache\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "Chrome_Dev_Cache_Folder"

# 4. Chrome SxS - Canary Cache Folder
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Google\Chrome SxS\User Data\*\Cache\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "Chrome_SxS___Canary_Cache_Folder"

# 5. Chromium Edge Cache Folder
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Microsoft\Edge\User Data\*\Cache\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "Chromium_Edge_Cache_Folder"

# 6. Chromium Edge Beta Cache Folder
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Microsoft\Edge Beta\User Data\*\Cache\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "Chromium_Edge_Beta_Cache_Folder"

# 7. Chromium Edge Dev Cache Folder
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Microsoft\Edge Dev\User Data\*\Cache\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "Chromium_Edge_Dev_Cache_Folder"

# 8. Chromium Edge SxS - Canary Cache Folder
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Microsoft\Edge SxS\User Data\*\Cache\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "Chromium_Edge_SxS___Canary_Cache_Folder"

# 9. Chromium Cache Folder
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Chromium\User Data\*\Cache\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "Chromium_Cache_Folder"

# 10. Firefox Cache Folder
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Mozilla\Firefox\Profiles\*\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "Firefox_Cache_Folder"

# 11. IE 9/10 Cache
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Microsoft\Windows\Temporary Internet Files\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "IE_9_10_Cache"

# 12. IE Index.dat temp internet files
$UserPath = Join-Path $env:USERPROFILE "Local Settings\Temporary Internet Files\Content.IE5\"
Collect-Artifact -SourceDir "$UserPath" -FileMask "index.dat" -FolderName "IE_Index_dat_temp_internet_files"

# 13. IE 11 Cache
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Microsoft\Windows\INetCache\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "IE_11_Cache"

# 14. Edge WebcacheV01.dat
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Microsoft\Windows\WebCache\"
Collect-Artifact -SourceDir "$UserPath" -FolderName "Edge_WebcacheV01_dat"

# 15. Brave Cache Folder
Collect-Artifact -SourceDir "C:\Users\%users%\AppData\Local\BraveSoftware\Brave-Browser\User Data\Default\Cache\Cache_Data" -FolderName "Brave_Cache_Folder"

Write-Host "Collection complete!" -ForegroundColor Green

Save as .ps1 and run as Administrator. Use: powershell -ExecutionPolicy Bypass -File script.ps1