destrabar pgina #10

Open
opened 2026-10-09 16:34:49 +00:00 by alexrg · 0 comments
Owner
$guid = "{D0BEFEFB-3D2C-44DA-BBAD-3B2D04557246}"

$base = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication"
$base32 = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Authentication"

$keys = @(
    "$base\Credential Provider Filters\$guid",
    "$base32\Credential Provider Filters\$guid",
    "$base\Credential Providers\$guid",
    "$base32\Credential Providers\$guid",
    "HKCR\CLSID\$guid"
)

$backup = "C:\ProgramData\pGina-CP-backup"
New-Item -ItemType Directory -Path $backup -Force | Out-Null

$found = @()

# Primero respaldar todas las claves existentes
foreach ($key in $keys) {
    reg.exe query $key *> $null

    if ($LASTEXITCODE -eq 0) {
        $file = Join-Path $backup "key-$($found.Count).reg"

        reg.exe export $key $file /y

        if ($LASTEXITCODE -ne 0) {
            throw "Error respaldando $key"
        }

        $found += $key
    }
}

# Eliminar únicamente los registros identificados
foreach ($key in $found) {
    reg.exe delete $key /f

    if ($LASTEXITCODE -ne 0) {
        Write-Warning "No se pudo eliminar $key"
    }
}

Write-Host "Registros procesados: $($found.Count)"
Write-Host "Respaldos: $backup"
```ps1 $guid = "{D0BEFEFB-3D2C-44DA-BBAD-3B2D04557246}" $base = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication" $base32 = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Authentication" $keys = @( "$base\Credential Provider Filters\$guid", "$base32\Credential Provider Filters\$guid", "$base\Credential Providers\$guid", "$base32\Credential Providers\$guid", "HKCR\CLSID\$guid" ) $backup = "C:\ProgramData\pGina-CP-backup" New-Item -ItemType Directory -Path $backup -Force | Out-Null $found = @() # Primero respaldar todas las claves existentes foreach ($key in $keys) { reg.exe query $key *> $null if ($LASTEXITCODE -eq 0) { $file = Join-Path $backup "key-$($found.Count).reg" reg.exe export $key $file /y if ($LASTEXITCODE -ne 0) { throw "Error respaldando $key" } $found += $key } } # Eliminar únicamente los registros identificados foreach ($key in $found) { reg.exe delete $key /f if ($LASTEXITCODE -ne 0) { Write-Warning "No se pudo eliminar $key" } } Write-Host "Registros procesados: $($found.Count)" Write-Host "Respaldos: $backup" ```
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: alexrg/SGU-CredentialProvider#10