pwn3d.es

TECHNICAL SHEET · Red Team

LIMITED DEMO

EnvObfuscatorPS

Obfuscation using environment variables.

PythonPowerShell
Language
Python
Platform
Windows
Type
Obfuscation script
Web demo
No

What it is

The tool indexes the printable characters available in variables such as $env:TMP, $env:SystemRoot or $env:APPDATA and replaces each letter of the original command with a reference like $env:VAR[position]. It then joins the fragments with -Join and runs the result in memory with iex, so the final text no longer resembles the command being executed.

What it is for

It is a clear case of obfuscation-based evasion: it explains why static signatures fall short and why script-block logging, AMSI and process-tree inspection matter.

How it is used

Windows and Python 3.6+ with no dependencies to generate; the sheet requires running nothing.

Illustrative pattern (not executed)
& ($env:TMP[2], $env:SystemRoot[10] -Join '')

Workflow

  1. Map printable characters to positions inside environment variables.

  2. Replace each command character with $env:VAR[n].

  3. Join the fragments with -Join.

  4. Execute in memory with iex and no file on disk.

Sheet built from the repository README and public code. Figures and commands are limited to what the project documents.

git · repository code

Explore the repository

$ git ls-tree -r EnvObfuscatorPSLoading the repository tree…