Advertisement
Guest User

Untitled

a guest
Nov 17th, 2017
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. PROXY_LIST_FILE="proxy_list.txt"
  4. SOCKS_LIST_FILE="socks_list.txt"
  5. TEST_HOST="https://storage.swgt.ru"
  6.  
  7. _proxy_checker() {
  8. for proxy in $(cat ${PROXY_LIST_FILE})
  9. do
  10. IFS=":" p=(${proxy}) IFS=" "
  11. target_host="${p[0]}"
  12. target_port="${p[1]}"
  13. target_user="${p[2]}"
  14. target_pass="${p[3]}"
  15. curl -x ${target_user}:${target_pass}@${target_host}:${target_port} -4sIL ${TEST_HOST} | grep -q 'HTTP.*403'
  16. if [ $? == 0 ]
  17. then
  18. echo "Testing proxy: ${proxy}, work"
  19. else
  20. echo "Testing proxy: ${proxy}, not work"
  21. fi
  22. done
  23. }
  24.  
  25. _socks_checker() {
  26. for socks in $(cat ${SOCKS_LIST_FILE})
  27. do
  28. IFS=":" p=(${socks}) IFS=" "
  29. target_host="${p[0]}"
  30. target_port="${p[1]}"
  31. target_user="${p[2]}"
  32. target_pass="${p[3]}"
  33. curl -x socks5://${target_user}:${target_pass}@${target_host}:${target_port} -4sIL ${TEST_HOST} | grep -q 'HTTP.*403'
  34. if [ $? == 0 ]
  35. then
  36. echo "Testing socks: ${socks}, work"
  37. else
  38. echo "Testing socks: ${socks}, not work"
  39. fi
  40. done
  41. }
  42.  
  43. case "$1" in
  44. socks) _socks_checker ;;
  45. proxy) _proxy_checker ;;
  46. esac
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement