Yandex

Author: Sebastian Søgaard

description

Yandex Artifacts

paths

15 paths
paths use Windows environment syntax

collection commands

# PowerShell Artifact Collection Script
# Target: Yandex
# Run as Administrator

#Requires -RunAsAdministrator

$ErrorActionPreference = "Continue"
$SourceRoot = "C:"
$DestBase   = "D:\Evidence"
$Summary = @{ Copied = 0; Missed = 0; Errors = 0 }

function Collect-Artifact {
    param(
        [Parameter(Mandatory)][string]$SourceDir,
        [Parameter(Mandatory)][string]$FolderName,
        [string]$FileMask = "*"
    )
    # Expand wildcards in any path segment (e.g. 'Program Files*',
    # 'ScreenConnect Client*'). robocopy itself does not glob the source.
    $sources = @(Get-Item -Path $SourceDir -ErrorAction SilentlyContinue |
        Where-Object { $_.PSIsContainer })
    if ($sources.Count -eq 0) {
        $Summary.Missed++
        return
    }
    $FullDest = Join-Path -Path $DestBase -ChildPath $FolderName
    $null = New-Item -ItemType Directory -Force -Path $FullDest -ErrorAction SilentlyContinue
    foreach ($src in $sources) {
        robocopy $src.FullName "$FullDest" "$FileMask" /E /COPY:DAT /R:0 /W:0 /NP /NFL /NDL /NJH /NJS 2>$null | Out-Null
        if ($LASTEXITCODE -le 7) { $Summary.Copied++ } else { $Summary.Errors++ }
    }
}

# Iterate every user profile under the source drive
Get-ChildItem "$SourceRoot\Users" -Directory -ErrorAction SilentlyContinue |
    Where-Object { $_.Name -notin @('All Users', 'Default', 'Default User', 'Public') } |
    ForEach-Object {
        $UserName = $_.Name
        # Yandex Cookies
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Cookies*" -FolderName "Yandex_Cookies_$UserName"
        # Yandex Network Persistent State
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Network Persistent State" -FolderName "Yandex_Network_Persistent_State_$UserName"
        # Yandex Favicons
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Favicons*" -FolderName "Yandex_Favicons_$UserName"
        # Yandex History
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "History*" -FolderName "Yandex_History_$UserName"
        # Yandex Sessions Folder
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*\Sessions"
        Collect-Artifact -SourceDir $UserPath -FolderName "Yandex_Sessions_Folder_$UserName"
        # Yandex Login Data
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Ya Passman Data*" -FolderName "Yandex_Login_Data_$UserName"
        # Yandex Network Action Predictor
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Network Action Predictor" -FolderName "Yandex_Network_Action_Predictor_$UserName"
        # Yandex Preferences
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Preferences" -FolderName "Yandex_Preferences_$UserName"
        # Yandex Top Sites
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Top Sites*" -FolderName "Yandex_Top_Sites_$UserName"
        # Yandex Bookmarks
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Bookmarks*" -FolderName "Yandex_Bookmarks_$UserName"
        # Yandex Visited Links
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Visited Links" -FolderName "Yandex_Visited_Links_$UserName"
        # Yandex Web Data
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Web Data*" -FolderName "Yandex_Web_Data_$UserName"
        # Yandex Autofill data
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Ya Autofill Data*" -FolderName "Yandex_Autofill_data_$UserName"
        # Yandex Passman logs
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Passman Logs*" -FolderName "Yandex_Passman_logs_$UserName"
        # Yandex Shortcuts
        $UserPath = "$($_.FullName)\AppData\Local\Yandex\YandexBrowser\User Data\*"
        Collect-Artifact -SourceDir $UserPath -FileMask "Shortcuts*" -FolderName "Yandex_Shortcuts_$UserName"
    }

Write-Host ("Collection complete. Copied: {0}  Missed: {1}  Errors: {2}" -f $Summary.Copied, $Summary.Missed, $Summary.Errors) -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.

included in collections