12.07.2013 Views

One-way Web Hacking

One-way Web Hacking

One-way Web Hacking

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

$cgi_lib'filepre = "cgi-lib";<br />

$cgi_lib'bufsize = 8192;<br />

$cgi_lib'maxbound = 100;<br />

$cgi_lib'headerout = 0;<br />

sub ReadParse {<br />

local ($perlwarn);<br />

$perlwarn = $^W;<br />

$^W = 0;<br />

local (*in) = shift if @_;<br />

local (*incfn,<br />

*inct,<br />

*insfn) = @_;<br />

local ($len, $type, $meth, $errflag, $cmdflag, $got, $name);<br />

binmode(STDIN);<br />

binmode(STDOUT);<br />

binmode(STDERR);<br />

$type = $ENV{'CONTENT_TYPE'};<br />

$len = $ENV{'CONTENT_LENGTH'};<br />

$meth = $ENV{'REQUEST_METHOD'};<br />

if (!defined $meth || $meth eq '' || $meth eq 'GET' ||<br />

$meth eq 'HEAD' ||<br />

$type eq 'application/x-www-form-urlencoded') {<br />

local ($key, $val, $i);<br />

if (!defined $meth || $meth eq '') {<br />

$in = $ENV{'QUERY_STRING'};<br />

$cmdflag = 1;<br />

} elsif($meth eq 'GET' || $meth eq 'HEAD') {<br />

$in = $ENV{'QUERY_STRING'};<br />

} elsif ($meth eq 'POST') {<br />

if (($got = read(STDIN, $in, $len) != $len))

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!