Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

PowerShell Obfuscator

A Python utility that applies configurable layers of encryption and compression to a PowerShell script, producing an obfuscated payload with a self-contained decoding stub.

Features

  • Fernet symmetric encryption per obfuscation layer
  • Chained Base64 encoding, zlib, and gzip compression
  • Auto-generated PowerShell decoder stub that reverses the process and executes the original script
  • Configurable layer count

Requirements

  • Python 3.10+
  • cryptography
pip install -r requirements.txt

Usage

python main.py <script.ps1> [-l LAYERS] [-o OUTPUT]
Argument Description Default
<script.ps1> Path to the input PowerShell script
-l, --layers Number of obfuscation layers 3
-o, --output Output file path obfuscated.ps1

Example

python main.py examples/sample.ps1 -l 4 -o out.ps1

How it works

  1. Reads the input .ps1 script
  2. For each layer: generates a fresh Fernet key, encrypts the payload, then applies Base64 → zlib → gzip compression
  3. Bundles all keys and the encoded payload into a PowerShell decoder stub
  4. Writes the final script to the output path

⚠️ Responsible use

The generated script embeds decryption keys inline. This tool is intended for legitimate use cases such as payload testing and AV evasion research in authorized environments. Do not use it against systems you do not own or have explicit permission to test.

License

MIT

About

A Python utility that applies configurable layers of encryption and compression to a PowerShell script, producing an obfuscated payload with a self-contained decoding stub.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages