Jump to content
TNG Community

htaccess not blocking


Bruce Roy

Recommended Posts

I recently had this entry in my access log:

Wed 19 Dec 2007 12:04:23 AM Family Group Sheet for Family http://hotaebywk.chat.ru/html/body? accessed by 82-44-240-252.cable.ubr01.haye.blueyonder.co.uk/82.44.240.252/.

My htaccess file has " deny from 82.44.*.* "

The full code is:

# allow all except those indicated here

<Limit GET POST PUT>

order allow,deny

allow from all

...

deny from 82.44.*.*

...

</Limit>

Is there a better way to block IP addresses? And does it always work?

Bruce Roy

Link to comment
Share on other sites

I recently had this entry in my access log:

Wed 19 Dec 2007 12:04:23 AM Family Group Sheet for Family http://hotaebywk.chat.ru/html/body? accessed by 82-44-240-252.cable.ubr01.haye.blueyonder.co.uk/82.44.240.252/.

My htaccess file has " deny from 82.44.*.* "

The full code is:

# allow all except those indicated here

<Limit GET POST PUT>

order allow,deny

allow from all

...

deny from 82.44.*.*

...

</Limit>

Is there a better way to block IP addresses? And does it always work?

Bruce Roy

Hi Bruce,

That deny clause looks too msdos-ish

I think the proper format for deny is:

deny from 82.44.0.0/16

or:

deny from 82.44.0.0/255.255.0.0

These are equivalent in that they mask the first 16 bits (2 bytes) as being the thing you want to deny.

You were on the right track just too familiar with Windows methodology.

Let me know if this works better.

Luke

Link to comment
Share on other sites

Hi Bruce,

That deny clause looks too msdos-ish

I think the proper format for deny is:

deny from 82.44.0.0/16

or:

deny from 82.44.0.0/255.255.0.0

These are equivalent in that they mask the first 16 bits (2 bytes) as being the thing you want to deny.

You were on the right track just too familiar with Windows methodology.

Let me know if this works better.

Luke

Thanks, Luke. I'll give that a go though I guess I won't know if it works until I get a similar breach.

Bruce

Link to comment
Share on other sites

Bruce,

Your current problem is with the single IP Address 82.44.240.252.

I would begin by only denying that IP Address access to your website. Otherwise, you are blocking a great, great, great many others when you begin denying with 82.44.nnn.nnn.

You have to be concerned about denying many "innocent" users when you deny access too broadly.

Arnold

Link to comment
Share on other sites

  • 2 weeks later...

How to Specify Addresses

You can specify computer addresses in five ways:

Use the word all to refer to all computer addresses.

Use the complete domain name (e.g. dante.u.washington.edu) of an individual computer.

Use a partial domain name (e.g. washington.edu) to refer to all computers within a specific domain.

Use the complete IP address (e.g. 140.142.52.1) of an individual computer.

Use a partial IP address (e.g. 140.142) to refer to all computers within a specific subnet.

I ban all .RU addresses.......... too bad if the President of Russia wants a looksee.........!!

Link to comment
Share on other sites

  • 4 weeks later...

Sorry for slightly hijacking this thread ....

Bruce - how do you ban a country, like you did with Russia?

What is the correct syntax to put into .htaccess?

Thanks in advance

Link to comment
Share on other sites

This should block all .ru domains:

<Limit GET>

order deny,allow

deny from .ru

allow from all

</Limit>

On a side note, I block the useragent and that gets rid of almost all the hack attempts:

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

SetEnvIfNoCase User-Agent "indy library" keep_out

SetEnvIfNoCase User-Agent "Microsoft URL Control" keep_out

SetEnvIfNoCase User-Agent "libwww-perl" keep_out

SetEnvIfNoCase User-Agent "Mail.Ru" keep_out

order allow,deny

allow from all

deny from env=keep_out

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

Just thought I would throw that out there...

Rush

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...