in reply to Checking for Cloaked Webpages
First you need to hook up the gas anomaly detector to the photon torpedo's guidance system . . . . Wait, that's a cloaked Bird of Prey.
Presuming you control enough of the network infrastructure between you and the webserver so that you can succesfully spoof whatever IP and get the traffic back to you, if you setup an interface with the right IP you can fairly easily tell LWP to use that address for sending outgoing traffic.
package MyHTTP; use base qw(LWP::Protocol::http); sub _new_socket { my($self, $host, $port, $timeout) = @_; local($^W) = 0; # IO::Socket::INET can be noisy my @args = (PeerAddr => $host, PeerPort => $port, Proto => 'tcp', Timeout => $timeout, ); push @args, LocalAddr => $ENV{LWP_LOCAL_ADDR} if exists $ENV{LWP_LOCAL_ADDR}; my $sock = IO::Socket::INET->new( @args ); unless ($sock) { # IO::Socket::INET leaves additional error messages in $@ $@ =~ s/^.*?: //; die "Can't connect to $host:$port ($@)"; } $sock; } LWP::Protocol::implementor( 'http', 'MyHTTP' ); package main; use LWP::Simple qw( getprint ); getprint( shift || 'http://localhost/' ); exit 0; __END__
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Checking for Cloaked Webpages
by webadept (Pilgrim) on Dec 06, 2002 at 18:28 UTC | |
by Aristotle (Chancellor) on Dec 07, 2002 at 13:09 UTC |