metasploit团队将msfpayload&msfencode更改为msfvenom,因此我将上述代码转换为msfvenom:

这条命令在kali2.0已经不行了

msfpayload windows/exec cmd=calc.exe R | msfencode -e x86/alpha_mixed -t c -v

kali 2.0下生成方法

msfvenom -a x86 –platform windows -p windows/exec cmd=calc.exe -e x86/alpha_mixed -f c