s4ros

strawpoll

Oct 7th, 2016
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.17 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [[ $# -lt 2 ]]; then
  4.   echo Usage: "<poll_id> <answer>"
  5.   exit 1
  6. fi
  7. poll_id=$1
  8. answer=$2
  9.  
  10. SITE=strawpoll.pl
  11. POST="a${answer}=on&action=vote_poll&poll_id=${poll_id}"
  12.  
  13. function ctrl_c() {
  14.   echo ctrl-c
  15.   killall -9 curl
  16.   exit 255
  17. }
  18.  
  19. # trap ctrl-c and call ctrl_c()
  20. trap ctrl_c INT SIGINT
  21.  
  22. function get_proxy() {
  23.   echo "... getting anonymous proxy list ..."
  24.   > .proxy-b64
  25.   for page in $(seq 1 10); do
  26.     curl -s https://proxy-list.org/english/index.php?p=${page} | grep 'class="proxy"' | cut -d "'" -f 2 | tail -n 14 >> .proxy-b64
  27.   done
  28.  
  29. echo "... decoding proxy list ..."
  30. > .proxy
  31. for proxy in $(cat .proxy-b64); do
  32.   decoded=$(echo $proxy | base64 -d)
  33.   echo $decoded | tee -a .proxy
  34. (  curl -s \
  35.     -connect-timeout 3 \
  36.     -H 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:46.0) Gecko/20100101 Firefox/46.0' \
  37.     -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
  38.     -H "Referer: http://$SITE" \
  39.     -H 'X-Requested-With: XMLHttpRequest' \
  40.     -x http://${decoded} \
  41.     -X POST --data "${POST}" http://${SITE}/ajax.php | python -m json.tool 2> /dev/null ) &
  42.  
  43. done
  44. }
  45.  
  46. get_proxy
  47.  
  48. # use .proxy file
Add Comment
Please, Sign In to add comment