If a file has permissions -rwx-wx-wx can it be read by other and group users, or can it only executed and written? Is there some way to read an executable file by executing it?
|
|
||||
|
|
A file with If it's a script (usually a text file with a If it's a binary executable, it can be executed directly, but its contents can't be read. This means, for example, that someone other than the owner can run it as a command, but can't grab a copy of the executable. Of course execution requires reading, but it's read by the kernel, not by the user. You might be able to get some information about the contents of the executable by examining the memory of the process as it's running, but I doubt that you could reconstruct the binary executable file. And if the executable is setuid, you can't examine the memory of the process (unless you have access to the account under which it's executing). Incidentally, |
|||||||
|
|
With those permissions, only the owner of the file can execute it. Other users can write to it, but not execute it (as execution in this case implies being able to read it) but they can write to it as a sort of black box:
|
|||||||||
|
|
The simple answer is no: only |
|||
|
|
|
Of course any file can be read by the root user. Also, the system loader, memory management, swapper, etc....will read a file with 'x' permission, otherwise it could not be executed. Possible holes in disclosing executable contents could be the /proc file for the process, core files, or by using a debugger. |
||||
|
|