newLISP Fan Club

Forum => Anything else we might add? => Topic started by: cormullion on June 05, 2008, 01:40:59 PM

Title: CGI (env "REMOTE_ADDR") question
Post by: cormullion on June 05, 2008, 01:40:59 PM
Do any of you CGI wizards know why (env "REMOTE_ADDR") in a CGI environment sometimes returns two IP addresses rather than one?
Title:
Post by: Jeff on June 06, 2008, 04:42:43 AM
Proxy servers?  I don't know.  Maybe it's an error :)
Title:
Post by: Tim Johnson on June 07, 2008, 08:24:21 AM
I've never seen such a thing. Are you able to elaborate - safely -

without leaving anything open to exploit?

tim
Title:
Post by: cormullion on June 07, 2008, 08:46:48 AM
Well, the matching entry in the Apache log is like this:


64.27.13.129, 217.219.95.60 - - [05/Jun/2008:02:17:37 -0700] "POST /comment.cgi HTTP/1.0" 200 59498 ...

- that's a spammer caught in the act of posting some spam.  :) My code is using (env REMOTE_ADDR) and therefore picking up two IP addresses ...



Since these double IPs appear a lot in the log, I had presumed they're something well known..
Title:
Post by: newdep on June 07, 2008, 10:09:31 AM
if you always have double IP's then the first is the Apache-Server the second the client.



If you have it randomly it could be a redirect..from source..

Like from google -> destination..



But thats all i know...
Title:
Post by: Jeff on June 07, 2008, 10:53:01 AM
What's your apache log format string?
Title:
Post by: cormullion on June 07, 2008, 11:33:59 AM
It seems to be this:



clientip - username [time] "request" status bytes "referer" "useragent"



I think your 'proxy server' suggestion is right, Jeff. In that case, which one would identify that user again?
Title:
Post by: Jeff on June 07, 2008, 01:45:10 PM
No idea.  That was a complete shot in the dark.  :)