rapid7/metasploit-framework — pull request #2946 by jlee-r7 (2014-02-05 00:12:38+00:00)
Title: Shellcode golf

This shaves 3 bytes off of block_api, which is used by almost all windows payloads, and more from the reverse_http(s) stagers.

This also fixes a bug introduced by #2448, 063da8a, where the bind address and port get embedded into reverse_https_proxy payloads instead of LHOST and LPORT.

# Verification

- [ ] `cd external/source/shellcode/windows/x86; python build.py stager_reverse_http` - verify the output matches what's in `modules/payloads/stagers/windows/reverse_http`
- [ ] use a windows exploit (I tested with psexec and ms08-67) and `set PAYLOAD windows/meterpreter/reverse_http`. verify it yields a working shell
- [ ] `cd external/source/shellcode/windows/x86; python build.py stager_reverse_https` - verify the output matches what's in `modules/payloads/stagers/windows/reverse_https`
- [ ] use ms08_067_netapi and `set PAYLOAD windows/meterpreter/reverse_https`. **before:** verify no encoders succeeded. **after:** verify it yields a working shell

- [ ] use a windows exploit and `set PAYLOAD windows/meterpreter/reverse_tcp`. verify it yields a working shell
- [ ] use a windows exploit and `set PAYLOAD windows/meterpreter/reverse_tcp_rc4`. verify it yields a working shell
- [ ] use a windows exploit and `set PAYLOAD windows/meterpreter/bind_tcp`. verify it yields a working shell
- [ ] use a windows exploit and `set PAYLOAD windows/meterpreter/bind_tcp_rc4`. verify it yields a working shell