/usr/share/doc/libhttp-proxy-perl/examples/rot13.pl is in libhttp-proxy-perl 0.304-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #!/usr/bin/perl -w
use HTTP::Proxy qw( :log );
use HTTP::Proxy::BodyFilter::tags;
use HTTP::Proxy::BodyFilter::simple;
use HTTP::Proxy::BodyFilter::htmltext;
use strict;
my $proxy = HTTP::Proxy->new(@ARGV);
my %noaccent = (
Agrave => 'A', Aacute => 'A', Acirc => 'A', Atilde => 'A',
Auml => 'A', Aring => 'A', AElig => 'AE', Ccedil => 'C',
Egrave => 'E', Eacute => 'E', Ecirc => 'E', Euml => 'E',
Igrave => 'I', Iacute => 'I', Icirc => 'I', Iuml => 'I',
Ntilde => 'N', Ograve => 'O', Oacute => 'O', Ocirc => 'O',
Otile => 'O', Ouml => 'O', Oslash => 'O', Ugrave => 'U',
Uacute => 'U', Ucirc => 'U', Uuml => 'U', Yacute => 'Y',
agrave => 'a', aacute => 'a', acirc => 'a', atilde => 'a',
auml => 'a', aring => 'a', aelig => 'ae', ccedil => 'c',
egrave => 'e', eacute => 'e', ecirc => 'e', euml => 'e',
igrave => 'i', iacute => 'i', icirc => 'i', iuml => 'i',
ntilde => 'n', ograve => 'o', oacute => 'o', ocirc => 'o',
otile => 'o', ouml => 'o', oslash => 'o', ugrave => 'u',
uacute => 'u', ucirc => 'u', uuml => 'u', yacute => 'y',
'yuml' => 'y', 'Æ' => 'AE', 'æ' => 'ae',
);
my $re = join '|', sort keys %noaccent;
$proxy->push_filter(
mime => 'text/html',
response => HTTP::Proxy::BodyFilter::tags->new, # protect tags
response => HTTP::Proxy::BodyFilter::simple->new( # remove accents
sub { ${ $_[1] } =~ s/&($re);/$noaccent{$1}/go; }
),
response => HTTP::Proxy::BodyFilter::htmltext->new( # rot13
sub {
tr{ÀÁÂÃÄÅÇÈÉÊËÌÍÎÏÑÒÓÔÕÖØÙÚÛÜÝàáâãäåçèéêëìíîïñòóôõöøùúûüýÿ}
{AAAAAACEEEEIIIINOOOOOOUUUUYaaaaaaceeeeiiiinoooooouuuuyy};
tr/a-zA-z/n-za-mN-ZA-M/;
}
)
);
$proxy->start;
|