-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathghostswitch.sh
More file actions
67 lines (56 loc) · 1.67 KB
/
ghostswitch.sh
File metadata and controls
67 lines (56 loc) · 1.67 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/bash
G="\033[1;32m"
R="\033[1;31m"
Y="\033[1;33m"
C="\033[1;36m"
N="\033[0m"
banner() {
echo -e "${G}
##### #####
# # # # #### #### ##### # # # # # ##### #### # #
# # # # # # # # # # # # # # # #
# #### ###### # # #### # ##### # # # # # ######
# # # # # # # # # # ## # # # # # #
# # # # # # # # # # # ## ## # # # # # #
##### # # #### #### # ##### # # # # #### # #
GhostSwitch v1.0.1 - Auto Tor IP Changer
Author: HErl
Repo: https://github.com/petherl/ghostswitch.git
${N}"
}
check_tor() {
if ! command -v tor >/dev/null 2>&1; then
echo -e "${R}[-] Tor is not installed. Please install Tor manually using your package manager.${N}"
exit 1
fi
}
get_ip() {
curl --socks5-hostname 127.0.0.1:9050 -s http://checkip.amazonaws.com
}
change_ip() {
echo -e "${C}[#] Reloading Tor service...${N}"
sudo service tor reload
sleep 2
new_ip=$(get_ip)
echo -e "${G}[+] New IP: $new_ip${N}"
}
banner
check_tor
sudo service tor start
echo -e "${Y}[!] Set SOCKS Proxy in browser: 127.0.0.1:9050${N}"
echo -e "${C}[+] Delay between IP changes (seconds):${N} "
read delay
echo -e "${C}[+] Number of times to change IP (0 = infinite):${N} "
read count
if [[ "$count" == "0" ]]; then
echo -e "${R}[!] Infinite mode started. Press Ctrl+C to stop.${N}"
while true; do
sleep "$delay"
change_ip
done
else
for ((i=1; i<=count; i++)); do
sleep "$delay"
change_ip
done
fi