InternetExplorer
Browsersv1
Author: Eric Zimmerman
description
Internet Explorer
paths
13 paths
› paths use Windows environment syntax
collection commands
# PowerShell Artifact Collection Script
# Target: InternetExplorer
# Run as Administrator
#Requires -RunAsAdministrator
$ErrorActionPreference = "Continue"
$SourceRoot = "C:"
$DestBase = "D:\Evidence"
$Summary = @{ Copied = 0; Missed = 0; Errors = 0 }
function Collect-Artifact {
param(
[Parameter(Mandatory)][string]$SourceDir,
[Parameter(Mandatory)][string]$FolderName,
[string]$FileMask = "*"
)
# Expand wildcards in any path segment (e.g. 'Program Files*',
# 'ScreenConnect Client*'). robocopy itself does not glob the source.
$sources = @(Get-Item -Path $SourceDir -ErrorAction SilentlyContinue |
Where-Object { $_.PSIsContainer })
if ($sources.Count -eq 0) {
$Summary.Missed++
return
}
$FullDest = Join-Path -Path $DestBase -ChildPath $FolderName
$null = New-Item -ItemType Directory -Force -Path $FullDest -ErrorAction SilentlyContinue
foreach ($src in $sources) {
robocopy $src.FullName "$FullDest" "$FileMask" /E /COPY:DAT /R:0 /W:0 /NP /NFL /NDL /NJH /NJS 2>$null | Out-Null
if ($LASTEXITCODE -le 7) { $Summary.Copied++ } else { $Summary.Errors++ }
}
}
# Iterate every user profile under the source drive
Get-ChildItem "$SourceRoot\Users" -Directory -ErrorAction SilentlyContinue |
Where-Object { $_.Name -notin @('All Users', 'Default', 'Default User', 'Public') } |
ForEach-Object {
$UserName = $_.Name
# Index.dat History
$UserPath = "$($_.FullName)\Local Settings\History\History.IE5"
Collect-Artifact -SourceDir $UserPath -FileMask "index.dat" -FolderName "Index_dat_History_$UserName"
# Index.dat History subdirectory
$UserPath = "$($_.FullName)\Local Settings\History\History.IE5\*"
Collect-Artifact -SourceDir $UserPath -FileMask "index.dat" -FolderName "Index_dat_History_subdirectory_$UserName"
# Index.dat cookies
$UserPath = "$($_.FullName)\Cookies"
Collect-Artifact -SourceDir $UserPath -FileMask "index.dat" -FolderName "Index_dat_cookies_$UserName"
# Index.dat UserData
$UserPath = "$($_.FullName)\Application Data\Microsoft\Internet Explorer\UserData"
Collect-Artifact -SourceDir $UserPath -FileMask "index.dat" -FolderName "Index_dat_UserData_$UserName"
# Index.dat Office XP
$UserPath = "$($_.FullName)\Application Data\Microsoft\Office\Recent"
Collect-Artifact -SourceDir $UserPath -FileMask "index.dat" -FolderName "Index_dat_Office_XP_$UserName"
# Index.dat Office
$UserPath = "$($_.FullName)\AppData\Roaming\Microsoft\Office\Recent"
Collect-Artifact -SourceDir $UserPath -FileMask "index.dat" -FolderName "Index_dat_Office_$UserName"
# Local Internet Explorer folder
$UserPath = "$($_.FullName)\AppData\Local\Microsoft\Internet Explorer"
Collect-Artifact -SourceDir $UserPath -FolderName "Local_Internet_Explorer_folder_$UserName"
# Roaming Internet Explorer folder
$UserPath = "$($_.FullName)\AppData\Roaming\Microsoft\Internet Explorer"
Collect-Artifact -SourceDir $UserPath -FolderName "Roaming_Internet_Explorer_folder_$UserName"
# IE 9/10 History
$UserPath = "$($_.FullName)\AppData\Local\Microsoft\Windows\History"
Collect-Artifact -SourceDir $UserPath -FolderName "IE_9_10_History_$UserName"
# IE 9/10 Cookies
$UserPath = "$($_.FullName)\AppData\Local\Microsoft\Windows\Cookies"
Collect-Artifact -SourceDir $UserPath -FolderName "IE_9_10_Cookies_$UserName"
# IE 9/10 Download History
$UserPath = "$($_.FullName)\AppData\Local\Microsoft\Windows\IEDownloadHistory"
Collect-Artifact -SourceDir $UserPath -FolderName "IE_9_10_Download_History_$UserName"
# IE 11 Metadata
$UserPath = "$($_.FullName)\AppData\Local\Microsoft\Windows\WebCache"
Collect-Artifact -SourceDir $UserPath -FolderName "IE_11_Metadata_$UserName"
# IE 11 Cookies
$UserPath = "$($_.FullName)\AppData\Local\Microsoft\Windows\INetCookies"
Collect-Artifact -SourceDir $UserPath -FolderName "IE_11_Cookies_$UserName"
}
Write-Host ("Collection complete. Copied: {0} Missed: {1} Errors: {2}" -f $Summary.Copied, $Summary.Missed, $Summary.Errors) -ForegroundColor Green› Save as .ps1 and run as Administrator. Use: powershell -ExecutionPolicy Bypass -File script.ps1
› cyberchef recipes
Open in CyberChef to decode values extracted from this artifact.