vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   Miscellaneous Hacks - Ban Spiders by User Agent (https://vborg.vbsupport.ru/showthread.php?t=264932)

Simon Lloyd 06-08-2011 10:00 PM

Ban Spiders by User Agent
 
1 Attachment(s)
What this mod does
With this mod you can enter User Agents to watch or ban, you can also recieve emails or have an Output.txt created and updated with time and date of visits. It doesn't just have to be spiders, you can watch, log or ban any useragent!

How to install
Simply import the product ban_spider, the mod is active by default but none of the other options are turned on.

What is a UserAgent?
http://en.wikipedia.org/wiki/User_agent

Understanding a UserAgent string
http://user-agent-string.info/parse

Genuine User Getting Blocked?
https://vborg.vbsupport.ru/showpost....&postcount=105

Tools to help
http://whatsmyuseragent.com/SwitchingUserAgents.asp
http://www.botsvsbrowsers.com/SimulateUserAgent.asp

FAQ
https://vborg.vbsupport.ru/showpost....&postcount=137

What's a bot?
http://en.wikipedia.org/wiki/Spambot

How do i ban a bot?
https://vborg.vbsupport.ru/showpost....&postcount=318
https://vborg.vbsupport.ru/showpost....7&postcount=51

Where's output.txt located?
https://vborg.vbsupport.ru/showpost....&postcount=216

Bad bot lists
https://vborg.vbsupport.ru/showpost....&postcount=259
https://vborg.vbsupport.ru/showpost....&postcount=224
https://vborg.vbsupport.ru/showpost....&postcount=281

VB4.x Version of Ban Spiders By User Agent

Tested on vb3.7.x, vB3.8.x but should work on any version.

__________________________________________________ __________________
Special thanks to:
Lior
KH99
BoP5
for helping me sort out a few issues

...and beta testers

ForceHSS (Special thanks to Force for latest testing)
ozzy47
GreyHost

If you use this please mark as INSTALLED

History
9th June 2011 Orginal xml added
12th June 2011 Added both email notification and text file logging
22nd June 2011 Version 2.0.0, Added create thread on activity
  1. Added match facility you can now use something like Yandex and it will match MOZILLA/5.0 (COMPATIBLE; YANDEXBOT/3.0; +HTTP://YANDEX.COM/BOTS)
  2. Added clickable link to visited thread
22nd September 2011 added user redirect url selection
08th October Beta testing started for thread creation.
20th October Beta testing started for emailing.
21st October Beta testing complete Ver 3.0.0 uploaded
29th October minor fix added to cope with empty userid on thread creation
30th October Beta testing automatic redirection to spiders/bots IP
31st October New xml uploaded with automatic redirect to IP
25th November Minor fix for blank forumid fixed
26th November 2011 Fixed version check & create thread Off by default
17th December 2014 Version 3.1.0 uploaded, Extra logging and statistics added by Ozzy47 (Chris)
18th December 2014 Version 3.1.2 uploaded, due to rogue process from other mod
18th December 2014 Version 3.1.3 uploaded, due to previous one being VB4 mistakingly uploaded

The Bad Bots list is now included in the product :)
Please prune out all those that you wish to be able to see your site (i suggest you definately prune out "DA" and "Custo" :

Support will now only be given to those who have this mod marked as INSTALLED

Simon Lloyd 06-09-2011 05:34 AM

**reserved**
9th June 2011 Orginal xml added
12th June 2011 Added both email notification and text file logging
22nd June 2011 Added create thread on activity
  • Added match facility you can now use something like Yandex and it will match MOZILLA/5.0 (COMPATIBLE; YANDEXBOT/3.0; +HTTP://YANDEX.COM/BOTS)
  • Added clickable link to visited thread
26th September 2011 added user defined "Redirect to" box for adding your own url


Aljuve 06-11-2011 08:03 PM

Thank you

Simon Lloyd 06-11-2011 08:41 PM

You're welcome, please remember to mark as Installed if you have used this :)

Lee G 06-18-2011 08:42 AM

Time to be cheeky :D
Would it be possible to have this mod post a thread when you get hit by a tracked user agent?

Ie thread title user agent blah blah ip blah blah
Thread body same as title but with added suspicious behaviour / known bad agent etc

Just an idea. A lot of web site owners can take a hit. If you do a google, unless the likes of stop forum spam / project honey pot have the ips listed, there is no real other warning on the net.

What format is the test file in at present

Simon Lloyd 06-18-2011 11:39 AM

Test file? if you mean that file that is written to it's simply a text file. I'd look at the posting to a thread but to be honest you don't really want that, install the mod, add a user agent (just one) and then turn on the "write to text file" leave it on for say an hour, turn it off then check the size of the text file and the number of entries!, until the spider/bot/person get the message and remember the permanent redirect you'll get hundreds of notifications, so creating a thread or post every time would soon bloat your database for no reason.

Do you really want it?

Simon Lloyd 06-22-2011 04:09 PM

**UPDATED** Lee C's request filled :)

Lee G 07-22-2011 06:06 PM

Cheers for that Simon. Im looking for an alternative to Bad Behavior to use.
Bad behavior is still shown as being beta
Something to block specific user agents, ie Baidu, Magpie spider etc and not risk unwittingly blocking the likes of google

Top man

appsfinder 08-24-2011 11:28 AM

Hi does this stop all spider bots because i would still like to be index by google/yahoo
please can you help.

Simon Lloyd 08-25-2011 02:55 AM

It only stops those that you designate :)

ponydaddy 09-08-2011 06:58 PM

any way this will work on 4.1.5 PL1

Simon Lloyd 09-08-2011 07:32 PM

Uninstall this version and install the version for vb4.x.x https://vborg.vbsupport.ru/showthread.php?t=268208

ForceHSS 09-08-2011 09:18 PM

both of the files are the same why install the other one when both are the same?

ponydaddy 09-08-2011 11:30 PM

force is right both are the same. Any way will install the other one

Simon Lloyd 09-09-2011 07:53 AM

Quote:

Originally Posted by ForceHSS (Post 2243625)
both of the files are the same why install the other one when both are the same?

Quote:

Originally Posted by ponydaddy (Post 2243682)
force is right both are the same. Any way will install the other one

Yes they are but vb3.x.x and vb4.x.x are different and produce different errors...etc to each other, it would be wrong to confuse a vb3 thread with answers to vb4 errors :)

Simon Lloyd 09-09-2011 08:15 AM

List of bad bots added in modification description, please remember to prune out all those that you wish to be able to see your site!

Lee G 09-18-2011 11:17 AM

Good to see this one has not been abandoned like another mod seems on here :up:
If we want to add blocks on other user agents that have spaces in them ie Windows XP, MSIE 7.0b or MSIE 5.0

Would it be a simple case of Windows\XP MSIE\5

With \ indicating the space

If anyone wonders why those three have been singles out, there is no such user agent as Windows XP, MSIE 5 is god knows how many years old and MSIE 7.0b is a beta version and windows auto updates

Simon Lloyd 09-18-2011 11:52 AM

Lee, the mod looks for a text match so "Windows\XP" will be different to "Windows XP" although i will do some testing as i've had a minor issue raised in the vb4 version that a single user can't login and gets redirected but nothing in his UA matches anything in their list, so it may be a partial match where there is a space.........i'll post back when the issue has been investigated and resolved.

Lee G 09-18-2011 02:57 PM

Been having a play and its beyond simple for banning them :up:
Windows XP is just that. Windows 3.1. 95 and ME were those endings in the user agents, but XP is a fake one. Microsoft changed how it was displayed in the user agent to Windows NT 5.1

I run a test on bots vrs browsers user agent test if a block is working
http://www.botsvsbrowsers.com/SimulateUserAgent.asp

Add the user agent to admin cp and then do a test there to see if its killed them.
In your file you have SOSO from China, they have now changed their user agent to jikespider

Simon Lloyd 09-18-2011 03:26 PM

Lee, thanks for info and the testing, so as i said "windows xp" is different to "windows\xp" in your test?

Lee G 09-18-2011 03:50 PM

I tried three variants and made sure I wernt going to be locked out the forums. Never do anything without a get out of trouble method :D

First off was two versions of xp
Windows*XP
Windows\XP

Tried viewing over at bots vrs browsers with a simple user agent of Windows XP
When neither of those two worked, I made sure I had another browser fired up, just in case I blocked myself and any browser with any mention of windows in the user agent
And tried plain old Windows XP

Worked a treat. Same as blocking Windows 95, Windows 98, Windows ME and MSIE 5
No need for any extra variables :up:

Simon Lloyd 09-18-2011 03:53 PM

Quote:

Originally Posted by Lee G (Post 2247537)
...In your file you have SOSO from China, they have now changed their user agent to jikespider

I think you'll find they are still using SOSO too as right now i have 6 of them trying to access my site :)

Simon Lloyd 09-18-2011 03:57 PM

Lee, you're a star :), i just checked the UA from the vb4 version issue and it's not this mod keeping their client out of the forum, until you nudged me i'd completely forgot about bots v browsers even though i have quoted it many times here at vb.org in the past!

Lee G 09-18-2011 04:19 PM

Im just good at breaking things, ask any software developer or skin seller that I use :D

Another one to consider adding to the block list is UnwindFetchor/1.0
They are another scrape for gain outfit, by the looks of it

Lee G 09-18-2011 06:01 PM

Another one thats good for monitoring or just plain banning is this
;)
I checked it works as is. Its a give away to a messed about with user agent

