Unix Technical Forum

find executables

This is a discussion on find executables within the Slackware Linux Support forums, part of the Unix Operating Systems category; --> I used "find / -perm 4000" to find all suid files on the system, what i want to do ...


Go Back   Unix Technical Forum > Unix Operating Systems > Slackware Linux Support

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-19-2008, 11:30 AM
alex
 
Posts: n/a
Default find executables

I used "find / -perm 4000" to find all suid files on the system,

what i want to do is "find /home -perm +x" but that doesn't work, i've read
the man page, but i can't quite get it.. what command can i use to find any
file, with any exec bit (u+x OR g+x OR o+x) set?

Thanks

--
-alex


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-19-2008, 11:30 AM
Juergen Frieling
 
Posts: n/a
Default Re: find executables

Hallo alex

> what i want to do is "find /home -perm +x" but that doesn't work, i've


I think 'find /home -perm +111' should work.

Juergen
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-19-2008, 11:30 AM
Scott McMillan
 
Posts: n/a
Default Re: find executables

On Thu, 13 May 2004 14:42:25 GMT, "alex" <alex@hotmail.com> wrote:

>I used "find / -perm 4000" to find all suid files on the system,
>
>what i want to do is "find /home -perm +x" but that doesn't work, i've read
>the man page, but i can't quite get it.. what command can i use to find any
>file, with any exec bit (u+x OR g+x OR o+x) set?
>
>Thanks


'find /home -perm +1' should produce what you are looking for.


Scott McMillan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-19-2008, 11:30 AM
alex
 
Posts: n/a
Default Re: find executables

root@aeshells.com:~# find /home -perm 1
root@aeshells.com:~# find /home -perm 111
root@aeshells.com:~#

nope, neithier of those work, the part that gets me is that is says in the
man page, "exact permissions"

i've tested this and i can do -perm 740 and it will find any that are
exactly "740, etc.. etc..

is there anyway i can put this in a loop or something find all possible
combinations that include a
1 - 3 -5 -7 at any bit?

instead of manually coding a file that searches for each exact possiblity?

find /home -perm 001 >> find-exe.log
find /home -perm 010 >> find-exe.log
find /home -perm 100 >> find-exe.log
find /home -perm 410 >> find-exe.log
....etc...etc...

there are 343 possible cominations of permissions, and (if i did the right
math) 64 of them would be
exucutable...

anyway to automate this?

--alex


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-19-2008, 11:30 AM
Scott McMillan
 
Posts: n/a
Default Re: find executables

On Thu, 13 May 2004 11:15:17 -0400, Scott McMillan <smcm@usa.net>
wrote:

>On Thu, 13 May 2004 14:42:25 GMT, "alex" <alex@hotmail.com> wrote:
>
>>I used "find / -perm 4000" to find all suid files on the system,
>>
>>what i want to do is "find /home -perm +x" but that doesn't work, i've read
>>the man page, but i can't quite get it.. what command can i use to find any
>>file, with any exec bit (u+x OR g+x OR o+x) set?
>>
>>Thanks

>
>'find /home -perm +1' should produce what you are looking for.
>
>
>Scott McMillan


Oops, sorry, make that 'find /home -perm +111'. My previous post
would find files with u+x set, not any others.

I should learn to slow down when I'm typing ;-)


Scott McMillan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-19-2008, 11:30 AM
Scott McMillan
 
Posts: n/a
Default Re: find executables

On Thu, 13 May 2004 15:23:09 GMT, "alex" <alex@hotmail.com> wrote:

>root@aeshells.com:~# find /home -perm 1
>root@aeshells.com:~# find /home -perm 111
>root@aeshells.com:~#
>


You are missing the '+' in front of '1' and '111'.

'find /home -perm +111 ...' works on my Slack 9.1 with GNU find
version 4.1.7

>nope, neithier of those work, the part that gets me is that is says in the
>man page, "exact permissions"
>

<snipped>

>--alex
>



Scott McMillan
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-19-2008, 11:30 AM
Joost Kremers
 
Posts: n/a
Default Re: find executables

alex wrote:
> root@aeshells.com:~# find /home -perm 1
> root@aeshells.com:~# find /home -perm 111
> root@aeshells.com:~#
>
> nope, neithier of those work,


you're forgetting the + sign:

find /home -perm +111

--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-19-2008, 11:30 AM
alex
 
Posts: n/a
Default Re: find executables

> Oops, sorry, make that 'find /home -perm +111'. My previous post
> would find files with u+x set, not any others.


perfect.. ! now... any way to make it ignore directories?


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-19-2008, 11:30 AM
Joost Kremers
 
Posts: n/a
Default Re: find executables

alex wrote:
>> Oops, sorry, make that 'find /home -perm +111'. My previous post
>> would find files with u+x set, not any others.

>
> perfect.. ! now... any way to make it ignore directories?


find /home -perm +111 -type f

man find

--
Joost Kremers joostkremers@yahoo.com
Selbst in die Unterwelt dringt durch Spalten Licht
EN:SiS(9)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-19-2008, 11:30 AM
alex
 
Posts: n/a
Default Re: find executables

> find /home -perm +111 -type f

Thank you,

Now how about a script that puts that out put to a file, compares
it a previous output file, then email the differences to me
then if the proper arg is given, have the same script, compare the
output to a list of 'allowed' excutables in the /home. then automag-
ically remove any that are not on the 'allowed' list...

just kidding... i'll do the rest of the work my self, I much appreciate
your, and everyones, help on this post, and a million other past posts.

-alex


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 07:35 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com