tester of echovar.cgi

home  launcher  linkechovar 

The contents of HTTP_REFERER and hence the refering URL were:- 

Remote address 18.191.13.255
User agent is Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Referrer is
The script is http://onwardoverland.com/cgi-bin/echovar.cgi
Referrer is
Remote name is
Remote IP is


$r = 100, $r0 = 0, $calling =

Length of $calling is

The source listing of echovar.cgi is

#!/usr/bin/perlml
use strict;
use CGI qw(:standard);
print header; # print "Content-type: text/html\n\n";
$| = 1;
open (STDERR, ">&STDOUT");
use CGI::Carp qw(fatalsToBrowser);
my ($date,$HTTP_referer, $newline, $remote_name, $length_of_remote_name, $addr, $remote_ip,
$r, $r0, $calling, $length_of_HTTP_referer, $length_of_calling
);
my $source = "echovar.cgi";
&get_date;
&thankyou;

sub disp{
my $store;
open(SOURCE, $source) or die ("5 Can't open $source: $!");
my @lines = <SOURCE>;
close(SOURCE) or die ("6 Can't close $source: $!");
foreach $store (@lines){
chop($store);
$store =~s/&/&amp;/g;
$store =~s/</&lt;/g;
$store =~s/>/&gt;/g;
print "$store $newline";
}
}

sub whoareyou{
$newline = "<BR>\n";
print "Remote address $ENV{'REMOTE_ADDR'}$newline"; # 202.72.96.2
print "User agent is $ENV{'HTTP_USER_AGENT'}$newline"; # Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

print "Referrer is $ENV{'HTTP_REFERER'}$newline"; # http://www.onwardoverland.com/linkechovar.html
if (defined $ENV{'SCRIPT_URI'}){
print "The script is $ENV{'SCRIPT_URI'}$newline"; # false so no show
}

$HTTP_referer = $ENV{'HTTP_REFERER'};
if ($HTTP_referer =~ m|https?://([^/]*)/|i) {
$remote_name = $1;
$length_of_remote_name = length($remote_name);
if (($addr) = (gethostbyname($remote_name))[4]) {
$remote_ip = join(".",unpack("C4",$addr));
} else {
$remote_ip = "";
}
}
print "Referrer is $HTTP_referer", $newline; # http://www.onwardoverland.com/linkechovar.html
$length_of_HTTP_referer = length($HTTP_referer);
print "Remote name is $remote_name", $newline; # www.onwardoverland.com
print "Remote IP is $remote_ip", $newline; # 216.127.66.127

$r0=0;
for($r=0; ($r<100)&&($r0<3); $r++ ){
if(substr($HTTP_referer,$r,1) eq "/"){$r0++};
} # $r -> 3rd forward slash

$calling = substr($HTTP_referer, $r, $length_of_HTTP_referer);

print "<BR><BR>\$r = $r, \$r0 = $r0, \$calling = $calling<BR><BR>"; # linkechovar.html

$length_of_calling = length($calling);

print "Length of \$calling is $length_of_calling<BR><BR>"; # 16

if ($calling eq "linkechovar.html"){print "\$calling = linkechovar.html<BR><BR>";}

}#end of whoareyou


sub thankyou{
print "<HTML><HEAD><TITLE>tester of $source</TITLE></HEAD>
<BODY bgcolor=#CCCCCC><FONT FACE=ARIAL SIZE=3>
<H3>tester of $source</H3>

<A HREF=/index.html>home</A>&nbsp;
<A HREF=/launcher.html>launcher</A>&nbsp;
<A HREF=/linkechovar.html>linkechovar</A>&nbsp;

<P>The contents of HTTP_REFERER and hence the refering URL were:-&nbsp;<BR><BR>";

&whoareyou;
print "<H4>The source listing of $source is</H4><P>";
&disp;

print "<FONT SIZE=3>
<A HREF=/index.html>home</A>&nbsp;
<A HREF=/launcher.html>launcher</A>&nbsp;
<A HREF=/linkechovar.html>linkechovar</A>&nbsp;
Test run on $date. Page created on April 15th. 2008 and updated on February 28th. 2014.
<BR><BR>
</BODY></HTML>";
} # end of sub thankyou

sub get_date {
my (@days, @months, $sec, $min, $hour, $mday, $mon, $year, $wday, $time);
# Define arrays for the day of the week and month of the year. #
@days = ('Sunday','Monday','Tuesday','Wednesday',
'Thursday','Friday','Saturday');
@months = ('January','February','March','April','May','June','July',
'August','September','October','November','December');
# Get the current time and format the hour, minutes and seconds. Add #
# 1900 to the year to get the full 4 digit year. #
($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6];
$time = sprintf("%02d:%02d:%02d",$hour,$min,$sec);
$year += 1900;
# Format the date. #
$date = "$days[$wday], $months[$mon] $mday, $year at $time";
} # end of sub get_date



home  launcher  linkechovar  Test run on Friday, April 19, 2024 at 11:04:46. Page created on April 15th. 2008 and updated on February 28th. 2014.