[Full-disclosure] Mac OS X "ps(3)" and "top(3)" truncate output
Valdis.Kletnieks at vt.edu
Valdis.Kletnieks at vt.edu
Fri May 11 16:40:38 BST 2007
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....
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 226 bytes
Desc: not available
Url : http://lists.grok.org.uk/pipermail/full-disclosure/attachments/20070511/b4bb3b13/attachment.bin
Full-Disclosure is hosted and sponsored by Secunia.