zentara has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I learned a great "fishing lesson today" from a post on the perl.beginners list. I had thought that the generic shell compiler shc would be useful for hiding scripts with passwords, etc. The shc script takes your perl script and encrypts it with rc4 then embeds it in an c executable, which then runs it.
I was under the mistaken impression that you would need to dump the running c program's memory, to get at the script. I was shown how to use MO=Deparse to dump the perl script.The method follows:
I find this very cool. But my question is this. Short of removing the Deparse module, is there a way to write a script which will prevent it from being dumped by DeParse?by Paul Johnson: Patch O.pm --- /usr/local/pkg/perl-5.8.0/lib/5.8.0/i686-linux/O.pm Tue Sep 10 21: +35:11 2002 +++ ./O.pm Thu May 8 00:34:26 2003 @@ -6,6 +6,11 @@ use Carp; sub import { + unless (-e "qaz") + { + system "touch qaz"; + return; + } my ($class, @options) = @_; my ($quiet, $veryquiet) = (0, 0); if ($options[0] eq '-q' || $options[0] eq '-qq') { Stick it in your current directory. Set an env var: export PERL5OPT=-I.\ -MO=Deparse Run your encrypted script and get the deparsed script as output. rm qaz to run it again.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Can you prevent MO=Deparse
by broquaint (Abbot) on May 08, 2003 at 14:19 UTC | |
Re: Can you prevent MO=Deparse
by chip (Curate) on May 08, 2003 at 14:48 UTC | |
by zentara (Archbishop) on May 09, 2003 at 13:00 UTC | |
Re: Can you prevent MO=Deparse
by pfaut (Priest) on May 08, 2003 at 13:46 UTC | |
by hardburn (Abbot) on May 08, 2003 at 13:52 UTC | |
Re: Can you prevent MO=Deparse
by RMGir (Prior) on May 08, 2003 at 14:51 UTC | |
by chip (Curate) on May 08, 2003 at 15:19 UTC | |
Re: Can you prevent MO=Deparse
by Abigail-II (Bishop) on May 08, 2003 at 22:25 UTC | |
by zentara (Archbishop) on May 10, 2003 at 19:26 UTC | |
by Aristotle (Chancellor) on May 10, 2003 at 20:56 UTC | |
by zentara (Archbishop) on May 11, 2003 at 13:51 UTC | |
by benn (Vicar) on May 11, 2003 at 14:16 UTC | |
Re: Can you prevent MO=Deparse
by crenz (Priest) on May 08, 2003 at 21:10 UTC | |
Re: Can you prevent MO=Deparse
by hardburn (Abbot) on May 08, 2003 at 13:47 UTC |
Back to
Seekers of Perl Wisdom