Last active
February 3, 2018 11:09
-
-
Save socketz/c266e3e32c0bb32973d494d55ec206ba to your computer and use it in GitHub Desktop.
Iodine + Webproxy + Google Chrome Configuration Bash Scripts (Tested on Ubuntu 16.04 x64)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## | |
## IODINE + WEBPROXY CLIENT SNIPPET | |
## by @socketz | |
## | |
## Put your values | |
SSH_IP="1.2.3.4" | |
SSH_USER="user" | |
SSH_IDENTITY_PATH="/home/user/.ssh/id_rsa" | |
SSH_PORT="22" | |
IOD_DOMAIN="tunnel.mydomain.com" | |
IOD_IP="2.3.4.5" | |
IOD_PASS="123456" # Put a strong password | |
PROXY_SERVER="127.0.0.1" | |
PROXY_PORT="3456" | |
PROXY_SCHEME="socks5" # More schemes in google-chrome-stable --help | |
sudo sleep 0s # Force password ask | |
dots(){ | |
for i in {1..3} | |
do | |
echo -ne "."; | |
sleep 0.2s; | |
done | |
echo -ne "\n" | |
} | |
echo -ne "Creating iodine tunnel" && dots | |
sudo iodine -f -P $IOD_PASS $IOD_IP $IOD_DOMAIN &> iod.log & | |
echo $! > iod.pid | |
sleep 45s | |
pgrep -P $(cat iod.pid) > iod_children.pid | |
echo "Tunnel created!" | |
echo -ne "Creating proxy tunnel" && dots | |
ssh -D $PROXY_PORT -N -i ${SSH_IDENTITY_PATH} -p ${SSH_PORT} ${SSH_USER}@${SSH_IP} &> /dev/null & | |
echo $! > tunnel.pid | |
sleep 5s | |
echo "Proxy tunnel created" | |
echo -ne "Executing Google Chrome with proxy config" && dots | |
google-chrome-stable --proxy-server="${PROXY_SCHEME}://${PROXY_SERVER}:${PROXY_PORT}" &> chrome.log & | |
echo $! > chrome.pid | |
echo "Chrome executed!" | |
echo -e "\nTo kill all processes use kill_webproxy.sh\nThanks & share it!!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
iod_pid=$(cat iod_children.pid) | |
tun_pid=$(cat tunnel.pid) | |
chrome_pid=$(cat chrome.pid) | |
sudo kill -9 $iod_pid | |
sudo kill -9 $tun_pid | |
sudo kill -9 $chrome_pid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script serves the tunnel, put it on your server and execute it | |
# For more information how to configure your server, | |
# check this guide: https://gist.github.com/calzoneman/f9d0e5f023026e6a85c9 | |
IOD_IP="2.3.4.5" | |
IOD_PASS="123456" | |
IOD_DOMAIN="tunnel.mydomain.com" | |
sudo iodined -c -f $IOD_IP -P $IOD_PASS $IOD_DOMAIN |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment