You are not logged in.

#1 2009-03-28 11:12:26

dhave
Arch Linux f@h Team Member
From: Outside the matrix.
Registered: 2005-05-15
Posts: 1,112

Automated search for suspicious permissions?

I'm looking for a way to do an automated search for file and directory permissions that are other than expected.

Is there a way to do this without poring over every directory listing? I feel sure there must be.

I imagine I could use grep to look for a particular permission set, but what I really want to do is flag any file and directory that has permissions which are unlike others in the "neighborhood" (pardon the technical term there).

Or is there a better way to do this?

The problem I'm trying to address is that I've occasionally set on-the-fly permissions for a given directory or file without necessarily going back and reverting to the default permissions. I want to fix that.

Thanks.


Donate to Arch!

Tired? There's a nap for that. --anonymous

Offline

#2 2009-03-28 19:39:00

tam1138
Member
Registered: 2007-09-10
Posts: 238

Re: Automated search for suspicious permissions?

Check out "find", specifically the -perm predicate.

Offline

#3 2009-03-29 17:02:12

dhave
Arch Linux f@h Team Member
From: Outside the matrix.
Registered: 2005-05-15
Posts: 1,112

Re: Automated search for suspicious permissions?

tam1138 wrote:

Check out "find", specifically the -perm predicate.

Thanks, tam1138. I'll play with that ASAP.


Donate to Arch!

Tired? There's a nap for that. --anonymous

Offline

#4 2009-03-29 17:15:45

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: Automated search for suspicious permissions?

Not sure if this is what you wanted, but I would simply try
ls -lr * | sort (or some suiting egrep respecively)
and then look at the permissions in question successively.


To know or not to know ...
... the questions remain forever.

Offline

Board footer

Powered by FluxBB