Bypassing no-execute permissions with one command.

I am sure all the people in the unix world are familiar with unix permissions.
Read, Write, and my favorite: Execute.

You can apply permissions to a file or even a mount point.
I think we also know that without execute permissions we cannot (supposedly) execute a script or binary.

There is a simple way to get around this, with 0-need for execute permissions.

try this to prove it to yourself:

Create a script file named test.sh
were going to do this real simple for now so just add this single line of code:
echo “It Works”

save the file
do not set execute permissions

now simply call the shell directly and use it to bypass execute permissions:
sh test.sh

the output will be: It Works.

This gets quite interesting when using a binary file.
It is possible to execute a binary the same way, but many will return an error without being properly formatted for this tick.

Anyhow do with it what you will.

Leave a Reply