goto.cgi
&parse_form; $ttt = $Data{'wheretogo'}; print "Location: $ttt\n\n"; #----------------------------------------------------------------------------- sub parse_form { if ($ENV{'REQUEST_METHOD'} eq 'GET') { &Error("GET NOT ALLOWED"); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @pairs = split(/&/, $buffer); } else { &Error("request_method"); } foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $name =~ tr/+/ /; $name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; # If they try to include server side includes, erase them, so they # arent a security risk if the html gets returned. Another # security hole plugged up. $value =~ s/<!--(.|\n)*-->//g; $Data{$name} = $value; } }
Copy & Paste
Make file named ; goto.cgi
upload to your site in "perl" folder