Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
resinfo-gt
swmb
resinfo-swmb
Commits
3abd55fa
Commit
3abd55fa
authored
May 10, 2022
by
Olivier De Marchi
Browse files
add Network Agent password in set-password
parent
e98fea25
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
dists/uninstall-kaspersky/set-password-encrypted.ps1
dists/uninstall-kaspersky/set-password-encrypted.ps1
+5
-0
No files found.
dists/uninstall-kaspersky/set-password-encrypted.ps1
View file @
3abd55fa
$KeyFile
=
Read-Host
-Prompt
"Key File (please put .key extension)"
$Password
=
Read-Host
-AsSecureString
-Prompt
"Password to secure"
$AgentPassword
=
Read-Host
-AsSecureString
-Prompt
"Network Agent Password to secure"
if
(
$KeyFile
)
{
$Key
=
New-Object
Byte
[]
32
# create key AES 256-bit key (32 bytes)
...
...
@@ -8,6 +9,7 @@ if ($KeyFile) {
$Key
|
Out-File
$KeyFile
$EncryptedPass
=
ConvertFrom-SecureString
-SecureString
$Password
-Key
$Key
$AgentEncryptedPass
=
ConvertFrom-SecureString
-SecureString
$AgentPassword
-Key
$Key
}
Write-Output
""
...
...
@@ -15,6 +17,7 @@ Write-Output "# Lines to add in your configuration file Custom-VarOverload.psm1"
Write-Output
"# or in the auto delete one Custom-VarAutodel.psm1"
Write-Output
""
Write-Output
"
`$
Global:SWMB_Custom.KesSecureString = '
$EncryptedPass
'"
Write-Output
"
`$
Global:SWMB_Custom.AgentSecureString = '
$AgentEncryptedPass
'"
Write-Output
"
`$
Global:SWMB_Custom.KesKeyFile = '
$KeyFile
'"
Write-Output
""
...
...
@@ -24,6 +27,7 @@ If (!(Test-Path -LiteralPath ".\Custom-VarAutodel.psm1")) {
Write-Output
"
# Configuration for Kaspersky Endpoint
`$
Global:SWMB_Custom.KesSecureString = '
$EncryptedPass
'
`$
Global:SWMB_Custom.AgentSecureString = '
$AgentEncryptedPass
'
`$
Global:SWMB_Custom.KesKeyFile = '
$KeyFile
'
"
|
Out-File
-FilePath
".\Custom-VarAutodel.psm1"
-NoClobber
}
...
...
@@ -33,6 +37,7 @@ If (!(Test-Path -LiteralPath ".\Custom-VarAutodel.psm1")) {
Write-Output
"
# Configuration for Kaspersky Endpoint
`$
Global:SWMB_Custom.KesSecureString = '
$EncryptedPass
'
`$
Global:SWMB_Custom.AgentSecureString = '
$AgentEncryptedPass
'
`$
Global:SWMB_Custom.KesKeyFile = '
$KeyFile
'
"
|
Out-File
-FilePath
".\Custom-VarOverload.psm1"
-Append
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment