Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Ban IP's In vBulletin Options Easily Details »»
Ban IP's In vBulletin Options Easily
Version: 1.0.2, by Simon Lloyd Simon Lloyd is offline
Developer Last Online: May 2023 Show Printable Version Email this Page

Category: Miscellaneous Hacks - Version: 3.8.x Rating:
Released: 08-07-2011 Last Update: 08-08-2011 Installs: 24
Uses Plugins
 
No support by the author.

What this mod does
With this simple mod you can enter a list of IP's that you want to ban (redirect) one per line, when trying to access your site the user of the IP will be redirected to an obscure google page with a 301 permanent redirect.

What this mod won't do
With this mod you cannot ban partial ranged IP's laid out like this 2.23.123 - 2.23.130

How to install
Simply go to Admincp>Manage Products and import product-baniparray.xml

Please mark as installed if you use this!

Version History
v1.0.1
Made it possible to use partial IP addresses
v1.0.2
Added custom redirect message box
Added custom redirect url box
Added IP Range boxes for banning IP's that fall within range
Ranged IP's parsed during checks
vbeta added for test purposes 9/08/2011
Beta has email notification ability, this beta is for those of you that wish to test it and feed back!


Checked range block working only against my IP range, please report any bugs!

Download Now

File Type: xml product-baniparray.xml (6.9 KB, 145 views)
File Type: xml product-baniparraybeta.xml (9.8 KB, 69 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 08-08-2011, 03:13 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well, you might as well add something to this that would make it a better option to use than the one in vb.
Reply With Quote
  #13  
Old 08-08-2011, 11:52 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would this work with IPv6 addresses?
Reply With Quote
  #14  
Old 08-08-2011, 12:02 PM
nhawk nhawk is offline
 
Join Date: Jan 2011
Posts: 1,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here's a little snippet of code for IPv4 addresses that I use in several private mods.

Code:
$ip = explode('.',IPADDRESS);
$ipaddress = 16777216 * $ip[0] + 65536 * $ip[1] + 256 * $ip[2] + $ip[3];
You should be able to figure out how to compare a range of numbers with that.

IPv6 is very similar.
Reply With Quote
  #15  
Old 08-08-2011, 04:51 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by BirdOPrey5 View Post
Would this work with IPv6 addresses?
To answer this simply, if you entered x12.35p.6-51?54e in the list then anything matching that will be redirected, if you enter x12 then anything that contains x12 will be redirected.

Quote:
Originally Posted by nhawk View Post
Here's a little snippet of code for IPv4 addresses that I use in several private mods.

Code:
$ip = explode('.',IPADDRESS);
$ipaddress = 16777216 * $ip[0] + 65536 * $ip[1] + 256 * $ip[2] + $ip[3];
You should be able to figure out how to compare a range of numbers with that.

IPv6 is very similar.
I really have no idea what an IPv4 or 6 is, the mod, as it stands does not use regular expressions to check the entire octet hut instead goes for a simple match, there are enhancements coming soon with this mod but (until i understand it myself) for now it will remain simply as a match.
Reply With Quote
  #16  
Old 08-08-2011, 10:46 PM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Product update - new enhancements
Reply With Quote
  #17  
Old 08-09-2011, 12:11 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Beta product added for test purposes, it has email notification facility, if you use this version please feed back.
Reply With Quote
  #18  
Old 08-09-2011, 12:52 AM
Simon Lloyd's Avatar
Simon Lloyd Simon Lloyd is offline
 
Join Date: Aug 2008
Location: Manchester
Posts: 3,481
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Beta re-uploaded due to a typo!
Reply With Quote
  #19  
Old 08-09-2011, 10:12 AM
nhawk nhawk is offline
 
Join Date: Jan 2011
Posts: 1,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Simon Lloyd View Post
I really have no idea what an IPv4 or 6 is, the mod, as it stands does not use regular expressions to check the entire octet hut instead goes for a simple match, there are enhancements coming soon with this mod but (until i understand it myself) for now it will remain simply as a match.
The code I gave you converts the IPv4 ip address (xxx.xxx.xxx.xxx) to it's true numeric value. Hence it can then be used in a < > comparison.

IPv6 can be done in a similar way, but it uses hexadecimal values and will result in an insanely large number.
Reply With Quote
  #20  
Old 08-09-2011, 10:15 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This will also work for IPv4:

Code:
// Checks for valid IP Address since some proxies will send invalid user
// agent strings.
//
// usage: if (!isValidIPv4($ipaddress))

function isValidIPv4($addr) {
	$octs = explode('.',$addr);
	if (count($octs) != 4) return false;

	foreach ($octs as $oct) {
		if (!ctype_digit($oct)) return false;
		$oct = intval($oct);
		if ($oct < 0 || $oct > 255) return false;
	}
	return true;
}
Reply With Quote
  #21  
Old 08-21-2011, 01:41 PM
lmsol lmsol is offline
 
Join Date: May 2011
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I noticed that I have had a lot of Japanese ips sitting in my "who's online". I found this product and thought it would be a good idea to ban these ips.

I have installed. I re-logged into my forum and still see these ips on my "who's online" list.

How do I know if these ips are now banned?

Thanks guys
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:37 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09094 seconds
  • Memory Usage 2,335KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (2)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete