dfirhub

PowerShellTranscripts

Author: Andrew Rathbun and Chad Tilbury

description

PowerShell Transcripts

paths

6 paths
PowerShellTranscriptsPowerShell Transcripts - Default Location
C:\Users\%user%\Documents\PowerShell_transcript.*.txt
PowerShellTranscriptsPowerShell Transcripts - Observed Location
C:\Users\%user%\Documents\20*\PowerShell_transcript.*.txt
PowerShellTranscriptsPowerShell Transcripts - Observed Location
C:\Windows\SysWOW64\*\PowerShell_transcript.*.txt
PowerShellTranscriptsPowerShell Transcripts - Observed Location
C:\Program Files\Amazon\Ec2ConfigService\Scripts\*\PowerShell_transcript.*.txt
PowerShellTranscriptsPowerShell Transcripts - Observed Location
C:\Windows\System32\*\PowerShell_transcript.*.txt
PowerShellTranscriptsPowerShell Transcripts - Observed Location
C:\PSTranscript\20*\PowerShell_transcript.*.txt
paths use Windows environment syntax

collection commands

# PowerShell Artifact Collection Script
# Target: PowerShellTranscripts
# 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. PowerShell Transcripts - Default Location
$UserPath = Join-Path $env:USERPROFILE "Documents\"
Collect-Artifact -SourcePath "$UserPath\PowerShell_transcript.*.txt" -FolderName "PowerShell_Transcripts___Default_Location"

# 2. PowerShell Transcripts - Observed Location
$UserPath = Join-Path $env:USERPROFILE "Documents\20*\"
Collect-Artifact -SourcePath "$UserPath\PowerShell_transcript.*.txt" -FolderName "PowerShell_Transcripts___Observed_Location"

# 3. PowerShell Transcripts - Observed Location
Collect-Artifact -SourcePath "C:\Windows\SysWOW64\*\\PowerShell_transcript.*.txt" -FolderName "PowerShell_Transcripts___Observed_Location"

# 4. PowerShell Transcripts - Observed Location
Collect-Artifact -SourcePath "C:\Program Files\Amazon\Ec2ConfigService\Scripts\*\\PowerShell_transcript.*.txt" -FolderName "PowerShell_Transcripts___Observed_Location"

# 5. PowerShell Transcripts - Observed Location
Collect-Artifact -SourcePath "C:\Windows\System32\*\\PowerShell_transcript.*.txt" -FolderName "PowerShell_Transcripts___Observed_Location"

# 6. PowerShell Transcripts - Observed Location
Collect-Artifact -SourcePath "C:\PSTranscript\20*\\PowerShell_transcript.*.txt" -FolderName "PowerShell_Transcripts___Observed_Location"

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.

references

included in collections