Unix/Linux

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • hidding the content of a script

    1 answers - 1841 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Fri, 19 Aug 2005 00:29 +1000, thus spake Netocrat <netocrat@dodo.com.au>:
    Thu, 18 Aug 2005 07:49:06 -0700, matt_left_coast wrote:
    >
    >Lucas wrote:
    >[]

    I would like to make some exercises for a small AIX training. To do
    this I want to make a few scripts that do something evil to the S
    (corrupting the bootblock or filling the tmp filesystem to the last
    bit something like that) Then the students should fix it.
    The problem is that if they view the script that does this, they see
    the answer right away. (instead of having to troubleshoot the whole
    thing).
    Anybody suggestions on how to hide what the script is doing?
    >[]
    >
    >? Damn, you are instructing people and you don't know how to set the
    >permissions of a script file to be readable only by the owner and root??
    >I feel sorry for the people you are training.
    >

    A shell script must be readable by the user executing it since the shell
    must be able to read it.
    I thought about not responding since this seemed like possibly
    feeding some nefarious endeavor but, thinking again,
    such hiding of a script is easy to overcome by root.
    The way you do this is:
    chgrp bin myscript
    chmod 2551 myscript
    The file is now executable by world but not world-readable.
    And interesting sidenote to this (and hopefully someone can answer this)
    is that use of `basename $0` in such a non-readable but executable script
    has unexpected results. The script, which formerly would have
    been identified by `basename $0` as "myscript" is now shown by
    the Bourne shell as "4". This refers to /dev/fd/4
    but why? Can anyone answer this? Stephane? Chris?
    Dave Robbins
  • No.1 | | 2030 bytes | |

    In comp.unix.shell dave@geol.invalid:
    Fri, 19 Aug 2005 00:29 +1000, thus spake Netocrat <netocrat@dodo.com.au>:
    >>

    >Thu, 18 Aug 2005 07:49:06 -0700, matt_left_coast wrote:
    >>

    Lucas wrote:
    >>[]

    I would like to make some exercises for a small AIX training. To do
    this I want to make a few scripts that do something evil to the S
    (corrupting the bootblock or filling the tmp filesystem to the last
    bit something like that) Then the students should fix it.

    The problem is that if they view the script that does this, they see
    the answer right away. (instead of having to troubleshoot the whole
    thing).

    Anybody suggestions on how to hide what the script is doing?
    >>[]
    >>

    ? Damn, you are instructing people and you don't know how to set the
    permissions of a script file to be readable only by the owner and root??
    I feel sorry for the people you are training.
    >>

    >A shell script must be readable by the user executing it since the shell
    >must be able to read it.


    I thought about not responding since this seemed like possibly
    feeding some nefarious endeavor but, thinking again,

    ?
    Some people tried to help you, seems as if I start to feel sorry
    for the people you are "training".

    such hiding of a script is easy to overcome by root.
    The way you do this is:

    chgrp bin myscript
    chmod 2551 myscript

    The file is now executable by world but not world-readable.

    Nope it isn't. Just as everyone else already pointed out it's not
    possible for an user to execute a script he has no read
    permissions. Execute permission don't really matter as long as
    the user can read it.

    []

Re: hidding the content of a script


max 4000 letters.
Your nickname that display:
In order to stop the spam: 4 + 3 =
QUESTION ON "Unix/Linux"

EMSDN.COM