[LA.pm] playing with perl fire

Geoffrey Young geoff at modperlcookbook.org
Tue Jun 7 21:18:53 PDT 2005



David Heayn wrote:
> Recently I thought it would be a good idea to circumvent the proxy 
> blocker at work that disallows web browsing of "questionable" sites.

I wrote this perl implementation of a "questionable" site circumvention tool
a _long_ time ago, based on an article in 2600.  IIRC the article explained
how it worked and presented the code in lisp.  I'm sure you could implement
some dns lookups, etc, to make it fit your needs.  in fact, when I showed it
to a friend he programmed some windows thing that interfaced with msie, so
all you did was type in the url you wanted in a toolbar and ie opened the
appropriate back-door url.  but I don't use windows, so...

--Geoff

#!/usr/bin/perl

# usage: perl quad.pl 66.94.230.49

use strict;

use Math::BigInt;

my $binstring = join '', map { sprintf "%08b", $_ } split /\./, $ARGV[0];
my $decstring = Math::BigInt->new(0);

my $exp = length($binstring);

foreach my $i (1 .. $exp) {
  $decstring += substr($binstring, $i-1, 1) * (2 ** ($exp - $i));
}

(my $result = `host $ARGV[0]`) =~ m/name pointer\s+(.*)/;
print "http://$decstring would bring you to $1\n";


More information about the Losangeles-pm mailing list