Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- trap ctrl_c INT
- date=$(date +%d.%m.%g)
- datetime=$(date)
- # This is SUPER AUTO SURF SCRIPT v. 7. You can edit configuration from on this line
- # This script visits sites you want by simulating real-user surf, clicks on the banners/link/places
- # you want. Each visit is unique since performed through new Tor identity (each time - new IP).
- # For details, look inside the README file.
- # SURFING
- # Surf link to visit, seconds delay between opening links and links quantity.
- SURFLINK="new.lady61.ru" # Link to surf
- SECSFROM="60" # Random seconds delay time, from
- SECSTO="120" # Random seconds delay time, to
- LINKSFROM="1" # Random links quantity, from
- LINKSTO="5" # Random links quantity, to
- # TORCONFIG
- # NOTE: PROXYTYPE can be either --socks5 (Socks5 proxy) or --proxy (for HTTP proxy)
- # This config is for CURL (read man curl for details)
- # IN case of socks5 (working without polipo or any other caching proxy) you probably want port 9050 (standart tor port)
- # IN case of HTTP proxy (working with caching proxy to fast-up pages loading) you probably want port 8123 (standart polipo port)
- # Always don't forget to check for polipo and / or tor running and properly configured!
- PROXYTYPE="--proxy" # Proxy type
- TORIP="127.0.0.1" # Tor IP
- TORPORT="8123" # Tor port
- # GET IP NON-CACHING PROXY CONFIG
- # I've created separated config for getting your IP with CURL proxy because of caching proxy was sometimes returning thesame IP.
- # Don't tunnel process of getting new IP through caching proxy or script will not get new IP.
- # Note: this config is only for getting the IP, but webpages loaded with curl WILL USE previous config and WILL BE cached.
- GETIPPROXYTYPE="--socks" # We use socks to connect directly to Tor without polipo caching
- GETIP="127.0.0.1" # In some cases this address might be different, so I leave this also
- GETIPPORT="9050" # Tor standard port is 9050
- # CREATED FILES
- # Defining names of files needed for this script to work.
- USERAGENTFILE="./useragents.list" # File handling the user agent list
- LINKSFILE="./links.tmp" # Internal (temporary) links list
- COOKIEFILE="./cookies.jar" # Cookies to simulate industrial browsers
- # LOGGING
- # Here you can define SMTP server to send results
- # Also here you can define admin(s) email address (divide multiple addresses by comma (,))
- USELOG="1" # Set this to 0 or comment it out to disable logging
- SENDLOG="1" # Set this to 0 or comment it out to disable sending log to email
- MINIMUM="5" # Set minimum number of different IP visits to send log (useful for debugging)
- SMTP="213.27.31.134" # SMTP server domain name or IP address
- EMAILTO="[email protected],[email protected]" # Destanation email address (can be divided by comma (,))
- LOGFILE="./logs/$date.log" # Internal log file with a datestamp
- IPLIST="./ips/$date.ip.list" # Internal IP list with a datestamp
- # FIREFOX, CURL OR BOTH?
- # You can enable or disable firefox startup. Disable firefox startup if you want only to improve your site visitor's count.
- # Otherwise, you can enable both firefox and curl. It will be possible for you to press on your website's advertisements
- # or do any job on your website (maybe simulate additional visits or whatever) while script is working. But don't forget to
- # configure firefox to use tor or polipo proxy accordingly! Set FIREFOX=1 to load them both.
- FIREFOX="1" # Run firefox or not?
- AUTOCLICK="1" # If firefox will run, do the autoclick?
- AUTOCLICKFROM="100" # MINIMAL NUMBER OF AUTOCLICKS
- AUTOCLICKTO="150" # MAXIMAL NUMBER OF AUTOCLICKS
- # MOUSECLICK COORDINATES & QUANTITY
- # How to get mouse coordinates?
- # Use command (without quotes) "sleep 5; xdotool getmouselocation"
- # Run this command in terminal, fast switch to browser and put your mouse over link. Wait few seconds (you have to do it faster than 5 secs).
- # Get back to the terminal, you will have the X and Y coordinates of the link or banner you want. Write them down here.
- # Note: if your site needs scroll, count how much times and set the SCROLL= variable.
- # Note2: while script is runned and automatic actions enabled it is not recommended to move your mouse or click action will fail.
- SCROLL="23" # How much times to scroll
- CLICKQUANTITY="5" # How much times to click (IMPORTANT! Array had to have similar quantity of X and Y coordinates!)
- MOUSEX=( 164 608 597 1035 1054 ) # Array of X coordinates for each click
- MOUSEY=( 641 199 265 525 692 ) # Array of Y coordinates for each click
- MOUSEBTN=2 # Which mouse button to click? 1 = left click (open link in the same tab), 2 = middle click (open link in new tab), 3 = right click (open context menu), etc.
- # Which program use for HTML parsing - html2text or lynx?
- # html2text might sometimes be buggy
- # Use HTMLPARSER="html2text" or HTMLPARSER="lynx --dump -stdin"
- HTMLPARSER="lynx --dump -stdin"
- # DO NOT EDIT UNDER THIS LINE
- currentpage=$SURFLINK
- count=0
- number1=0
- while [ "$number1" -le "$AUTOCLICKFROM" ]
- do
- number1=$RANDOM
- let "number1 %= $AUTOCLICKTO"
- done
- autoclickrate=$number1
- mkdir -p ips && mkdir -p logs
- [ ! -f "$IPLIST" ] && ( echo "This IP list was created on $datetime." > $IPLIST )
- [ ! -f "$LOGFILE" -a "$USELOG" = "1" ] && ( echo "This log file was created on $datetime." > $LOGFILE )
- echo "This script loads website from different IPs using Tor."
- echo "Ensure that you have every staff configured & working or you will get errors. Read README file."
- [ "$USELOG" = "1" ] && ( echo "Script started @ $datetime" >> $LOGFILE )
- function hello {
- ip=$(curl --silent $GETIPPROXYTYPE $GETIP:$GETIPPORT http://whatismyip.org)
- [ "$ip" = "" ] && ( ip=$(curl --silent $GETIPPROXYTYPE $GETIP:$GETIPPORT http://www.sputnick-area.net/ip) )
- [ "$ip" = "" ] && ( ip=$(curl --silent $GETIPPROXYTYPE $GETIP:$GETIPPORT http://ifconfig.me) )
- [ "$ip" = "" ] && ( ip=$(curl --silent $GETIPPROXYTYPE $GETIP:$GETIPPORT http://ip.appspot.com) )
- if grep -Fxq "$ip" $IPLIST
- then
- echo "This IP ($ip) was already used. Switching to another..."
- sleep 5
- changeip
- hello
- else
- time=$(date +%H:%M:%S)
- count=$(($count+1))
- echo "Found new IP $ip. Using it..."
- [ "$USELOG" = "1" ] && ( echo "$time - used $ip. Total: $count" >> $LOGFILE )
- [ "$USELOG" = "1" ] && ( curl --silent $GETIPPROXYTYPE $GETIP:$GETIPPORT -s "http://www.geoiptool.com/?IP=$1" | $HTMLPARSER | egrep --color 'City:|IP Address:|Country:' >> $LOGFILE )
- randomagent
- echo "Choosing $rndagent as user agent for surf."
- [ "$USELOG" = "1" ] && ( echo "Used agent: $rndagent" >> $LOGFILE )
- getlinks
- echo "Surf using $ip finished, adding it to database... Totally surfed from $count IPs."
- echo $ip >> $IPLIST
- sleep 5
- changeip
- hello
- fi
- }
- function sleeping {
- number=0
- while [ "$number" -le "$SECSFROM" ]
- do
- number=$RANDOM
- let "number %= $SECSTO"
- done
- echo "Sleeping for random $number seconds"
- sleep $number
- }
- function changeip {
- /usr/bin/expect -f torci.sh > /dev/null
- echo "IP successfully changed."
- }
- function randomagent {
- lines=$(wc -l < $USERAGENTFILE)
- (( R = 2**15-1, T = 10**8-1, C = T/R ))
- randseed=$(printf "%8.8u\n" $(( RANDOM*C + ( RANDOM%C ) )))
- rndagent=$(cat $USERAGENTFILE | awk -v COUNT=$lines -v SEED=$randseed 'BEGIN { srand(SEED); i=int(rand()*COUNT) } FNR==i { print $0 }' )
- }
- function randomlink {
- lines=$(wc -l < $LINKSFILE)
- (( R = 2**15-1, T = 10**8-1, C = T/R ))
- randseed=$(printf "%8.8u\n" $(( RANDOM*C + ( RANDOM%C ) )))
- prelink=$(cat $LINKSFILE | awk -v COUNT=$lines -v SEED=$randseed 'BEGIN { srand(SEED); i=int(rand()*COUNT) } FNR==i { print $0 }' )
- currentpage="http://$SURFLINK$prelink"
- }
- function ctrl_c() {
- [ "$USELOG" = "1" ] && ( echo "Script finished @ $datetime" >> $LOGFILE )
- echo "Wait a sec, cleaning up..."
- [ -f "$COOKIEFILE" ] && ( rm -rf $COOKIEFILE )
- [ -f "$LINKSFILE" ] && ( rm -rf $LINKSFILE )
- echo "Thank you for using! We totally surfed from $count IPs. Hope you like this script."
- if [ "$SENDLOG" -eq "1" -a "$count" -ge "$MINIMUM" ]; then
- echo "You choosed to send log to admin. We have totally $count IPs surfed. Now let me send results to the admin email..."
- sendemail -f $EMAILFROM -t $EMAILTO -u "Script finished @ $datetime - $count" -s $SMTP -m "Script finished @ $datetime - $count. Thank you for using :)" -a $LOGFILE
- echo "Email sended."
- fi
- echo "Script finished. Bye!"
- exit
- killall $0
- }
- function getlinks {
- number2=0
- while [ "$number2" -le "$LINKSFROM" ]
- do
- number2=$RANDOM
- let "number2 %= $LINKSTO"
- done
- for (( i=1; i<=$number2; i++ ))
- do
- echo "Visiting page: $currentpage"
- [ "$USELOG" = "1" ] && ( echo "Visiting page: $currentpage" >> $LOGFILE )
- [ "$FIREFOX" = "1" ] && ( firefox $currentpage & )
- curl -# -c $COOKIEFILE --user-agent $rndagent $PROXYTYPE $TORIP:$TORPORT $currentpage | awk -F $SURFLINK {'print $2'} | awk -F\" {'print $1'} | awk -F\' {'print $1'} | sed '/^$/d' | grep -Ev '\.|\?|feed|<|>|news3_zolotie_stranitsi|wp-|;' | sort -u > $LINKSFILE
- if [ "$FIREFOX" = "1" -a "$AUTOCLICK" = "1" -a "$AUTOCLICK" -le "$autoclickrate" ]; then
- sleep 10
- for (( z=1; z<=$SCROLL; z++ ))
- do
- xte 'mouseclick 5'
- done
- sleep 1
- for (( z=0; z<$CLICKQUANTITY; z++ ))
- do
- xte "mousemove ${MOUSEX[$z]} ${MOUSEY[$z]}" "mouseclick $MOUSEBTN"
- sleep 1
- done
- fi
- echo "Page loaded, picking random link there... ($i/$number2)"
- randomlink
- sleeping
- done
- echo "Site surf from this IP is completed."
- currentpage=$SURFLINK
- [ "$FIREFOX" = "1" ] && ( xte 'keydown Control_L' 'key Q' 'keyup Control_L' )
- [ -f $COOKIEFILE ] && ( rm -rf $COOKIEFILE )
- [ -f $LINKSFILE ] && ( rm -rf $LINKSFILE )
- }
- hello
Advertisement
Add Comment
Please, Sign In to add comment