Complete snake oil. With the help a few CPAN modules, i
didn't even need to understand the "encryption algorithm".
#!/usr/bin/perl -T
use strict;
use warnings;
use CGI;
use JavaScript;
use LWP::Simple;
use HTML::TokeParser::Simple;
if (CGI::param('go')) {
print CGI::header('text/plain');
my $javascript = fetch_js(CGI::param('url'));
parse_js($javascript);
} else {
print_form();
}
sub parse_js {
my $javascript = shift;
my $runtime = JavaScript::Runtime->new();
my $context = $runtime->create_context();
$context->bind_function(name => 'write', func => sub{ print @_});
return $context->eval($javascript);
}
sub fetch_js {
my $html = LWP::Simple::get(shift);
my $parser = HTML::TokeParser::Simple->new(\$html);
my ($token,$js);
while ($token = $parser->get_token) {
if ($token->is_start_tag('script')) {
$js = $parser->get_token->as_is;
last;
}
}
$js =~ s/document\.write/write/g;
return $js;
}
sub print_form {
my $q = CGI->new;
print $q->header(),
$q->start_html('See the source of cleverSource encrypted page'),
$q->start_form,
$q->textfield('url','http://cleverscripts.com/index.php?a=clever
+source'),
$q->submit('go'),
$q->end_form,
$q->end_html,
;
}
Be sure and download the necessary
Javascript libs in order to
be able to use JavaScript.
jeffa
L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|