Click to See Complete Forum and Search --> : htaccess and whois and dig - and security


CarolW
06-05-2005, 12:29 PM
Dear All,

More questions from me. I managed to get weblogs finally, a couple of months ago. I look at them every day. I'm so naive that I thought people were making manual entries in my two guestbooks - they were trash entries, but looked mostly like harmless pranks, though one was loaded with a long list of URLs. Then I learned about spambots. Oh. Duh!).

My web logs are showing obvious porn sites in the referers list. I don't know how the listing works nor what it means. What *does* it mean if there's a porn site URL in the referers list in my web logs?

I did a WHOIS on a few of the sites, and got nothing, so I tried DIG, which my host provides; that gave me some IP numbers. When I put those back in WHOIS, I got at least a little information. I put the information in a text file; the information included IP numbers.

I thought what I'll do is, put those IP numbers in my htaccess file, denying access to my site. Is that a sensible thing to do, and will it keep such machines from making entries on my guestbooks and public visitor comments areas?

Here's how my web host, islandnet.com, provides this. They made something called "UseRealIP," which attempts to discern the visitor's actual IP if it's a proxy server being used. So, if I put

UseRealIP on

into my .htaccess file, supposedly I get the caller's real IP number (when it's available or can be resolved, whatever that means).

I quote from the docs on Islandnet:

"Whenever you refer to the visitor's IP address, perhaps in an IP <Limit> block, or inside a script by using the REMOTE_ADDR environment variable, you often don't get the visitor's real IP address. If they are accessing your site through a proxy server then the IP you actually see on this side is the proxy's, not the user's"

[snip]

"This will affect all web pages and scripts that rely on the REMOTE_ADDR environment variable, and it also affects your web logs. It also adds a new environment variable called PROXY_ADDR which contains the IP address that was replaced."

Because I put "UseRealIP on" in my .htaccess file a few days ago, I assume my web logs are showing reasonably accurate IP numbers.

You can find more information at:

http://helpdesk.islandnet.com/help/htaccess.php

and more specifically, at

http://helpdesk.islandnet.com/help/htaccess.php#realip

I've had trouble with .htaccess on my host; I even shut myself out of my own site, twice - when I followed instructions in the docs as best I knew how, but tech support, and even the owners, helped me out, even actually editing my file for me! So now it's in working order.

Here's what the start of my current .htaccess file looks like, except that I changed the IP numbers, and cut out two "deny" listings. "GeoIP" is explained in the docs immediately after the section on "Unmasking Proxy Users."

The following is at the very top of my .htaccess file.


<Limit GET POST>
order allow,deny
deny from 123.456.789.012
allow from all
</Limit>
UseRealIP on
GeoIP on
RewriteEngine on ....


I plan to add to my .htaccess file additional "deny from" lines for the two porn-site IP numbers I got through DIG and then WHOIS. If I do that, and resolving the IP number didn't produce results, am I risking shutting down innocent visitors who use the same proxy server?

Would porn sites and other sites conceivably be using the same proxy server? I'd guess that might be likely. Or am I off somewhere on a wild goosechase here?

I note also that an individual's IP number tends to be dynamic, but maybe a web site - or what I see in the porn referer listings in my logs - would have static IP numbers?

So, for example, if a referer in my weblogs shows:

"www.flickyou.com/nasty/nastystuff.htm"

(that's an invention, in case you didn't guess, haha)

and I get an IP number via DIG and then WHOIS, I could safely put the IP number into my .htaccess file without shutting out large numbers of possible legitimate visitors?

Thanks in advance for any help!

Sun, 05 Jun 2005 09:18:33

Fang
06-05-2005, 01:14 PM
Porn sites probably don't use fixed IP-addresses, so blocking IP-addresses is probably not helpful unless you see a particular address regularly.
Many blog sites switch off comments because of such idiots.

CarolW
06-05-2005, 01:57 PM
It's Fang to the rescue again!

Porn sites probably don't use fixed IP-addresses, so blocking IP-addresses is probably not helpful unless you see a particular address regularly.
Many blog sites switch off comments because of such idiots.

Oh. I sort of thought that might be so - like shutting the barn door after the horses have escaped.

I had one address that had the first three numbers the same, but the fourth different (if you follow me; that is, the last part of the four parts of the IP was different). But of course, again, it seems quite useless to deny access to an antire range of IP numbers.

What do you think of this: The script I'm asking for will require entry of a valid email address (though I won't publish that). The format of the address has to be correct, because the script will perform a callback to check for validity.

Might that deter spammers? It should, I'd think, deter spambots, as they might not fill in (or out!) the field correctly.

Any thoughts?

And, Fang, thanks again, again, again, for your endless help - you and numbers of others seem always to be helping!

Sun, 05 Jun 2005 10:56:48

Fang
06-05-2005, 02:29 PM
It's problably better to ask in the sister forum Web Security (http://www.antionline.com/forumdisplay.php?forumid=672)

CarolW
06-07-2005, 04:34 AM
It's problably better to ask in the sister forum Web Security (http://www.antionline.com/forumdisplay.php?forumid=672)

Fang, thanks a lot! I'll go there and study.

My dog (the other one) will undergo surgery to repair a torn cranial cruciate ligament, Thursday. That will keep me on 24-hour call for a long time; my presence will be erratic. Darn! (Poor dog!)

Tue, 07 Jun 2005 01:34:23

Robert Wellock
06-07-2005, 07:09 AM
Typically they will use hijacked zombie PC’s if they know what they are doing and blocking a range rarely works if you know its not just one individual sitting at home.

You should setup the guest books is a flood limit and not allow hyperlinks in the main body of the text.

I get several hack attempts per day and actually some of the adult sites do link to me but that's because for some peculiar reason they refer to my CSS examples.

Touch-wood my guestbook has never been attacked in the last 12+ months albeit I made it rather difficult for them to take advantage of it in the first place.