Operating System - HP-UX
1753518 Members
5062 Online
108795 Solutions
New Discussion юеВ

commnd to find All world writable files in hpux 11.0 system ?

 
SOLVED
Go to solution
Sammy_2
Super Advisor

commnd to find All world writable files in hpux 11.0 system ?

I know you have to use find with some parameters ? But not sure the exatct command.
help.
Thanks
good judgement comes from experience and experience comes from bad judgement.
7 REPLIES 7
Sanjay_6
Honored Contributor
Solution

Re: commnd to find All world writable files in hpux 11.0 system ?

Hi Sam,

Try

find / -perm -o=w -exec ll {} \;

Hope this helps.

Regds
RAC_1
Honored Contributor

Re: commnd to find All world writable files in hpux 11.0 system ?

find . -type d -perm "0004" -exec ll {} \;
For directories-world writable

find . -type f -perm "0004" -exec ll {} \;
For world writable files

Anil
There is no substitute to HARDWORK
Rodney Hills
Honored Contributor

Re: commnd to find All world writable files in hpux 11.0 system ?

Be sure to put a "-d" after "ll" on the above commands, otherwise on directories you won't get a single line display of the directory and its permissions, but rather the contents of the directory will be displayed.

my 2 cents

-- Rod Hills
There be dragons...
Sammy_2
Super Advisor

Re: commnd to find All world writable files in hpux 11.0 system ?

Sanjay, Your find command works great. 10 pts for immediate and accurate reply.
RAC-
find . -type f -perm "0004" -exec ll {} \;
command yields nothing although I know there are world writable files in that directory ( ( I created 777 file and directory)
See below I created SAM directory and test file will full perms on server potion.
===================
potion:mkdir SAM
potion:chmod 777 SAM
potion:find . -type d -perm "0004" -exec ll {} \;
potion:find . -type d -perm "0004" -exec ls -d {} \;
potion:ls -ld SAM
drwxrwxrwx 2 root sys 96 Apr 27 12:13 SAM
potion:touch test
potion:chmod 777 test
potion:find . -type f -perm "0004" -exec ll {} \;
potion:find . -type f -perm "0004" -exec ls -d {} \;
========================================
Rodney- adding -d still does nothing. see above.
good judgement comes from experience and experience comes from bad judgement.
RAC_1
Honored Contributor

Re: commnd to find All world writable files in hpux 11.0 system ?

find . -type d -perm "0002" -exec ll {} \;
For directories-world writable

find . -type f -perm "0002" -exec ll {} \;
For world writable files


I missed it.

Anil
There is no substitute to HARDWORK
Rodney Hills
Honored Contributor

Re: commnd to find All world writable files in hpux 11.0 system ?

The above "find"s will find only those files that are exactly public write and no other permission settings.

To find any file/directory that has public write (and you don't care about the other permissions).

find . -type d -perm -0002 -exec ll -d {} \;

The "-" in front of 0002 tells find to ignore the other permission bits and only look at public write.

HTH

-- Rod Hills
There be dragons...
Sammy_2
Super Advisor

Re: commnd to find All world writable files in hpux 11.0 system ?

Rodney- My mistake. I did not make myself clear. Thanks. And now, all works as expected. I will add another 2 pts to give you full 10 pts.
good judgement comes from experience and experience comes from bad judgement.