I see around here is circulating very old version of the script for redirecting bots and visitors, used mostly for Twitter. I made my version of the script, heavily updated, added some functions etc so it can be used to protect money sites from more traffic sources. It is all packed in one standalone file.
Script - "Hacker" Version
Updates:
- Added no-cache headers (I am still getting google crawler hits from domains where script was active 2 days back in April 2012, this will prevent caching)
- Added mobile recognition, optional usage (if you don't want to redirect mobile users, switch true to false)
- Added option to rotate multi links for bots, mobile sites/offers and money sites
- IP recognition - It works with ranges (123.123.123.0-123.123.123.255) and CIDR (123.123.123.0/24)
- Updated list of crawlers, bots and IP's from various forums and sites for tracking bots, botnets, malware domains etc
- logging of UA's, IP's, HOST's and Referrers
- Logs separated in 3 files: regular desktop visitors, mobile visitors and bots/ip's - much easier to see number of real visitors
- Logs can be sent every X hours to hotmail or gmail, after sending they will be removed from server (you can disable logs if you don't need them)
- Script can erase itself after X hours or days from the server (optional, if you are doing some funny stuff with xss, rfi etc)
- OPTIONAL - index.php have his own links for rotating, it is not necessary to use this file, its up to you.
Download:
Code:
http://goo.gl/ssyIAR
Virus Total
Code:
https://www.virustotal.com/file/ef61760281575194d1709139e83d11b7aaf88387292fa228b5a70173c43e1aa5/analysis/1357917824/
SHA256: ef61760281575194d1709139e83d11b7aaf88387292fa228b5 a70173c43e1aa5
File name: Cloaker Script - 28.08.2013
Detection ratio: 0 / 46
-Upload script to your FTP server
- Rename script to something convinient, like go.php or visit.php
- Send traffic to script - www.yourdomain.com/go.php
Script will separate traffic - bots and current ip's in filter will go to safe sites, real visitors to your money sites.
- This should be used with throwaway domains if most of your traffic is from Twitter, they are banning domains after a while.
- It is very easy to update script with your own ip's and bots, just add them or remove what you think it is not necessary to block.
- Time of sending logs to email can be changed - instead of currently 6 hours you can use 1 hour, 2 hours, 45 minutes or whatever.
-This can be used like basic firewall, protection from known botnet/malware spreaders/spam etc ip ranges and networks. Bunch of them is already in this script but additional research on security sites and implementing into ip filter can make this script your main protection before scanners or whatever even come to your main sites.
- Also keep in mind that current script , for some specific reasons, is not allowing search engines to visit and cashe the script. If you are driving legitimate traffic to it, you need to remove google, yahoo, ask, teoma, duckduckgo, baidu etc from the list of bots.
Scroll down through the code to find where to put links accepted as refferals and where they need to go.
Find this part
Code:
/*=========* REFERRERS - Redirected to SAFE sites | Visitors coming from those sites / referrers will be redirected to links where the BOTS and blocked hosts / IP's are redirected * =========*/ $referrer_list = array( 'redirectthis1.com','redirectthis2.com','redirectthis3.com', /*=========* REFERRERS - Redirected to SPECIFIC sites | Visitors coming from those sites / referrers will be redirected to list of SPECIFIC sites in array, one site per line* =========*/ 'toberedirected1.com','toberedirected2.com','toberedirected3.com' => array( 'destinationsite1.com destinationsite2.com destinationsite3.com'
and make your changes. Before that you need to make change in $referrer_redirect = false; (change false to true, to enable it)
You can use it anywhere. To "catch" their main bots and link checkers you can make new post on your site and send link to desired social network (or whatever you need to block) and to check bots,ip's, ua's in logs minute after the posting, they will come. You can multiply results or making it more accurate if you make few more posts, and post them in different times of day, sometimes their bots coming form different locations and ip's.
0 comments:
Post a Comment