Re: I'm not the process you think I am

From: Anatoly Vorobey (mellon_at_nonexisting.hamakor.org.il)
Date: Tue 31 Aug 2004 - 17:34:15 IDT


On Tue, Aug 31, 2004 at 04:52:14PM +0300, Muli Ben-Yehuda wrote:
> On Tue, Aug 31, 2004 at 04:33:40PM +0300, amos_at_amos.mailshell.com wrote:
>
> > Muli - could you give a little more background on what are you trying to
> > achieve?
>
> Make a process which is running with root capabilities appear in a
> standard ps output as though it belongs to user 'foo'. I can't change
> ps; I can't change the kernel. I can only use the standard POSIX
> APIs. I do have root on the system.

Can you surreptitiously modify LD_PRELOAD for the user who'll be running
ps/top (by modifying their startup files or whatever)? If you can, write
a tiny library that redirects open() to itself and, in
case a process is trying to open /proc/<your pid>/stat, writes out a
similar file in a different private location, opens that instead, and
returns the descriptor to the process. If your library is tiny enough
and the argument check is the first thing its modified open() does, no
one will notice the performance penalty.

-- 
avva
"There's nothing simply good, nor ill alone" -- John Donne
=================================================================
To unsubscribe, send mail to linux-il-request_at_linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request_at_linux.org.il


This archive was generated by hypermail 2.1.7 : Tue 31 Aug 2004 - 17:44:13 IDT