Google JP must be getting busy :D

Simon Lloyd 09-18-2011 06:20 PM

Hi Lee, did you mean the wink?

Lee G 09-18-2011 07:00 PM

Should have wrapped it in php tags :D
PHP Code:

;) 

This is one example of one use agent thats been modified
PHP Code:

Mozilla/4.0 (compatible;) 

Use the tracking system and see how many user agents use it.
They think by taking out some information, you wont catch on and ban them :D

One use agent that had a bad habit of trying to inject base64 when I used the other blocking system was this one
libwww-perl

Another that only ever hits from ips on honeypot is this
w3m/

The good thing about this mod, you can track and then decide if its worth banning
Older user agents are worth watching as well. Firefox is an easy one to watch.
Firefox gives you the date the version came out

This example
PHP Code:

Mozilla/5.0 (WindowsUWindows NT 6.1en-USrv:1.9.2.22Gecko/20110902 Firefox/3.6.22 

If you look at the Geko/ part. It gives the date the version of firefox was released
I ban Firefox/1 and Firefox/2

Opera dont have many use it. I personally love the browser, but its another browser that auto updates. You can catch a lot of low life that way
Present version of Opera is Version/11.51

Simon Lloyd 10-22-2011 11:19 PM

Hi Guys, just to let you know there is a brand new product uploaded with everything fixed :)

