
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"라는 변수에 큰 문자열을 저장합니다.
- 두 번째 줄 "암호화된 표준 문자열을 보안 문자열로 변환"은 비밀번호를 보호하기 위해 수행됩니다. https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.security/convertto-securestring?view=powershell-5.1
- 세 번째 줄은 암호를 노출하지 않고 PowerShell 스크립트에서 다른 명령을 인증하는 데 사용할 수 있는 PowerShell 자격 증명을 만듭니다. 그런 다음 해당 자격 증명에서 비밀번호를 가져옵니다. 그러면 암호화된 문자열이 일반 텍스트로 변환됩니다.
- 네 번째 줄은 "password"를 명령으로 실행합니다.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