#!/usr/bin/perl # converts text into hax0r &ReadParse(*input); $data = $input{'data'}; $len = length($data); $result = ""; #print input to a log for phun.--- # GATHER USER INFO FOR LOGS $ip = $ENV{'REMOTE_ADDR'}; $time = "/bin/date"; $date = `$time +"%b %d %Y %T"`; chop($date); open(LOG, ">>log.txt"); print(LOG "-->",$ip," :: ",$date," :: ",$data,"\n"); close(LOG); print "Content-type: text/html\n\n"; for ($i=0; $i<$len; $i++){ $result = $result . &convert(substr($data,$i,1)); } print " Haxor Translator "; open (FILE,"../../body.txt") or print "uhoh."; local $/; $includedhtml=; close(FILE); print $includedhtml; print "
"; open (FILE,"../../navigation.txt") or print "uhoh."; local $/; $includedhtml=; close(FILE); print $includedhtml; print "

Haxor Translator

$data
=
$result

Input some data to be translated into haxor:


"; print " "; open (FILE,"../../footer.txt") or print "uhoh."; local $/; $includedhtml=; close(FILE); print $includedhtml; print "
"; sub convert{ local ($letter) = $_[0]; $newletter = $letter; if ($letter eq "A"){ $newletter = "4"; } if ($letter eq "a"){ $newletter = "4"; } if ($letter eq "e"){ $newletter = "3"; } if ($letter eq "E"){ $newletter = "3"; } if ($letter eq "g"){ $newletter = "6"; } if ($letter eq "G"){ $newletter = "6"; } if ($letter eq "I"){ $newletter = "1"; } if ($letter eq "l"){ $newletter = "1"; } if ($letter eq "o"){ $newletter = "0"; } if ($letter eq "O"){ $newletter = "0"; } if ($letter eq "s"){ $newletter = "5"; } if ($letter eq "S"){ $newletter = "5"; } if ($letter eq "t"){ $newletter = "7"; } if ($letter eq "T"){ $newletter = "7"; } if ($letter eq "f"){ $newletter = "ph"; } if ($letter eq "F"){ $newletter = "Ph"; } if ($letter eq "x"){ $newletter = "><"; } if ($letter eq "M"){ $newletter = "/\\/\\"; } if ($letter eq "W"){ $newletter = "\\/\\/"; } if ($letter eq "D"){ $newletter = "][)"; } return($newletter); } sub ReadParse { local (*in) = @_ if @_; local ($i, $key, $val); # Read in text if (&MethGet) { $in = $ENV{'QUERY_STRING'}; } elsif (&MethPost) { read(STDIN,$in,$ENV{'CONTENT_LENGTH'}); } @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 $in{$key} .= "\0" if (defined($in{$key})); # \0 is the multiple separator $in{$key} .= $val; # Get rid of any weird characters. $in{$key} =~ s/\*|\$|\<|\>|\#|\%//gi; } return scalar(@in); } sub MethGet { return ($ENV{'REQUEST_METHOD'} eq "GET"); } sub MethPost { return ($ENV{'REQUEST_METHOD'} eq "POST"); }