Quick Login   
 
Register AdminFusion Tutorials Post Fusion Forum Matrix
 
Old 12-10-2006, 10:00 PM   #1
Groupie
 
Samson's Avatar
 
Join Date: Dec 2005
Location: California, USA
Posts: 40
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

"The past was erased, the erasure was forgotten, the lie became truth." -- George Orwell, 1984
Samson is offline   Reply With Quote
Old 12-11-2006, 04:00 AM   #2
Forum Guru
 
Ryan's Avatar
 
Join Date: Sep 2005
Location: Athens, GA
Posts: 10,256
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.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- Professional vBulletin Skins
Ryan is offline   Reply With Quote
Old 03-09-2009, 06:04 PM   #3
Lurker
 
Join Date: Mar 2009
Posts: 1
abhishek is on a distinguished road
chk this

Hello
chk this link...
ABHISHEK PUROHIT.INFO
you will get all full table....
abhishek is offline   Reply With Quote
Old 03-09-2009, 07:17 PM   #4
Rookie
 
Cerberus's Avatar
 
Join Date: Mar 2009
Posts: 18
Cerberus will become famous soon enough
That really wont stop someone who wants to attack you. If you really want to ban them, I would suggest some type of cookie ban. And make sure you use a very unique identifier for the cookie so it's harder to delete from their browser and come back. Banning an ip is only going to make them go look for a proxy. To be honest it's impossible to fully ban someone from a server if they know what they are doing. Most spammers have multiple computers, browsers, and ips. But I wish you the best of luck.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
- Have an
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
? Maybe it is
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
? Come check us out!
Cerberus is offline   Reply With Quote
Old 06-14-2009, 09:32 PM   #5
Member
 
Join Date: Mar 2009
Posts: 59
MHAndy is on a distinguished road
Use CSF firewall and you can ban single IP's or whole countries. (This is for Unix Systems) it even add's itself to cPanel/WHM if you have it.
MHAndy is offline   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 07:43 PM
Banning Racism!!! (need some help) RamBone Handling Problem Members 25 08-06-2006 10:24 PM
Banning popular members cpvr Handling Problem Members 42 06-19-2006 01:52 AM
Banning IP in Cpanel AlexUK Handling Problem Members 3 04-26-2006 10:02 PM
Banning ip message demojames Handling Problem Members 6 03-19-2006 04:51 AM

AdminFusion

All times are GMT +1. The time now is 07:08 PM. Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0

© 2009 AdminFusion | Advertising Opportunities | Legal | A member of the Crowdgather Forum Community
 
From:
Title:

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 73 74 75 76 77