Forum Moderators: phranque

Message Too Old, No Replies

Unusual IP addresses showing up.

         

Wmff

1:34 am on Aug 19, 2023 (gmt 0)

Top Contributors Of The Month



I have never seen an IP address like this before - 2001:4ba0:cafe:3f2::1.
I did not start seeing them until I migrated to Hostinger.
The odd thing is, that IP can be resolved to a host and location and even abuse checking web sites.
My question is, can an IP like that be banned successfully in .htaccess?
Or can the range 2001:4ba0::/29 be banned in .htaccess like this - Deny from 2001:4ba0::/29?

Peter_S

8:41 am on Aug 19, 2023 (gmt 0)

5+ Year Member Top Contributors Of The Month



This is an IPv6 and I would think twice before starting to ban IPv6 ...

lucy24

4:10 pm on Aug 19, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Did your site just recently acquire a fixed IPv6 address? You will not see IPv6 in logs unless the site itself has an IPv6 address. (I don't know how this works; I'm just speaking from observation.)

IPv6 is so called because addresses have eight colon-delimited segments of four hexadecimal digits, instead of the four dot-delimited decimal segments of IPv4. The one you cite appears to have only five segments, but that's because there is nothing but zeros between the last two; 2001:4ba0:cafe:3f2::1 = 2001:4ba0:cafe:03f2:0000:0000:0000:0001. (I don't make this stuff up.) An especially easy one to recognize is Facebook’s IPv6, which has :face:b00c: somewhere in the middle.

Edit: The “Deny from” question worries me a little, because that's Apache 2.2 syntax. By now your server should be on 2.4, and you should change all your directives to the "Require" syntax. Yes, you can use both IPv4 and IPv6 in the "Require ip" element. And if you've identified a particular IPv6 range as a server farm or similar, by all means block it if you like.

Wmff

2:20 am on Aug 20, 2023 (gmt 0)

Top Contributors Of The Month



Thanks for the replies and even though this all seems a little bit "over my head" I did a little research and will try to answer and ask some questions to maybe clear things up.

"Did your site just recently acquire a fixed IPv6 address?"
My previous website host, iPage, was a fixed address, like thus - 66.96.***.*** and as far as I know, the current host of my site, Hostinger, is also a fixed address, at least my dashboard lists an "IPv4" type address, like this 149.100.***.***.

"The “Deny from” question worries me a little, because that's Apache 2.2 syntax. By now your server should be on 2.4, and you should change all your directives to the "Require" syntax."

I used my current .htaccess for 10 years on my previous host, they list their platform as "Debian", I don't see any mention of "Apache" in the specs on the control panel so I have no idea what version they are using. My .htaccess exclusively uses/used the “Deny from” syntax to ban IP's or IP ranges and this always worked for the past 10 years.
When my site was migrated my .htaccess was also copied but I have no idea if it is working because the visitor logs from my current host do not list error codes i.e., 403, 500, etc. I have a really basic package and it does not even come with a cPanel. IP's that previously generated a 403 error, now seem to all report the same amount of data response so maybe that's an indication they are all still getting a 403 code.

I did perform a test by adding 2 IPv6 addresses to my .htaccess, still using the "Deny from" syntax, and this did not crash my site or create a 403 error when I visited it. Whether or not this syntax will actually work to ban those IP ranges is unknown at the moment.

Thanks again for the replies.

Peter_S

10:32 am on Aug 21, 2023 (gmt 0)

5+ Year Member Top Contributors Of The Month



The question remains as, why do you want to block this IP ?

lucy24

4:28 pm on Aug 21, 2023 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



OP didn't say, but you have to assume the initial visit had some undesirable robotic features. But how, why and whether to block an IP is a whole nother thread.