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 IP's In vBulletin Options Easily (https://vborg.vbsupport.ru/showthread.php?t=268146)

Boofo 08-08-2011 03:13 AM

well, you might as well add something to this that would make it a better option to use than the one in vb. ;)

BirdOPrey5 08-08-2011 11:52 AM

Would this work with IPv6 addresses?

nhawk 08-08-2011 12:02 PM

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.

Simon Lloyd 08-08-2011 04:51 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2230853)
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 (Post 2230856)
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.

Simon Lloyd 08-08-2011 10:46 PM

Product update - new enhancements

Simon Lloyd 08-09-2011 12:11 AM

Beta product added for test purposes, it has email notification facility, if you use this version please feed back.

Simon Lloyd 08-09-2011 12:52 AM

Beta re-uploaded due to a typo!

nhawk 08-09-2011 10:12 AM

Quote:

Originally Posted by Simon Lloyd (Post 2230961)
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. ;)

Boofo 08-09-2011 10:15 AM

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;
}


lmsol 08-21-2011 01:41 PM

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


All times are GMT. The time now is 01:54 PM.

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.01078 seconds
  • Memory Usage 1,740KB
  • 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_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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