Quick Login   
 
Register AdminFusion Tutorials
 
Featured Sponsors


One.com Domain and Hosting


Register
Forum of the Month
Australian Webmaster
fotm

A webmaster forum specifically catering for Australian site owners. We discuss site development, marketing and management issues.

Tag Cloud
Latest Threads
Forum Stats
7,900 Members
165,091 Posts
33 Users Online

Please welcome our newest member, Jors308932!

Affiliates
Go Back AdminFusion » Management » Security and Legal Issues » IP banning by CIDR value
Welcome to the AdminFusion. AdminFusion is the ultimate resource for forum administrators and moderators. With exclusive articles, interviews with the experts, free downloadable skins, and the revolutionary post exchange system - PostFusion, AdminFusion is the place to go for all of your forum needs.  By joining AdminFusion, you will become part of a thriving admin community and immediately gain access to all of these resources. Registration is fast, simple and absolutely free so please join us today!
Want more than our forums? Try these: Post Fusion Forum Matrix
Old 12-10-2006, 11:00 PM   #1

Samson's Avatar

Title: Groupie

Points: 2,153, Level: 13Points: 2,153, Level: 13Points: 2,153, Level: 13
Level up: 14%, 297 Points neededLevel up: 14%, 297 Points neededLevel up: 14%, 297 Points needed
Activity: 0%Activity: 0%Activity: 0%

Join Date: Dec 2005

Posts: 40

Location: California, USA

Samson is on a distinguished road
 
 
IP banning by CIDR value

How much of a hassle is it to come up with a PHP function of some kind that can check an IP to see if it's within a specified CIDR range?

Say you get something like this:

Quote:
OrgName: Sprint PCS
OrgID: SPCS
Address: 12502 Sunrise Valley Dr
City: Reston
StateProv: VA
PostalCode: 20191
Country: US

NetRange: 68.240.0.0 - 68.247.255.255
CIDR: 68.240.0.0/13
I have a persistent spammer I've banned individual IPs from. The IPs I keep getting all fall within the CIDR value the network info shows. I'd like to input the CIDR value for the banned IP and be done with the problem for good. Or at least put a serious crimp in his plan. How would I go about this in php to check if the IP connecting to the site falls within the range?

I know I could just input that into iptables instead and be done with it, but all I want to do is stop the fool abusing our site from being able to register ( and therefore post ) and I'd rather not fill up the firewall with a bunch of crud.
__________________
QSF Portal
MudBytes MUD Code Repository
SmaugMuds.org - The Smaug MUDs Community Center
"I am become Death, the destroyer of worlds." - J. Robert Oppenheimer
Reply With Quote
Old 12-11-2006, 05:00 AM   #2

Ryan's Avatar

Title: Administrator

Points: 47,649, Level: 67Points: 47,649, Level: 67Points: 47,649, Level: 67
Level up: 68%, 701 Points neededLevel up: 68%, 701 Points neededLevel up: 68%, 701 Points needed
Activity: 0%Activity: 0%Activity: 0%

Join Date: Sep 2005

Posts: 10,246

Location: Athens, GA

Ryan has a reputation beyond reputeRyan has a reputation beyond reputeRyan has a reputation beyond reputeRyan has a reputation beyond reputeRyan has a reputation beyond reputeRyan has a reputation beyond reputeRyan has a reputation beyond reputeRyan has a reputation beyond reputeRyan has a reputation beyond reputeRyan has a reputation beyond reputeRyan has a reputation beyond reputeRyan has a reputation beyond reputeRyan has a reputation beyond repute
 
 
Well, me being clueless and not knowing what a CIDR value is, I might not know how to answer your question...what is a CIDR value?

Either way, if you want to ban all 68.240.x.x IP's and therefore stop registrations from that IP, you can do that...probably by putting 68.240.*.* into the ban list.
__________________
...some super-sweet signature
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

 
Posting Rules

Similar Threads
Thread Thread Starter Forum Replies Last Post
Banning free email addresses Joy Handling Problem Members 13 12-20-2006 08:43 PM
Banning Racism!!! (need some help) RamBone Handling Problem Members 25 08-06-2006 11:24 PM
Banning popular members cpvr Handling Problem Members 42 06-19-2006 02:52 AM
Banning IP in Cpanel AlexUK Handling Problem Members 3 04-26-2006 11:02 PM
Banning ip message demojames Handling Problem Members 6 03-19-2006 05:51 AM

AdminFusion

All times are GMT +1. The time now is 02:16 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0 © 2005-2008 AdminFusion - All Rights Reserved



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72