App-HTTP_Proxy_IMP
view release on metacpan or search on metacpan
examples/DelayRequest.pm view on Meta::CPAN
use strict;
use warnings;
package DelayRequest;
use base 'Net::IMP::HTTP::Request';
use fields qw(delayed);
use Net::IMP;
use Net::IMP::HTTP;
use Net::IMP::Debug;
use Scalar::Util 'weaken';
sub RTYPES { ( IMP_PASS ) }
sub new_analyzer {
examples/ReplaceUA.pm view on Meta::CPAN
use strict;
use warnings;
package ReplaceUA;
use base 'Net::IMP::HTTP::Request';
use fields qw(ua);
use Net::IMP;
use Net::IMP::Debug;
my $UA = 'Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.20';
sub RTYPES { ( IMP_PASS,IMP_REPLACE ) }
sub new_analyzer {
lib/App/HTTP_Proxy_IMP/IMP/CSRFprotect.pm view on Meta::CPAN
# PoC for CSRF protection
# see pod at the end for detailed description of the idea and references
use strict;
use warnings;
package App::HTTP_Proxy_IMP::IMP::CSRFprotect;
use base 'Net::IMP::HTTP::Request';
use fields (
'target', # target domain from request header
'origin', # domain from origin/referer request header
);
use Net::IMP qw(:DEFAULT :log);
use Net::IMP::Debug;
use Net::IMP::HTTP;
sub RTYPES { return (
lib/App/HTTP_Proxy_IMP/IMP/Example/changeTarget.pm view on Meta::CPAN
# sample IMP plugin to change target host by replacing request header
# for this example it get changed to spiegel.de - whatever we want to access
# THIS IS JUST A SILLY EXAMPLE!!!!
use strict;
use warnings;
package App::HTTP_Proxy_IMP::IMP::Example::changeTarget;
use base 'Net::IMP::HTTP::Request';
use Net::IMP;
use Net::IMP::Debug;
my $target = 'www.spiegel.de';
sub RTYPES { ( IMP_PASS,IMP_REPLACE,IMP_DENY ) }
sub new_analyzer {
my ($class,%args) = @_;
my $self = $class->SUPER::new_analyzer(%args);
lib/App/HTTP_Proxy_IMP/IMP/FakeResponse.pm view on Meta::CPAN
use strict;
use warnings;
package App::HTTP_Proxy_IMP::IMP::FakeResponse;
use base 'Net::IMP::HTTP::Request';
use fields qw(root file response);
no warnings 'experimental'; # smartmatch
use Net::IMP;
use Net::IMP::Debug;
use Carp;
use Digest::MD5;
sub RTYPES { ( IMP_PASS,IMP_REPLACE,IMP_DENY,IMP_ACCTFIELD ) }
t/02_leak.t view on Meta::CPAN
impns => ['App::HTTP_Proxy_IMP::IMP'],
filter => [ DummyFilter->new_factory ],
addr => [[ $socket,$saddr ]],
});
die "proxy exit";
exit;
}
{
package DummyFilter;
use base 'Net::IMP::HTTP::Request';
use Net::IMP;
sub RTYPES { (IMP_PASS) }
sub new_analyzer {
Devel::TrackObjects->show_tracked;
my $self = shift;
my $obj = $self->SUPER::new_analyzer(@_);
$obj->run_callback(
[ IMP_PASS,0,IMP_MAXOFFSET ],
[ IMP_PASS,1,IMP_MAXOFFSET ],
);
( run in 0.448 second using v1.01-cache-2.11-cpan-de7293f3b23 )