From 98d0a2fd6842fa5893e51b083225a9d23b5d1638 Mon Sep 17 00:00:00 2001 From: randomuser Date: Sun, 27 Nov 2022 16:53:16 +0000 Subject: [PATCH] remove proxtest as it hasn't really been used --- Makefile | 1 - sh/proxtest | 79 ----------------------------------------------------- 2 files changed, 80 deletions(-) delete mode 100755 sh/proxtest diff --git a/Makefile b/Makefile index 3078a76..6ec81c3 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,6 @@ sh: cp -f sh/connect $(DESTDIR)$(PREFIX)/bin cp -f sh/nws $(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/git-survey $(DESTDIR)$(PREFIX)/bin cp -f sh/vim-swap-handler $(DESTDIR)$(PREFIX)/bin diff --git a/sh/proxtest b/sh/proxtest deleted file mode 100755 index 6769690..0000000 --- a/sh/proxtest +++ /dev/null @@ -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