#!/usr/bin/perl -w # ichat-cookie.pl by Dogcow for pho # version 0.9 # syntax: ./ichat-cookie.pl servername portnumber cgi-vars cookie-vars use strict; use IO::Socket; my($client); my($server) = $ARGV[0]; my($port) = $ARGV[1]; my($cgivars) = $ARGV[2]; my($cookievars) = $ARGV[3]; # connect to the server $client = IO::Socket::INET->new( PeerAddr => $server, PeerPort => $port, Proto => 'tcp', Reuse => 1 ) || die "Couldn't connect to web server ($server).\n"; $client->autoflush(1); # print fancy stuff print "\n"; print "Connected to $server:$port\n\n"; print "Sending: $cgivars\n"; print "Sending: $cookievars\n\n"; # actually send it to the server print $client "GET $cgivars HTTP/1.0\n"; print $client "Cookie: $cookievars\n\n"; print "Done!\n\n"; exit;