Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- PROXY_LIST_FILE="proxy_list.txt"
- SOCKS_LIST_FILE="socks_list.txt"
- TEST_HOST="https://storage.swgt.ru"
- _proxy_checker() {
- for proxy in $(cat ${PROXY_LIST_FILE})
- do
- IFS=":" p=(${proxy}) IFS=" "
- target_host="${p[0]}"
- target_port="${p[1]}"
- target_user="${p[2]}"
- target_pass="${p[3]}"
- curl -x ${target_user}:${target_pass}@${target_host}:${target_port} -4sIL ${TEST_HOST} | grep -q 'HTTP.*403'
- if [ $? == 0 ]
- then
- echo "Testing proxy: ${proxy}, work"
- else
- echo "Testing proxy: ${proxy}, not work"
- fi
- done
- }
- _socks_checker() {
- for socks in $(cat ${SOCKS_LIST_FILE})
- do
- IFS=":" p=(${socks}) IFS=" "
- target_host="${p[0]}"
- target_port="${p[1]}"
- target_user="${p[2]}"
- target_pass="${p[3]}"
- curl -x socks5://${target_user}:${target_pass}@${target_host}:${target_port} -4sIL ${TEST_HOST} | grep -q 'HTTP.*403'
- if [ $? == 0 ]
- then
- echo "Testing socks: ${socks}, work"
- else
- echo "Testing socks: ${socks}, not work"
- fi
- done
- }
- case "$1" in
- socks) _socks_checker ;;
- proxy) _proxy_checker ;;
- esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement