remove proxtest as it hasn't really been used
This commit is contained in:
parent
e3bd13a6c8
commit
98d0a2fd68
1
Makefile
1
Makefile
|
@ -17,7 +17,6 @@ sh:
|
||||||
cp -f sh/connect $(DESTDIR)$(PREFIX)/bin
|
cp -f sh/connect $(DESTDIR)$(PREFIX)/bin
|
||||||
cp -f sh/nws $(DESTDIR)$(PREFIX)/bin
|
cp -f sh/nws $(DESTDIR)$(PREFIX)/bin
|
||||||
cp -f sh/vol $(DESTDIR)$(PREFIX)/bin
|
cp -f sh/vol $(DESTDIR)$(PREFIX)/bin
|
||||||
cp -f sh/proxtest $(DESTDIR)$(PREFIX)/bin
|
|
||||||
cp -f sh/pco $(DESTDIR)$(PREFIX)/bin
|
cp -f sh/pco $(DESTDIR)$(PREFIX)/bin
|
||||||
cp -f sh/git-survey $(DESTDIR)$(PREFIX)/bin
|
cp -f sh/git-survey $(DESTDIR)$(PREFIX)/bin
|
||||||
cp -f sh/vim-swap-handler $(DESTDIR)$(PREFIX)/bin
|
cp -f sh/vim-swap-handler $(DESTDIR)$(PREFIX)/bin
|
||||||
|
|
79
sh/proxtest
79
sh/proxtest
|
@ -1,79 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
output_as_proxychains=1
|
|
||||||
randomize=1
|
|
||||||
choose=0
|
|
||||||
outputted_proxies=""
|
|
||||||
temp_output=$(mktemp)
|
|
||||||
while getopts ":pt:rc:" options; do
|
|
||||||
case $options in
|
|
||||||
p)
|
|
||||||
output_as_proxychains=0
|
|
||||||
;;
|
|
||||||
t)
|
|
||||||
temp_output=$OPTARG
|
|
||||||
;;
|
|
||||||
r)
|
|
||||||
randomize=0
|
|
||||||
;;
|
|
||||||
c)
|
|
||||||
choose=$OPTARG
|
|
||||||
;;
|
|
||||||
:)
|
|
||||||
printf "specify argument\n"
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
printf "what has happened\n"
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
# get the tor port number using this lsof incantination
|
|
||||||
torport=$(\
|
|
||||||
sudo lsof -nP -iTCP -sTCP:LISTEN | \
|
|
||||||
grep tor | \
|
|
||||||
awk -F'[ :]+' 'NR = 1 {print $10}'
|
|
||||||
)
|
|
||||||
|
|
||||||
curl --silent --preproxy socks5://127.0.0.1:$torport https://raw.githubusercontent.com/hookzof/socks5_list/master/proxy.txt -o $temp_output
|
|
||||||
|
|
||||||
printf "estimated worsecase run time: %i seconds\n" $(wc -l $temp_output | awk -F' ' '{print $1}') 1>&2
|
|
||||||
|
|
||||||
looped=$(\
|
|
||||||
cat $temp_output | \
|
|
||||||
( [ $randomize -eq 0 ] && shuf || cat ) | \
|
|
||||||
( [ $choose -ne 0 ] && head -n $choose || cat ) | \
|
|
||||||
tr '\n' ' ' | \
|
|
||||||
tr -d '\r'
|
|
||||||
)
|
|
||||||
|
|
||||||
for i in $looped; do
|
|
||||||
ip=$(printf $i | awk -F':' '{print $1}')
|
|
||||||
port=$(printf $i | awk -F':' '{print $2}' | tr -d '\r')
|
|
||||||
|
|
||||||
# TODO: timeout is a non-posix gnu extension, remove/replace it
|
|
||||||
timeout 2s nc -zv -x 127.0.0.1:$torport $ip $port 2>/dev/null 1>&2 && \
|
|
||||||
outputted_proxies="$outputted_proxies $i" && \
|
|
||||||
printf "success! %s\n" $i 1>&2 || \
|
|
||||||
printf "failure! %s\n" $i 1>&2
|
|
||||||
done
|
|
||||||
|
|
||||||
if [ $output_as_proxychains -eq 0 ]; then
|
|
||||||
printf "# generated by proxtest.sh @ %s\n" "$(date)"
|
|
||||||
printf "random_chain\nproxy_dns\nchain_len = 5\n"
|
|
||||||
printf "tcp_read_time_out 15000\ntcp_connect_time_out 8000\n"
|
|
||||||
printf "[ProxyList]\n"
|
|
||||||
|
|
||||||
# assumes all socks5 proxies, change this in future
|
|
||||||
for i in $outputted_proxies; do
|
|
||||||
printf "socks5 %s\n" "$(printf %s $i | tr ':' ' ')"
|
|
||||||
done
|
|
||||||
|
|
||||||
printf "# finished!\n"
|
|
||||||
else
|
|
||||||
for i in $outputted_proxies; do
|
|
||||||
printf "%s\n" $i
|
|
||||||
done
|
|
||||||
fi
|
|
Loading…
Reference in New Issue