Se você tiver um arquivo executável em que possa gravar, copie o conteúdo de ld.so
para esse arquivo usando read
:
while IFS= read -d '' -r line; do printf "%sbash-4.2$ ll foo
-rwxr-xr-x 1 muru muru 29K Aug 23 13:02 foo*
bash-4.2$ while IFS= read -d '' -r line; do printf "%sbash-4.2$ ./foo /bin/chmod
/bin/chmod: missing operand
Try '/bin/chmod --help' for more information.
" "$line"; done > foo < /lib64/ld-2.17.so
bash-4.2$ ./foo
Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
You have invoked 'ld.so', the helper program for shared library executables.
...
" "$line"; done > executable-file < /lib64/ld-2.17.so
Exemplo:
while IFS= read -d '' -r line; do printf "%sbash-4.2$ ll foo
-rwxr-xr-x 1 muru muru 29K Aug 23 13:02 foo*
bash-4.2$ while IFS= read -d '' -r line; do printf "%sbash-4.2$ ./foo /bin/chmod
/bin/chmod: missing operand
Try '/bin/chmod --help' for more information.
" "$line"; done > foo < /lib64/ld-2.17.so
bash-4.2$ ./foo
Usage: ld.so [OPTION]... EXECUTABLE-FILE [ARGS-FOR-PROGRAM...]
You have invoked 'ld.so', the helper program for shared library executables.
...
" "$line"; done > executable-file < /lib64/ld-2.17.so
Você pode usá-lo para executar chmod
: