dfirhub

Keepass

Author: Vito Alfano

description

Keepass

paths

3 paths
AppsKeepass User Config
C:\Users\%user%\AppData\Roaming\KeePass\*.xml

Collecting Keepass User Configuration File

AppsKeepass Config Xml
C:\Program Files\KeePass Password Safe*\*.xml

Collecting Keepass Configuration File

AppsKeepass Application Details
C:\Program Files\KeePass Password Safe*\*.config

Collecting Keepass Application Details

paths use Windows environment syntax

collection commands

# PowerShell Artifact Collection Script
# Target: Keepass
# 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. Keepass User Config
$UserPath = Join-Path $env:USERPROFILE "AppData\Roaming\KeePass\"
Collect-Artifact -SourcePath "$UserPath\*.xml" -FolderName "Keepass_User_Config"

# 2. Keepass Config Xml
Collect-Artifact -SourcePath "C:\Program Files\KeePass Password Safe*\\*.xml" -FolderName "Keepass_Config_Xml"

# 3. Keepass Application Details
Collect-Artifact -SourcePath "C:\Program Files\KeePass Password Safe*\\*.config" -FolderName "Keepass_Application_Details"

Write-Host "Collection complete!" -ForegroundColor Green

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

references