Skip to content

execute perl code on remote server withouth copying source code (Perl code is eval-ved on remote server)

Notifications You must be signed in to change notification settings

lhost/perl-remote-exec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

perl-remote-exec

execute perl code on remote server withouth copying source code (Perl code is eval-ved on remote server)

Example

./perl-remote-exec.pl root@server ./test-print-args.pl a b c d
OUTPUT: '$VAR1 = {
          'args' => [
                      'a',
                      'b',
                      'c',
                      'd'
                    ],
          'command' => '-e'
        };
'

Notice: you don't need to copy perl scripts to remote server

background

The following command is executed:

ssh root@server perl -MMIME::Base64 \
  -e "\"eval decode_base64 qw=c3ViIGxvYWQgeyBldmFsKGRlY29kZV9iYXNlNjQoc2hpZnQpKTsgaWYgKCRAKSB7IHByaW50ICJ7IFwiZXJyb3JcIjogXCIkQFwiIH0iOyB9IGVsc2UgeyBydW4oQF8pOyB9IH0=; load(@ARGV);\"" \
    "IyEvdXNyL2Jpbi9wZXJsIC13Cgp1c2Ugc3RyaWN0Owp1c2UgRGF0YTo6RHVtcGVyOwoKc3ViIHJ1bihAKQp7IAoJcHJpbnQgRHVtcGVyKHsgY29tbWFuZCA9PiAkMCwgYXJncyA9PiBcQF8gfSk7Cn0KCg==" \
    a b c d

About

execute perl code on remote server withouth copying source code (Perl code is eval-ved on remote server)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages