The gMan nixWiki

Because the mind is made of Teflon...

User Tools

Site Tools


cheat_sheets_ps

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cheat_sheets_ps [2022/12/29 23:37] gmancheat_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 (PSscripts or not: +PowerShell (PS) execution policies determine your authorization to execute PS scripts or not: 
   - **Restricted:** [default] Blocks all use of PS scripts   - **Restricted:** [default] Blocks all use of PS scripts
   - **AllSigned:** Requires PS scripts to e signed by a trusted publisher   - **AllSigned:** Requires PS scripts to e signed by a trusted publisher
Line 11: Line 11:
   - **Unrestricted:** Allows any PS script but prompts you for confirmation on downloaded scripts.   - **Unrestricted:** Allows any PS script but prompts you for confirmation on downloaded scripts.
   - **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: 
 +
 +<code>
 +Set-ExecutionPolicy [name]
 +# Example:
 +Set-ExecutionPolicy RemoteSigned
 +</code>
 +
 +----
  
 ===== 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:\Windows\Temp using the same name:  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:\Windows\Temp using the same name: 
Line 20: Line 32:
 </code> </code>
  
----- +==== For Loop ====
- +
-**Example: For Loop**+
  
 <code> <code>
Line 40: Line 50:
 </code> </code>
  
----- +==== Conditional Stmt ====
- +
-**Example: Conditional**+
  
 <code> <code>
cheat_sheets_ps.1672357037.txt.gz · Last modified: by gman