#!/usr/bin/perl -w use strict; # PING GATEWAY for Windows NT my $version = 'v1.2'; my $date = '14-Oct-2001'; my $cr = '(c) Gabor Szabo'; my $crmail = 'gabor@tracert.com'; # Free software - GNU GPL - AS IS, NO WARRANTY... # please keep author's (my) reference... # # Setup: # ------ # Rename the file to ping.pl ping.plx or similar based on the # settings on your system # and/or put it in a directory which is CGI enabled and make sure you have # Perl enabled on the server for files with the extension you gave to the file # Change the following variables to fit your site # Name of the organization my $orgname = 'Tracert.com'; # Home page of the organization my $orghome = 'http://www.tracert.com/'; # The location of the command: my $command = '/bin/ping'; # this is usually good for Linux and UNIX #my $command = '/usr/local/bin/ping'; # this is also a good guess for UNIX systems #my $command = 'c:\windows\ping.exe'; # this is a good guess on Windows machines #Please send an # You don't have to change anything further. ######################################## # v1.2 # add -wT during development # use strict # fix the security prolem: check the input before running ping # options to run ping of OSs other than NT so this becomes a platform # independent interface (bla bla bla) $|=1; $ENV{PATH}=""; print < Ping Gateway
HTML my $qs = $ENV{QUERY_STRING}; if (@ARGV) { $qs = $ARGV[0]; } # for command line testing only if ((defined $qs) and ($qs ne "" )) { if ($qs =~ /^t=(.*)/) { $qs=$1; } if (($qs =~ /^(\d+\.\d+\.\d+\.\d+)$/) or ($qs =~ /^([a-zA-Z0-9][a-zA-Z0-9\.\-_]*)$/)) { $qs = $1; # unTaint print "
"; print "
";
	system "$command $qs";
	print "
"; print "
"; } } print <
HTML #