Advertisement
sufehmi

Access a Website with Random IP address & Random user agents

Mar 16th, 2018
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.25 KB | None | 0 0
  1. # you'll need a file named user_agents.txt, containing list of user-agents string
  2. # a list of User Agents string can be obtained here : https://pastebin.com/w8FYemC0
  3.  
  4. ######## one-line version ########
  5.  
  6. while true ; do user_agents_total=$(wc -l user_agents.txt | awk '{print $1}') ; user_agent_random=$(cat user_agents.txt | while read user_agent ;   do  echo "`expr $RANDOM % $user_agents_total`:$user_agent" ;    done | sort -n | sed 's/[0-9]*://' | head -1) ;  torsocks wget -U "$user_agent_random" -O /dev/null https://YourWebsite.com/ ; /etc/init.d/tor restart ; sleep $(( ( RANDOM % 10 )  + 1 )) ; done
  7.  
  8.  
  9. ######## normal version ########
  10.  
  11. while true  
  12. do
  13.     # get a random User-Agents string
  14.     user_agents_total=$(wc -l user_agents.txt | awk '{print $1}')
  15.     user_agent_random=$(cat user_agents.txt | while read user_agent
  16.         do  
  17.              echo "`expr $RANDOM % $user_agents_total`:$user_agent"
  18.         done | sort -n | sed 's/[0-9]*://' | head -1)
  19.  
  20.     torsocks wget -U "$user_agent_random" -O /dev/null https://YourWebsite.com/
  21.  
  22.     # restarting Tor will cause us to switch to another Tor node = different IP address
  23.     /etc/init.d/tor restart
  24.  
  25.     # hold off / delay for random amount of tim
  26.     sleep $(( ( RANDOM % 10 )  + 1 ))
  27. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement