Search for all files with a permission greater than 4755 - Aix

This is a discussion on Search for all files with a permission greater than 4755 - Aix ; Hello I'm trying to search an AIX 5.3 box for all files with the SETUID bit but have perms. greater than 4755. My current find command is: find / -perm -u=s -type f -print But this gives all files with ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Search for all files with a permission greater than 4755

  1. Search for all files with a permission greater than 4755

    Hello

    I'm trying to search an AIX 5.3 box for all files with the SETUID bit
    but have perms. greater than 4755.

    My current find command is:
    find / -perm -u=s -type f -print

    But this gives all files with the SETUID bit. I only need those with
    greater perms.

    Thanks for any and all help.

    Ben


  2. Re: Search for all files with a permission greater than 4755

    Benjamin wrote:

    > Hello
    >
    > I'm trying to search an AIX 5.3 box for all files with the SETUID bit
    > but have perms. greater than 4755.
    >
    > My current find command is:
    > find / -perm -u=s -type f -print
    >
    > But this gives all files with the SETUID bit. I only need those with
    > greater perms.
    >
    > Thanks for any and all help.
    >
    > Ben


    Ben;

    While not the slickest way... why don't you try find | grep for the
    corresponding permissions phrase such as:

    find / -ls |grep "r-xr-xr-xu" |pg

    You will of course have to modify the phrase/mask to search for the proper
    one but it should work. Then if you want a list to work with substiture
    ">filename" for the "|pg" portion.

    Good luck.

    B

  3. Re: Search for all files with a permission greater than 4755

    On Oct 28, 6:11 pm, bobmct wrote:
    > Benjamin wrote:
    > > Hello

    >
    > > I'm trying to search an AIX 5.3 box for all files with the SETUID bit
    > > but have perms. greater than 4755.

    >
    > > My current find command is:
    > > find / -perm -u=s -type f -print

    >
    > > But this gives all files with the SETUID bit. I only need those with
    > > greater perms.

    >
    > > Thanks for any and all help.

    >
    > > Ben

    >
    > Ben;
    >
    > While not the slickest way... why don't you try find | grep for the
    > corresponding permissions phrase such as:
    >
    > find / -ls |grep "r-xr-xr-xu" |pg
    >
    > You will of course have to modify the phrase/mask to search for the proper
    > one but it should work. Then if you want a list to work with substiture
    > ">filename" for the "|pg" portion.
    >
    > Good luck.
    >
    > B


    Thanks for the reply.

    I actually think the following will work for what I'm trying:
    find / -perm 4756 -type f -print -ls

    I think this will return all files with perms greater than 4755. In
    my tests, it will return files with perms 4757.

    Thanks for the help.

    Ben


  4. Re: Search for all files with a permission greater than 4755

    On Oct 27, 9:21 am, Benjamin wrote:
    > Hello
    >
    > I'm trying to search an AIX 5.3 box for all files with the SETUID bit
    > but have perms. greater than 4755.
    >
    > My current find command is:
    > find / -perm -u=s -type f -print
    >
    > But this gives all files with the SETUID bit. I only need those with
    > greater perms.
    >
    > Thanks for any and all help.
    >
    > Ben


    I run this looking for all "bad things" (watch for CRLF and jfs2 rule)

    find / -fstype jfs2 \( -name "authorized*" -o -name .rhosts -o -
    name .shosts -o -name .netrc -o \( -user root -a \( -perm -4000 -o -
    perm -2000 -o \( -perm -o+
    w -a ! -type l -a ! -type c -a ! -type s \) \) \) -o -perm -1777 -o -
    nouser -o -nogroup -o \( -name lost+found -exec ls -l {} \; \) \) -ls

    though I think this is all superceded by Aixpert


  5. Re: Search for all files with a permission greater than 4755

    On Oct 29, 6:28 pm, Henry wrote:
    > On Oct 27, 9:21 am, Benjamin wrote:
    >
    > > Hello

    >
    > > I'm trying to search an AIX 5.3 box for all files with the SETUID bit
    > > but have perms. greater than4755.

    >
    > > My current find command is:
    > > find / -perm -u=s -type f -print

    >
    > > But this gives all files with the SETUID bit. I only need those with
    > > greater perms.

    >
    > > Thanks for any and all help.

    >
    > > Ben

    >
    > I run this looking for all "bad things" (watch for CRLF and jfs2 rule)
    >
    > find / -fstype jfs2 \( -name "authorized*" -o -name .rhosts -o -
    > name .shosts -o -name .netrc -o \( -user root -a \( -perm -4000 -o -
    > perm -2000 -o \( -perm -o+
    > w -a ! -type l -a ! -type c -a ! -type s \) \) \) -o -perm -1777 -o -
    > nouser -o -nogroup -o \( -name lost+found -exec ls -l {} \; \) \) -ls
    >
    > though I think this is all superceded by Aixpert


    Thanks Henry, any chance you could explain a little of what this is
    looking for? It looks good for the few parts I can understand.

    Thanks.

    Ben


+ Reply to Thread