notParsec / 문서전체 문서

데이터·검증 자료

evidence/display-session/collect-installed-vdd.ps1

design/evidence/display-session/collect-installed-vdd.ps1

출처: 현재 작업 폴더 · 원문 다운로드

# Read-only collection from the machine which actually has Parsec VDD installed.
# No installation, service changes, monitor IOCTLs, or subscription changes.
param([Parameter(Mandatory=$true)][string]$OutputDirectory)
$ErrorActionPreference = 'Stop'
New-Item -ItemType Directory -Path $OutputDirectory -Force | Out-Null
$paths = @("$env:windir\System32\drivers\UMDF\mm.dll")
$service = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WUDF\Services\ParsecVDA'
if (Test-Path $service) {
    $image = (Get-ItemProperty $service).ImagePath
    if ($image) { $paths += [Environment]::ExpandEnvironmentVariables($image) }
}
$report = foreach ($path in ($paths | Select-Object -Unique)) {
    if (Test-Path -LiteralPath $path) {
        $file = Get-Item -LiteralPath $path
        $hash = (Get-FileHash -LiteralPath $path -Algorithm SHA256).Hash.ToLowerInvariant()
        $signature = Get-AuthenticodeSignature -LiteralPath $path
        Copy-Item -LiteralPath $path -Destination (Join-Path $OutputDirectory "$hash-mm.dll")
        [pscustomobject]@{path=$path; sha256=$hash; bytes=$file.Length; version=$file.VersionInfo.FileVersion; signature=$signature.Status.ToString()}
    }
}
if (-not $report) { throw 'Installed Parsec mm.dll was not found; supply the actual driver location for analysis.' }
$report | ConvertTo-Json -Depth 4 | Set-Content -Encoding utf8 (Join-Path $OutputDirectory 'installed-vdd.json')
Write-Output "Collected driver binary and version/hash record in $OutputDirectory"