#!/usr/bin/perl $|=1; ################################################################## # # INSTRUCTIONS # # Upload this file to your cgi-bin directory. # Read the CONFIGURATION section carefully. The only items you # need to set are the commands. # # The .html form only has to provide at the most, two # items - program and target. ################################################################## # # CONFIGURATION SECTION # # Put your list of commands here. The first column is the code you # will put in your form for any program. The "P-" at the start of # a code indicates that an argument MUST be specified. Otherwise # the code starts with "N-". If a parameter is forbidden, code # starts with "R-". # If no hostname (target) is specified by the user, then the CGI # environment variable 'REMOTE_ADDR' will be used. # # The actual locations of various utility programs vary from server # to server. The examples below are particular to our site. use strict; my %commands = ( 'N-PING', '/bin/ping -c 5 -w 5 ', 'N-TRACE', '/usr/sbin/traceroute ', 'P-LOOK', '/usr/bin/host -a ', 'P-LOOKA', '/usr/bin/host -l -v -t any ', 'P-FING', '/usr/bin/finger ', 'R-UP', '/usr/bin/uptime' ); ################################################################## # THERE IS NOTHING YOU NEED DO BEYOND THIS POINT ################################################################## my $PROGRAMM = ''; # Programmname (1. Wert des Hashes %commands) my $ZIELHOST = ''; # Eingabeparameter my $temp = ''; # Hilfvariable my $i = 0; # Zaehlvariable my $content = ''; # Variablen zur Aufbereitung der CGI-Parameter my $key = ''; my %fields = (); # to prevent runaways, call it quits after 60 seconds. $SIG{'ALRM'} =\&alarm_handle; alarm(60); print "Content-type: text/html\n\n"; print "