
5cfdf61c454c1fc5e9f0fcad2d12d5ef.ps1
私のコンピューター上に次のスクリプトが見つかりました:
$pyfwthc = # this is just a TON of random letters and numbers didnt wanna waste the space and its probably not important (encrypted maybe?)
$sstring = ConvertTo-SecureString $pyfwthc
$script = (New-Object system.Management.Automation.PSCredential("pyfwthc", $sstring)).GetNetworkCredential().Password
Invoke-Expression $script
これは心配すべきことでしょうか?
答え1
詳しく見ていきましょう。
- 最初の行では、その大きな文字列を「pyfwthc」という変数に格納します。
- 2 行目の「暗号化された標準文字列を安全な文字列に変換します」は、パスワードを保護するために行われます。 https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/convertto-securestring?view=powershell-5.1
- 3 行目は、パスワードを公開せずに PowerShell スクリプトから他のコマンドを認証するために使用できる PowerShell 資格情報を作成します。次に、その資格情報からパスワードを抽出します。これにより、暗号化された文字列がプレーン テキストに変換されます。
- 4 行目は「パスワード」をコマンドとして実行します。https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/invoke-expression?view=powershell-5.1
更新: 他のユーザーが指摘したように、パスワード文字列はコマンドとして実行されています。$script の値をファイルにダンプして、何が実行されているかを確認できるようにします。
スクリプトから最後の行を削除して実行します。
echo $script > this_is_the_script.file