How to execute Linux binary without execute permission

2017-09-18 · 1 min read

You can execute a binary in Linux without the execute permission. Use /lib/ld*.so or /lib64/ld*.so as an ELF interpreter. The actual name differs from architecture to architecture. ld is the program linker/loader. It finds and loads the shared libraries used by the program and executes it. ld-linux handles ELF binaries.

cp /bin/ls /tmp/ls
chmod a-x /tmp/ls
/lib/ /tmp/ls
/lib64/ /tmp/ls

Subscribe to My Newsletter

The latest programming-related news, articles and resources - sent to your inbox monthly. Unsubscribe anytime.