Notepad
Windowsv2
Author: Andrew Rathbun, ogmini
description
A Target to collect files that are currently open in Notepad (Windows 11+)
paths
4 paths
Windows NotepadNotepad Session Files
C:\Users\%user%\AppData\Local\Packages\Microsoft.WindowsNotepad_8wekyb3d8bbwe\LocalState\TabState*.binContains .bin files which consist of the files opened in each tab in Windows Notepad
Text EditorNotepad Window State Files
C:\Users\%user%\AppData\Local\Packages\Microsoft.WindowsNotepad_8wekyb3d8bbwe\LocalState\WindowState\*.binContains .bin files tracking the state of the Notepad Window
Text EditorNotepad Settings File
C:\Users\%user%\AppData\Local\Packages\Microsoft.WindowsNotepad_8wekyb3d8bbwe\Settings\settings.datRetrieves settings.dat which is an Application Registry
Text EditorNotepad Registry Hives
C:\Users\%user%\AppData\Local\Packages\Microsoft.WindowsNotepad_8wekyb3d8bbwe\SystemAppData\Helium*.datRetrieves User.dat and UserClasses.dat. User.dat contains MRU entries. UserClasses.dat contains Shell Bags.
› paths use Windows environment syntax
collection commands
# PowerShell Artifact Collection Script
# Target: Notepad
# Run as Administrator
#Requires -RunAsAdministrator
$ErrorActionPreference = "SilentlyContinue"
$DestBase = "D:\Evidence"
# Function to handle directory creation and copying
function Collect-Artifact {
param (
[string]$SourcePath,
[string]$FolderName
)
$FullDest = Join-Path -Path $DestBase -ChildPath $FolderName
if (-not (Test-Path -Path $FullDest)) {
New-Item -ItemType Directory -Path $FullDest -Force | Out-Null
}
Copy-Item -Path $SourcePath -Destination $FullDest -Recurse -Force
}
# 1. Notepad Session Files
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Packages\Microsoft.WindowsNotepad_8wekyb3d8bbwe\LocalState\TabState"
Collect-Artifact -SourcePath "$UserPath\*.bin" -FolderName "Notepad_Session_Files"
# 2. Notepad Window State Files
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Packages\Microsoft.WindowsNotepad_8wekyb3d8bbwe\LocalState\WindowState\"
Collect-Artifact -SourcePath "$UserPath\*.bin" -FolderName "Notepad_Window_State_Files"
# 3. Notepad Settings File
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Packages\Microsoft.WindowsNotepad_8wekyb3d8bbwe\Settings\"
Collect-Artifact -SourcePath "$UserPath\settings.dat" -FolderName "Notepad_Settings_File"
# 4. Notepad Registry Hives
$UserPath = Join-Path $env:USERPROFILE "AppData\Local\Packages\Microsoft.WindowsNotepad_8wekyb3d8bbwe\SystemAppData\Helium"
Collect-Artifact -SourcePath "$UserPath\*.dat" -FolderName "Notepad_Registry_Hives"
Write-Host "Collection complete!" -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.