[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Full-disclosure] Mac OS X "ps(3)" and "top(3)" truncate output



On Fri, 11 May 2007 17:18:20 +0200, matador matador said:

> rfc-1918:~ xxx$ ps aux > ps_output

> we can see that "ps" doesn't print completely the path.

ps auxw will do so.  If that isn't enough, try 'ps auxewwwwww'

> rfc-1918:~ xxx$ cat ps_output | grep iTunes

This wins an award for 'Pointless use of cat'.  Preferred:

% grep iTunes ps_output
% grep iTunes <  ps_output

Or don't bother with the intermediate file at all:

% ps auxw | grep 'i[T]unes'

(Yes, the [] are intentional, and experienced Unix/Linux users know why :)

(As an added bonus, on some systems /bin/ps will notice that it's going to
a pipe, and automagically disable the 'trim to terminal width' code for you,
totally obviating the issue. A quick check shows Linux does, Solaris and an
older AIX box don't.)

> These issues open an user-space rootkit scenario.

No scenario that hasn't been there for literally a quarter of a century already,
the 'w' flag was added *decades* ago for basically this reason....


Attachment: pgpQjbGy638R3.pgp
Description: PGP signature

_______________________________________________
Full-Disclosure - We believe in it.
Charter: http://lists.grok.org.uk/full-disclosure-charter.html
Hosted and sponsored by Secunia - http://secunia.com/