-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
65 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
33 changes: 33 additions & 0 deletions
33
src/exploit/windows/powershell/powershell-executionpolicy-bypass.md
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- | ||
title: PowerShell ExecutionPolicy Bypass | ||
description: | ||
tags: | ||
- Windows | ||
refs: | ||
date: 2024-08-28 | ||
draft: false | ||
--- | ||
|
||
## Method 1. Set-ExecutionPolicy | ||
|
||
By default, the ExecutionPolicy is set to `Restricted`. | ||
|
||
```bash | ||
Get-ExecutionPolicy | ||
# Restricted | ||
``` | ||
|
||
To bypass the restriction, run one of the following commands as **Administrator** privilege: | ||
|
||
```bash | ||
Set-ExecutionPolicy Unrestricted | ||
Set-ExecutionPolicy Bypass | ||
``` | ||
|
||
<br /> | ||
|
||
## Method 2. Run with `-ExecutionPolicy Bypass` | ||
|
||
```bash | ||
powershell -noexit -ExecutionPolicy Bypass -File example.ps1 | ||
``` |
This file contains 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