Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Nigerian Scam -Block Range using htaccess


TCwho

Recommended Posts

Hey everyone. I want to block users from a specific range due to them using a contact us form to send spam to owner.

 

The IP range is : 213.255.248.0 - 213.255.248.127

Now I want to use .htaccess to block this range.

 

I coverted the range to binary and got this:

 

11010101.11111111.11111000.00000000

11010101.11111111.11111000.11111110

-----------------------------------

11111111.11111111.11111111.00000001

 

The section under the ----- is the portion where 1's are same and 0's are changes.

 

One of the questions I had, when converting 127 is that = 11111110 ?

And when converting 00000001 to decimal what is the value?

 

..because I wasnt to sure how to convert 00000001 to decimal I didnt use a netrange/netmask to block it but a CIDR of 24...so is this correct below:

 

deny from 213.255.248.0/24

 

Thanks

Link to comment
Share on other sites

order allow,deny

deny from 213.255.248

allow from all

 

will block 213.255.248.0 to 213.255.248.255

 

Why are you messing with binary? And really, there's no need to try to block IPs on the last figure unless you want to block a _specific_ IP address.

 

Spammers can easily mask their IP anyway, so this is unlikely to be of much use anyway.

Link to comment
Share on other sites

well I am trying to block a specific range...(which is the range of the internet cafe used)

 

This particular guy/gal whatever isnt masking his ip address .... which lets not discuss to show people how... but I traced it back to the internet cafe he was using .. which is the range I have above....

 

 

 

..but the CIDR of 24 I used is right tho...? Isnt it.

 

Thanks

Link to comment
Share on other sites

What what I can gather, a CIDR block prefix of /24 corresponds to 256IP addresses, and one of /25 corresponds to 128IP addresses, so you would need /25, not /24.

 

I still think you are complicating things unneccessarily.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...