#!/usr/bin/perl print "Content-type: text/html\n\n"; if (($ENV{'REMOTE_HOST'} eq $ENV{'REMOTE_ADDR'}) && ($ENV{'REMOTE_ADDR'} =~ /(\d+)\.(\d+)\.(\d+)\.(\d+)/)) { $Address = pack('C4', $1, $2, $3, $4); $DNS_Address = (gethostbyaddr($Address, 2))[0]; $ENV{'REMOTE_HOST'} = $DNS_Address if $DNS_Address; } $ENV{'REMOTE_HOST'} =~ tr/[A-Z]/[a-z]/; $ADATE= qx("/bin/date"); print ""; print "

WHAT DO I KNOW ABOUT YOU?

"; print "
"; print ""; print ""; print "
"; print "
"; print "
"; print ""; print "You are at IP Address $ENV{'REMOTE_ADDR'}
"; print "Which resolves to $ENV{'REMOTE_HOST'}
"; print "It is now $ADATE
"; if ($ENV{'REMOTE_USER'} gt " ") { print "You are really "; print "$ENV{'REMOTE_USER'}
"; } else { print "Rats. Your server will not reveal your true identity.
"; } print "You enjoy surfing with ","$ENV{'HTTP_USER_AGENT'}

"; print "
"; print "
"; print "Hmmm. If I were an evil hacker or if you were "; print "doing something "; print "really bad and I had a warrant, I guess going by your ISP's address, "; print "your IP number, the time, and the billing information- I could "; print "get your home address and phone number. If you have your own "; print "static (permanent IP address) it would make my job easier!"; print "

"; print "Hmmm. If I were a spammer. "; print "I am NOT either doing it or showing you how, but if "; print "you are using Netscape or MSIE with your mail enabled- I could "; print "with a small JAVA applet- have your e-mail address in my "; print "mailbox right now!"; print "

"; print "Hmmm. If I were a marketer what would this "; print "small amount of information tell me?"; print "

    "; print "
  • I know by comparing your domain to a geographic list "; print "of servers- where you live!"; print "

    "; print "

  • Does your domain end with edu? If so I know you "; print "are associated with that school. Same thing for com, "; print "unless it is an ISP. I also can tell where mil, gov, and "; print "org people are from. You might also be from another country"; print "

    "; print "

  • I can tell what browser you are using."; print "

    "; print "

  • From looking at the version, I can tell if you have the "; print "latest version. Most serious net users do."; print "

    "; print "

  • I know what operating system you are using."; print "

    "; print "

  • Maybe I can get an idea of when you are on-line"; print "
"; print "In fact, taken as a whole, a webmaster can get a very good "; print "idea who his or her audience is. For instance. If I notice "; print "that most of my hits are from people using MSIE, I may want "; print "want to change that little my site looks best with "; print "message. "; print "

"; print "All of this information is actually captured in the various "; print "server logs. By collecting this information in my CGI script, "; print "such as a survey, I do not have to try and figure out which "; print "hit it was- an impossible task!"; print "

"; print "So when you do a CGI script, keep in mind that you might try "; print "logging accesses. This will be a topic for another day. "; print "Next time you complete any type of HTML/CGI form and hit "; print "SUBMIT- remember what you are really telling that server!"; print "


"; print "
"; print "

The Cast of Characters

"; print "
"; print "Here are the environmental variables that I used:"; print "
    "; print "
  • REMOTE_ADDR: The numerical IP address you are at"; print "
  • REMOTE_HOST: The host you are logged on to"; print "
  • REMOTE_USER: If your server wants to tell me- your real user name"; print "
  • HTTP_USER_AGENT: The brand and version browser you are using"; print "
"; print "
"; print "
"; print ""; print "Click here to download a copy of this program!
"; print "
"; print "
"; print "
"; print "
"; print "

Here are all the variables!

"; print "
";
foreach $item (keys %ENV)                 
  { print "$item = $ENV{$item}\n"; }