Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^3: How to "source" a shell file in Perl? (Trojan Dump)

by LanX (Saint)
on Jun 12, 2013 at 20:04 UTC ( [id://1038572]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    open my $source,'-|',"bash /tmp/wrapper.sh" or die "$!";
    
    ...
    eval $dump;
    
    print $VAR1->{MONK};  #> jfroebe
    
  2. or download this
    lanx@nc10-ubuntu:/tmp$ cat wrapper.sh 
    . /tmp/src.sh
    ...
    export MONK=jfroebe
    
    lanx@nc10-ubuntu:/tmp$
    
  3. or download this
    my $bashcode=<<'_bash_';
    . /tmp/src.sh;
    ...
    eval $dump;
    
    print $VAR1->{MONK};  #> jfroebe
    
  4. or download this
    my $bashcode=<<'__bash__';
    . /tmp/src.sh;
    ...
    eval qx{bash -c "$bashcode"};
    
    print $VAR1->{MONK};  #> jfroebe
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2024-04-23 13:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found