#!/usr/bin/perl $scripturl = 'http://www.codespy.com/scripts/stylesheet.css'; $bannerimage1 = 'http://www.codespy.com/images/backgroundframe.jpg'; $bannerimage2 = 'http://www.codespy.com/images/transparent.gif'; $body = 'BGCOLOR=FFFFFF TEXT=ffffff LINK=666699 VLINK=666699 ALINK=666699 topmargin=0 leftmargin=0 marginheight=0 marginwidth=0'; ############################################### if ($ENV{'REQUEST_METHOD'} eq 'GET') { $buffer = $ENV{'QUERY_STRING'}; } else { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); } @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $FORM{$name} = $value; } if ($FORM{'banner'}) { $banner = $FORM{'banner'}; } if ($FORM{'target'}) { $target = $FORM{'target'}; } ############################################### print "Content-type: text/html\n\n"; &ReadParse; ############################################### if ($in{'action'} eq '') { $in{'action'} = "main"; } # End if if ($in{'action'} eq 'main') { print "CodeSpy.com - Visiting a link\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "<h1 align=center>Ops!</h1>\n"; print "This document is designed to be viewed using Frame features. If you are seeing this message, please consider upgrading to a frames-compatible browser."; print "\n"; } elsif ($in{'action'} eq 'top') { print "CodeSpy.com - Visiting a link\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "
CodeSpy.com\n"; print " || Back To CodeSpy.com || \n"; print "Remove This Frame ||\n"; print "
\n"; print "\n"; } ############################################### # READPARSE FUNCTION DO NOT TOUCH ############################################### sub ReadParse { local (*in) = @_ if @_; local ($i, $key, $val); if ( $ENV{'REQUEST_METHOD'} eq "GET" ) { $in = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN,$in,$ENV{'CONTENT_LENGTH'}); } else { # Added for command line debugging # Supply name/value form data as a command line argument # Format: name1=value1\&name2=value2\&... # (need to escape & for shell) # Find the first argument that's not a switch (-) $in = ( grep( !/^-/, @ARGV )) [0]; $in =~ s/\\&/&/g; } @in = split(/&/,$in); foreach $i (0 .. $#in) { # Convert plus's to spaces $in[$i] =~ s/\+/ /g; # Split into key and value. ($key, $val) = split(/=/,$in[$i],2); # splits on the first =. # Convert %XX from hex numbers to alphanumeric $key =~ s/%(..)/pack("c",hex($1))/ge; $val =~ s/%(..)/pack("c",hex($1))/ge; # Associate key and value. \0 is the multiple separator $in{$key} .= "\0" if (defined($in{$key})); $in{$key} .= $val; } return length($in); }