rapid7/metasploit-framework — pull request #2475 by zeroSteiner (2013-10-07 15:30:22+00:00)
Title: Support ARCH_RUBY and ARCH_PYTHON payload conversion to ARCH_CMD

This pull request add support for exploits that use ARCH_CMD payloads to also support ARCH_RUBY and ARCH_PYTHON payloads via a to_command conversion function provided by their respective mixins. Both to_command functions convert the native script code to base64 and place it in an exec/eval call to avoid character restrictions.

Both the ruby and python payload mixins define their respective binary in RequiredCmd.

For Python specifically, the base64.b64decode() function should be favored over a strings decode method to eventually support Python3.x.