Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Usually J.A.P.H.

by ktross (Deacon)
on Mar 01, 2005 at 20:34 UTC ( [id://435603]=obfuscated: print w/replies, xml ) Need Help??

Prints out J.A.P.H. in a myriad of ways, and occasionally does something completely different.
#!/usr/bin/perl use LWP::Simple;$_='http://66.39.54.27';$c=get("$_/?node=1597"); while ($c =~ m/<a id =\"post-head-id(.*?)\"/g)#I'm Just Another {push(@_,$1);};($_[0] eq 435603)?$_[0]=$_[1]:1;#noob Perl Hacker getstore("$_/?displaytype=displaycode;node_id= $_[0]", "1");#>=) system("perl -w 1"); system(($^O eq 'MSWin32')?'del 1':'rm 1');#
-This can take a while to run at times

What it Does

Whether or not this code does anything interesting depends on whether anything interesting has recently been posted to the main OBFU site: www.perlmonks.org/?node=Obfustcated%20Code (a.k.a 66.39.54.27/?node=1597).

This code uses LWP to download the HTML of this webpage. The HTML is then examined to extract all of the node numbers from the postings. The code for the most recent node is downloaded and run, so long as this node (435603) is not the most recent (we wouldn't want to start an infinite loop, now would we). If there is no more recent node than this one, then the previous node's code is downloaded and run. If there are no code tags in the relavant node, nothing happens.

Most of the code posted in obfuscated code prints "J.A.P.H". Therefore, that's what this script will do....most of the time.

Replies are listed 'Best First'.
Re: Usually J.A.P.H.
by skx (Parson) on Mar 02, 2005 at 12:51 UTC

    ++ - An outstanding idea, and a nifty implementation.

    Steve
    ---
    steve.org.uk
Re: Usually J.A.P.H.
by JediWizard (Deacon) on Mar 03, 2005 at 19:05 UTC

    That is really cool. I do not think I would ever run it unless I had already gone and looked at what was going to happen this particular time. Even Still, it is a very cool idea, and well obfuscated to boot.

    ktross++


    A truely compassionate attitude towards other does not change, even if they behave negatively or hurt you

    —His Holiness, The Dalai Lama

      Hey kids! Remember what your mother told you:

    • Never talk to strangers
    • Never get into a stranger's car

      and...

    • Never run a strangers perl code that you don't understand.

      This is especially importiant if there is an eval or system statement involved. While most things posted here by monks are harmless; monks occasionnaly post code with some teeth for "interest."

      Perl safe!

        And the most usefull tool I have found for understanding obfuscated code:

        perl -MO=Deparse script.pl

        Does not take always make it obvious what the code is doing, but at least makes it easier to read and figure out.


        A truely compassionate attitude towards other does not change, even if they behave negatively or hurt you

        —His Holiness, The Dalai Lama

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://435603]
Approved by Tanktalus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-25 09:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found