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.

## uncomment the while loop below<br />

## to suppress the HTTP headers in the response<br />

#while() { # header<br />

# last if($_ eq "\r\n");<br />

#}<br />

while() { # body<br />

}<br />

print $_;<br />

close(S);<br />

exit;<br />

sub httpconnect {<br />

my ($server, $port) = @_;<br />

# check for proxy settings<br />

if($proxy_flag) {<br />

}<br />

$server = $proxy_ip;<br />

$port = $proxy_port;<br />

chop($hostname = `hostname`);<br />

$proto = getprotobyname('tcp');<br />

$thisaddr = gethostbyname($hostname);<br />

$thataddr = gethostbyname($server);<br />

$sin = sockaddr_in($port, $thataddr);<br />

socket(S, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";<br />

connect(S, $sin) or die "connect: $!";

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

Saved successfully!

Ooh no, something went wrong!