-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxytest.sh
More file actions
33 lines (30 loc) · 997 Bytes
/
proxytest.sh
File metadata and controls
33 lines (30 loc) · 997 Bytes
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
#!/bin/bash
# This program gets ip from ifconfig.me with and without proxychains, checks lenght and compares addresses if valid.
# Dep: proxychains4, wget
# TODO: Add more sources, Add support for curl, Add support for older versions of proxychains
ip=$(wget -qO - http://ifconfig.me -o ip.log | grep '"ip_address"' | sed 's/[^0-9.]//g')
proxy_ip=$(proxychains4 -q wget -qO - http://ifconfig.me -o proxy.log | grep '"ip_address"' | sed 's/[^0-9.]//g')
wc_ip=$(echo "$ip" | wc -c - | sed 's/[^0-9]//g')
wc_proxy=$(echo "$proxy_ip" | wc -c - | sed 's/[^0-9]//g')
if [ $wc_ip -ge 8 ] && [ $wc_ip -lt 29 ]; then
if [ $wc_proxy -ge 8 ] && [ $wc_proxy -lt 29 ]; then
if [ "$ip" != "$proxy_ip" ]; then
echo "Proxy: active
Proxy: $proxy_ip
True: $ip"
else
echo "Proxy: inactive
Proxy: $proxy_ip
True: $ip"
fi
else
echo "Error
Proxy: $proxy_ip WC: $wc_proxy
True: $ip WC: $wc_ip"
fi
else
echo "Error
Proxy: $proxy_ip WC: $wc_proxy
True: $ip WC: $wc_ip"
fi
exit