Simon Lloyd 10-31-2011 07:24 AM

New product uploaded now with automatic redirect to spiders/bots own ip :)

gigawiz 11-05-2011 12:46 PM

marked as installed

I uninstalled the vb4 version and installed this one as per the instruction earlier on in the thread. This mod really is just epic and no vb forum should be without it.

EDIT - I have disabled the mod from creating new threads but it is still doing it, I have removed all the user info from the settings (user ID and forum ID) and it still posts threads which do not exist! Please help before I go totally round the bend :(

Thank you in advance.

gigawiz.

Simon Lloyd 11-05-2011 04:57 PM

is it still posting threads? i'm using the vb3.8 version my thread creation is turned off and mine isn't creating them - post back please.

dapence 11-26-2011 11:04 AM

This seems to work well! I installed, activated, and the list of 'visitors' dropped quite around 2/3.

Keep up the good work. I think the people at vBulletin proper should get you on board and have this added as a default feature of vBulletin.

Help this guy keep the agent list up-to-date.

Boofo 11-26-2011 11:19 AM

Quote:

Originally Posted by Simon Lloyd (Post 2264755)
is it still posting threads? i'm using the vb3.8 version my thread creation is turned off and mine isn't creating them - post back please.

Why not wrap the whole thread creation code in a setting conditional? That way it would only run if the setting was enabled.

Simon Lloyd 11-26-2011 11:23 AM

Boofo, after my recent update it now will not fire if there isn't a forumid present, if a username is left out it automatically enters the userid 1 (as most of us start our forums off with our username) and finally the create thread option which really should have been off by default (my bad!) is now set to off by default :)

Simon Lloyd 11-26-2011 11:25 AM

Quote:

Originally Posted by dapence (Post 2272085)
This seems to work well! I installed, activated, and the list of 'visitors' dropped quite around 2/3.

Keep up the good work. I think the people at vBulletin proper should get you on board and have this added as a default feature of vBulletin.

Help this guy keep the agent list up-to-date.

Glad you like it :), i doubt the guys at IB have this on their radar!

Can you mark this mod as installed please?

Boofo 11-26-2011 11:37 AM

Quote:

Originally Posted by Simon Lloyd (Post 2272088)
Boofo, after my recent update it now will not fire if there isn't a forumid present, if a username is left out it automatically enters the userid 1 (as most of us start our forums off with our username) and finally the create thread option which really should have been off by default (my bad!) is now set to off by default :)

I saw that, but wrapping the code would have prevented the problem in the first place instead of having to add exit, was my point.

Lee G 11-26-2011 11:43 AM

Quote:

Originally Posted by dapence (Post 2272085)
This seems to work well! I installed, activated, and the list of 'visitors' dropped quite around 2/3.

Keep up the good work. I think the people at vBulletin proper should get you on board and have this added as a default feature of vBulletin.

Help this guy keep the agent list up-to-date.

Loads of agents to consider if you look over at vbulletin
https://www.vbulletin.com/forum/show...d-spammer-trap
A good nine pages there

Lee G 11-26-2011 10:09 PM

Heres another for your low life with limited braincell capacity set forth and multiply deployment system

Firefox/3.0b5

Thats a free browser, beta version
Released: April 2, 2008

Had someone with a Romanian set of ips hit me with that

accludetuner 12-04-2011 05:30 AM

I just wanted to bump this thread and point out that this is by far one of the best and most effective anti-spam, anti-scraper, anti-harvester, anti-banned member, anti-WHATEVER mods available. It might take a little bit of time to get it setup for your specific forum, and for who you want/don't want to access your site, but once you have it setup, it's BULLETPROOF and very effective. If you're hoping to install a magical mod that magically gets rid of all the unwanted visitors from ever going to your site, keep living in magical fairy land because any effective solution is going to require some trial and error and some configuration. This mod is no exception, but once it's setup, it's absolutely fantastic!

I rated it 5 stars!

Simon Lloyd 12-04-2011 08:26 AM

Glad you like it, if you team it up with my Ban IP mod you'll get that better flexibility.


All times are GMT. The time now is 10:03 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02154 seconds
  • Memory Usage 1,839KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete