Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- ########################################################################
- #
- # randsurf
- # (c) 2013 Elias Schwerdtfeger, http://www.tamagothi.de/
- #
- # Sending randomized search requests to popular search engine to make
- # NSA tracking more senseless.
- #
- # This software is licensed under the terms of the pirate's license.
- # Share and enjoy, but don't sue me! ;)
- #
- # http://www.tamagothi.de/impressum/lizenz/
- #
- # $Id: randsurf,v 1.2 2013/07/10 12:08:51 elias Exp $
- #
- ########################################################################
- PATH=/bin:/usr/bin
- ########################################################################
- #
- # Configuration
- # Change settings here
- #
- ########################################################################
- #
- # Wordlist to use
- # ---------------
- #
- # A german wordlist
- #
- wordlist=/usr/share/dict/ngerman
- #
- # Most people prefer English... ;)
- #
- # wordlist=/usr/share/dict/words
- #
- #
- # Randomizer settings
- # -------------------
- #
- # If you invoke the script via crontab, you probably want some
- # irregularity. A request every five minutes is easy to detect as
- # mechanical request, so better wait a random amount of time. And
- # don't do it on every invocation, do it only sometimes. That
- # looks much less automatically performed and helps to make filtering
- # your real searches out of the noise more challenging for the
- # "United Stasi of America". ;)
- #
- # Percentage of execution
- #
- search_percent=50
- #
- # Maximal random delay in seconds before a search request is performed
- #
- search_delay=299
- #
- # Search engine URI
- # I use the german google here
- #
- search_uri='http://www.google.de/search?q='
- #
- # Faked user agent
- # Just an example. Use the user agent string of your preferred browser here
- user_agent='Mozilla/5.0 (Windows NT 5.1; rv:16.0) Gecko/20100101 Firefox/16.0'
- ########################################################################
- #
- # Program
- # Change the following lines only if you know what you are doing...
- #
- ########################################################################
- # Cannot use $RANDOM if someone doesn't use bash
- set `awk "END {
- srand()
- print int(rand()*100), int(rand()*$search_delay)
- }" </dev/null`
- randnum=$1;
- delaytime=$2;
- # Shall we execute a search?
- test $randnum -lt $search_percent || exit
- # Delay
- echo sleep $delaytime
- # Pick one random word from the wordlist.
- # Once again cannot use $RANDOM for non-bashers. ;)
- word_count=`wc -l $wordlist | sed 's/ .*$//'`
- word_index_select=`awk "END {
- srand()
- printf(\"%d\", int(rand()*$word_count+1))
- }" </dev/null`
- word_select=`sed -n ${word_index_select}p $wordlist`
- # And now perform a search using curl
- curl -s -A "$user_agent" "${search_uri}$word_select" >/dev/null
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement