#!/usr/bin/perl ################################################################# # Title : User Identification CGI # Author : Walter Moore aperson@aperson.com # Created : 2/07/97 # Version : 1.0 # Comments : This CGI determines the users system, then displays # : the detected information to them. It can alternately # : link to HTML pages to provide more information for # : both Netscape and Microsoft browsers. # : Copyright,1997 Aperson.Com. ################################################################ ################### # Define Variables and set to default values. Do not change these ################### $browser = " $ENV{'HTTP_USER_AGENT'}"; # Browser name, version, OS. $lastsite = " $ENV{'HTTP_REFERER'}"; # Last visited site $yoursite = " $ENV{'REMOTE_HOST'}"; # The e-mail address(sort of) $yourip = " $ENV{'REMOTE_ADDR'}"; # The IP address $yourid = " $ENV{'REMOTE_IDENT'}"; # Identity if any $realos = " Windows 3"; # the Operating System(OS) $realone = " $ENV{'HTTP_USER_AGENT'}"; # the browser name $realver = " 2"; # the browser version. $javalive = " Yes"; # Does OS support Java? Default yes. ################## # If you want to link to different pages for each browser browsercheck should be "Y". # If "Y" then change the URL links accordingly. # our_url should reference your home page regardless if browsercheck is used. ################# $browsercheck = "Y"; # change to N if no HTML checks wanted $microsoft_url = "/r.cgi?F=checkem"; # where to go if Microsoft V3+ $netscape_url = "/r.cgi?F=checknn"; # where to go if Netscape V2+ $our_url = "http://aperson.com"; # where to go for other browsers ################## # Some variables may be blank after default setting. Handle them # You should change these values. ################## if ($yourid = " ") {$yourid = " Not Available";} if ($lastsite = " ") {$lastsite = " Not Available";} ################## # Detect and handle Anonymizer...says sorry. # anyone else has to remove this. It goes to secure services ################## if ($yoursite =~ /infonex.com/) { print "Content-type: text/html\n\n"; print "
Sorry - I detected you are using Anonymizer
\n"; print "You can not use this Aperson.Com function from there
"; print "Well, technically you could, I just won't let you!
"; print "Try accessing directly.
"; print "See, I could still see something"; exit; } if ($realos =~ /THE ANONYMIZER/) { print "Content-type: text/html\n\n"; print "
Sorry - I detected you are using Anonymizer
\n"; print "You can not use this Aperson.Com function from there.
"; print "Well, technically you could, I just won't let you!
"; print "Anonymizer is getting better.
"; print "Try accessing directly.
"; print "See, I could still see something."; exit; } ################## # Start real work. # Detect browser, version and platform. ################## if ($browser =~ /MSIE/) { # They are using microsoft browser $realone = " Internet Explorer"; ($junk1, $temp1)=split(/MSIE /, $browser); ($realver, $junk2)=split(/; /, $temp1); $realos = substr($junk2,$[,length($junk2)-1); ################## # Java is not available on Windows3.1 using version 2. available in version 3. ################## if ($realos =~ /Win3/ || $realos =~ /Win16/ || $realos =~ /Win 16/ || $realos =~ /Windows 3/) { if ($realver =~ /2./){ $javalive = " No"; } } } else{ if ($browser =~ /Mozilla/) { # They are using Netscape browser $realone = " Netscape Navigator"; $_ = $browser; while (m#\((.*?)\)#g ) { # get stuff inside brackets. needs perl5 ($realos, $junk1)=split(/;/,$1); } $realver = substr($browser,$[+9,4); ################## # Java is not available on Windows3.1 using Netscape ################## if ($realos =~ /Win3/ || $realos =~ /Win16/ || $realos =~ /Win 16/ || $realos =~ /Windows 3/) { $javalive = " No"; } } } ################## # Completed detection. Now write out results in form. # first print out header information # Can be modified/deleted ################## print "Content-type: text/html\n\n"; print "Server Detected Information"; # Define Variables $thesheet = "/r.cgi?F=basestyle"; $thebackground = "/r.cgi?P=background"; $thebgcolor = "#FFFFFF"; $thelink = "#df0000"; $thevlink = "#6f6f7f"; $browser = " $ENV{'HTTP_USER_AGENT'}"; $setup1 = "3"; $justme = 'aperson@aperson.com'; if ($browser =~ /Mozilla\/1/) { $setup1 = "3"; } if ($browser =~ /Mozilla\/2/) { $setup1 = "2"; } if ($browser =~ /Mozilla\/3/) { $setup1 = "2"; } if ($browser =~ /Mozilla\/4/) { $setup1 = "2"; } if ($browser =~ /MSIE 3/) { $setup1 = "1"; } if ($browser =~ /MSIE 4/) { $setup1 = "1"; } print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print " \n"; if ($setup1 == "2") { print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } if ($setup1 == "1") { print "\n"; print "\n"; print "\n"; print "\n"; } if ($setup1 == "3") { print "\n"; print "\n"; print "

\n\"Aperson.Com\n

\n"; } print "

Server Detected

\n"; print "
"; print "Below you will find information about you that can be detected by a server."; print " This is not my fault! Any server can detect(or record) this stuff."; print " There are sections for Server and Browser detected information.

"; print "
WARNING
\n"; print "If your 'User ID' below is your e-mail address(without the '\@') you are not surfing"; print " anonymously. That is not good, see Solutions below! "; print " As long as you are anonymous, who cares....But if your not you should!

"; ################## # now the actual form to display. # This should not be modified. ################## print "
\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
Server Detected Information
Your User ID:
Your Identity:
Your IP Address:
Your Operating System:\n"; print "Java Capable:
Your Browser:\n"; print "Version:
You Came From:


\n"; ################## # end of form. Now if they have Netscape or Microsoft show more checking options. # This section links to HTML page for each browser to display their info options. # Can be removed/modified or choose "N" for browsercheck in variables above. ################## if ($browsercheck =~ "Y") { if ($realone =~ "Explorer") { if (substr($realver,$[,1) > 2) { print "Internet Explorer can detect most of the above plus much more.
\n"; print ""; print "Want to detect even more information?
\n"; print "I detect if you have JavaScript, VBScript, Activex, Layouts, and other"; print " functions enabled and report this to you.
\n"; } } else { if ($realone =~ "Netscape") { if (substr($realver,$[,1) >= 2) { print "Netscape Navigator can detect most of the above plus more.
\n"; print ""; print "Want to detect even more information?
\n"; print "I can detect if you have JavaScript, Frames and other"; print " functions enabled. "; } } else { # neither Netscape v2+ or Microsoft V3+ browser print " Browser information is only available with Microsoft V3+ or "; print "Netscape V2+ browsers. Sorry.
\n"; } } } #end of browsercheck ################## # display the trailer information # modify/delete this for your display ################## print "
Solutions
\n"; print " If your 'User ID' is your e-mail address you have a 'static' IP address. Talk to your"; print " service provider(ISP) and request a 'dynamic' IP address. This will ensure you don't get any more"; print " servers(we don't do that here) grabbing your email address. You still have to watch out for Newsgroups but that is another issue.
"; print " Remember, this information can be recorded without your knowledge!
"; print " This might explain some of those mail lists you are on.
"; print " Another solution is to go to a site like www.anonymizer.com"; print " to hide this info. Unfortunately, many sites will think you"; print " have Netscape V2 on an unknown system and may send you to the wrong pages(not good) and"; print " errors may occur when visiting some sites(try this page).
"; print " I am sure that anonymizer will eventually give the client options, just not yet."; print " They provide an excellent service for those that are concerned about this info.
\n"; print "
\n"; print "
\n
\n"; $homepage = "http://aperson.com"; # default homepage if ($browser =~ /MSIE/) { # They are using microsoft browser if (substr($browser,$[+8,1) >= 3){ $homepage = "/r.cgi?F=intro" } } else { if (substr($browser,$[+8,1) >= 2){ $homepage = "/r.cgi?F=intro" } } print "\n"; print " Home | \n"; print "\n"; print " Site Search | \n"; print "\n"; print " Web Search | \n"; print "\n"; print " GuestBook | \n"; print "\n"; print " Changes | \n"; print "\n"; print " Contact Me\n"; $mailme = 'webmaster@aperson.com'; $date = `/bin/date`; chop($date); print "
\n\n"; print "
\n
\n"; print "This document created on $date
\n"; print "Copyright © 1996,1997 Aperson.Com
\n"; print "For problems with this site please e-mail \n"; print "$mailme
\n"; print "
\n
\n
\n"; print "\n\n";