Operating System - HP-UX
1752795 Members
6933 Online
108789 Solutions
New Discussion юеВ

Find files/directories which are writable by others group

 
SOLVED
Go to solution
ikbea
Frequent Advisor

Find files/directories which are writable by others group

Hi all,

How to list files/directories which are writable by "others" group ?
Thanks
9 REPLIES 9
Arunvijai_4
Honored Contributor

Re: Find files/directories which are writable by others group

# find / -group other

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
ikbea
Frequent Advisor

Re: Find files/directories which are writable by others group

Sorry, "others" group mean e.g.

rwxrwxrwx
^
|
|-----"I want to find the files/directories with world writable"

Thanks

RAC_1
Honored Contributor
Solution

Re: Find files/directories which are writable by others group

find /dir -type f -perm \(0002 -o -0020) -exec ll -d {} \;


find /dir -type d -perm \(0002 -o -0020) -exec ll -d {} \;
There is no substitute to HARDWORK
Arunvijai_4
Honored Contributor

Re: Find files/directories which are writable by others group

# find / -perm -2 -group other (list only "other" group)
# find / -perm -2 (list only world writable)

# find / -local -perm -2 (Only Local FS)

-Arun


"A ship in the harbor is safe, but that is not what ships are built for"
RAC_1
Honored Contributor

Re: Find files/directories which are writable by others group

Correction with syntaxes.

find /dir -type f -perm \(0002 -o -0020\) -exec ll -d {} \;


find /dir -type d -perm \(0002 -o -0020\) -exec ll -d {} \;

You can also do as follows.

find /dir -type f -perm o+w -exec ll -d {} \;
find /dir -type d -perm o+w -exec ll -d {} \;
There is no substitute to HARDWORK
Ranjith_5
Honored Contributor

Re: Find files/directories which are writable by others group

Hi,

These are security holes, find and remove them if not required.

Run:
For finding world writable files
-------------------------------------
find / -type f -perm -2 -exec ls -lg {} \;

For world writable directories:
----------------------------------
find / -type d -perm -2 -exec ls -ldg {} \;


Regards,
Syam
Muthukumar_5
Honored Contributor

Re: Find files/directories which are writable by others group

find . -group others -perm -0020 \( -type f -o -type d \) -exec ls -l {} \+

will do it.

It checks for,

a) group name with others
b) permission with group writable
c) File type
d) Or Directory

prints full information with ls -l {}

hth.

Easy to suggest when don't know about the problem!
Joseph Loo
Honored Contributor

Re: Find files/directories which are writable by others group

hi,

i believe u should have most of your answers in this post.

show your appreciation to those who have assisted u in finding your answers.

i think u should look at the points u have assigned. 2 out of 43 (and counting) is not good.

http://forums1.itrc.hp.com/service/forums/pageList.do?userId=CA685971&listType=unassigned&forumId=1

regards.
what you do not see does not mean you should not believe
ikbea
Frequent Advisor

Re: Find files/directories which are writable by others group

Thanks a lot !