Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- OPZIONI="SOCKS_proxy specific_port_tunnel exit"
- function SOCKS {
- echo "[+] Insert the port on which the proxy will listen:"
- read PORTASOCKS
- echo "[+] Setting up proxy..."
- ssh -f -D 0.0.0.0:$PORTASOCKS $IP -p $PORT -N > /dev/null
- echo "[+] Proxy set up."
- return 0
- }
- function SPECIFICPORT {
- echo "[+] Insert the IP of the of the remote machine towards which the tunnel will be opened:"
- read REMOTEIP
- echo "[+] Insert the local port on which the tunnel will listen:"
- read LOCALPORT
- echo "[+] Insert the port of the remote machine towards which the tunnel should point:"
- read REMOTEPORT
- echo "[+] Setting up tunnel..."
- ssh -f -L 0.0.0.0:$LOCALPORT:$REMOTEIP:$REMOTEPORT $IP -p $PORT -N > /dev/null
- echo "[+] Tunnel set up"
- return 0
- }
- function IPANDPORT {
- echo "[+] Insert the (user@)IP of the jump box:"
- read IP
- echo "[+] Insert the port on which SSH is listening on the jump box:"
- read PORT
- return 0
- }
- echo "[+] What do you want to do?"
- select opt in $OPZIONI; do
- if [ "$opt" = "SOCKS_proxy" ]; then
- IPANDPORT
- SOCKS
- elif [ "$opt" = "specific_port_tunnel" ]; then
- IPANDPORT
- SPECIFICPORT
- elif [ "$opt" = "esci" ]; then
- exit
- else
- echo "[-] Unknown option"
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement