rapid7/metasploit-framework — pull request #124 by sempervictus (2012-01-24 02:38:30+00:00)
Title: Powershell Additions - encoders and post module

This pull request adds the powershell encoder from Redmine #6049 (http://dev.metasploit.com/redmine/issues/6049).

I've also converted the posh.rb meterpreter script by nick [at] executionflow.org to a post module.The module adds substitution, output, and removal features, but the core functionality is pulled straight from the script. The module takes a local PS script, allows for text subs in memory prior to execution, ZLIB::Deflates, encodes, and executes the encoded PS string via CMD. The script also bypasses the CMD 8K limit by staging larger payloads within ENV. Post module output can be directed to log, or to log and console, and the module can execute the PS encoded payloads from 6049.

Tested against Server2008r2 and win7 pro (x64). Dont have any PS enabled 32bit systems on hand, though i can install on one if needed for testing.