Execute the content of binary from a pipe Execute the content of binary from a pipe shell shell

Execute the content of binary from a pipe


I believe the answer is no.

You can execute a file manually by passing it to the Linux loader, which will be named something like /lib/ld-linux.so.* It needs an actual file, though. It can't execute a pipe or stdin; it needs to be able to mmap() the file.

$ /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /bin/true$ /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 - < /bin/true-: error while loading shared libraries: -: cannot open shared object file: No such file or directory$ /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 <(cat /bin/true)/dev/fd/63: error while loading shared libraries: /dev/fd/63: invalid ELF header

* On my Red Hat machine it's /lib/ld-linux.so.2 (32-bit) or /lib64/ld-linux-x86-64.so.2 (64-bit). On my Ubuntu machine it's /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2.