dfirhub

RecentFolders

Author: Max Zabuty

description

Recent Folders LNK files

paths

2 paths
File and Folder UsageLNK Files from Recent
C:\Users\%user%\AppData\Roaming\Microsoft\Windows\Recent\
File and Folder UsageLNK Files from Microsoft Office Recent
C:\Users\%user%\AppData\Roaming\Microsoft\Office\Recent\
paths use Windows environment syntax

collection commands

# PowerShell Artifact Collection Script
# Target: RecentFolders
# 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. LNK Files from Recent
$UserPath = Join-Path $env:USERPROFILE "AppData\Roaming\Microsoft\Windows\Recent\"
Collect-Artifact -SourcePath "$UserPath\*" -FolderName "LNK_Files_from_Recent"

# 2. LNK Files from Microsoft Office Recent
$UserPath = Join-Path $env:USERPROFILE "AppData\Roaming\Microsoft\Office\Recent\"
Collect-Artifact -SourcePath "$UserPath\*" -FolderName "LNK_Files_from_Microsoft_Office_Recent"

Write-Host "Collection complete!" -ForegroundColor Green

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

references