Skip to content

Instantly share code, notes, and snippets.

@shahinam2
Forked from sae13/tun2proxy.sh
Created February 3, 2025 08:56
Show Gist options
  • Save shahinam2/6a54649d02f78b29a2279c98f811255e to your computer and use it in GitHub Desktop.
Save shahinam2/6a54649d02f78b29a2279c98f811255e to your computer and use it in GitHub Desktop.
idea account copiliot account through proxy
#!/bin/bash
mkdir -p /home/saeb/App/tun2proxy >/dev/null 2>&1
cd /home/saeb/App/tun2proxy || true
aria2c -x 16 -k1m -s 16 -c "https://github.com/tun2proxy/tun2proxy/releases/latest/download/tun2proxy-x86_64-unknown-linux-gnu.zip"
7z x -aoa tun2proxy-x86_64-unknown-linux-gnu.zip
sudo ip tuntap add name tun0 mode tun
sudo ip link set tun0 up
# Define array of domains
domains=(
"account.jetbrains.com"
"api.jetbrains.ai"
"downloads.marketplace.jetbrains.com"
"download-cdn.jetbrains.com"
"d3kdv2x2np28ys.cloudfront.net"
"api.github.com"
"westus-0.in.applicationinsights.azure.com"
"mobile.events.data.microsoft.com"
)
# Single loop through domains
for domain in "${domains[@]}"; do
readarray -t ips < <(dig "$domain" +short)
for ip in "${ips[@]}"; do
echo "$domain"
echo "sudo ip r add "$ip" dev tun0 >/dev/null 2>&1"
sudo ip r add "$ip" dev tun0 >/dev/null 2>&1
done
done
ip r
/home/saeb/App/tun2proxy/tun2proxy-bin --tun tun0 --proxy socks5://172.16.6.81:13741
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment