Get-ExecutionPolicy
현재 세션에 대한 실행 정책을 얻는 명령이다.
Get-ExecutionPolicy (Microsoft.PowerShell.Security) - PowerShell
To display the execution policies for each scope in the order of precedence, use Get-ExecutionPolicy -List. To see the effective execution policy for your PowerShell session use Get-ExecutionPolicy with no parameters. The effective execution policy is dete
docs.microsoft.com
처음에는 기본값으로 Restricted로 설정되어 있다.
아래 msdn 페이지에서 소개하고 있는 실행 정책의 종류는 아래와 같다.
각 정책에 대한 자세한 설명은 아래 문서를 참조해라.
- AllSigned
- Bypass
- RemoteSigned
- Restricted
- Undefined
- Unrestricted
about_Execution_Policies - PowerShell
Describes the PowerShell execution policies and explains how to manage them.
docs.microsoft.com
Set-ExecutionPolicy
악성코드 분석을 하면서 특정 방식으로 인코딩된 함수나 난독화된 파워쉘 스크립트 구문도 분석해야할 일이 있다.
Powershell ISE를 통해서 특정 코드를 수정하기 마련인데,
기본으로 설정되어 있는 실행 정책, Restricted에서는 파워쉘 스크립트 파일 실행을 막는다.
그래서 실행 정책을 Unrestricted로 변경해야 할 필요성이 생긴다.
실행 정책을 변경할 때 사용하는 명령어가 Set-ExecutionPolicy 명령이다.
(참고로 파워쉘을 관리자 권한으로 실행시켜야 한다.)
Set-ExecutionPolicy (Microsoft.PowerShell.Security) - PowerShell
The Set-ExecutionPolicy cmdlet changes PowerShell execution policies for Windows computers. For more information, see about_Execution_Policies. Beginning in PowerShell 6.0 for non-Windows computers, the default execution policy is Unrestricted and can't be
docs.microsoft.com
아래와 같은 형태로 현재 실행정책을 확인하고, 변경하고 잘 적용되었는지 확인하는 식으로 두 명령을 이용할 수 있다.
'Malware Analysis' 카테고리의 다른 글
VBA 사용자 정의 폼을 이용한 데이터 은닉 (1) | 2021.01.20 |
---|---|
블로그1 (0) | 2021.01.19 |
pcode2code 설치 및 간단한 실습 (0) | 2021.01.14 |
VBA 스톰핑(VBA Stomping) (2) | 2021.01.14 |
Windows 10 Home에서 어떻게 Windows defender의 실시간 보호 기능을 영구적으로 비활성화할 수 있을까? (0) | 2021.01.13 |