Re: Howto strace apache as nobody/apache user?

From: Peter Kosinar (goober@ksp.sk)
Date: Wed May 31 2006 - 20:02:58 EDT


Hello,

> into many process after leaving its root credentials, usually being
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= calling some variant of setuid()/setgid()

> Is this a security feature of apache or what?

No, this is not Apache-specific. At least on Linux, calling set[ug]id()
turns off the so-called "dumpable" flag for the process. As a regular
user, you can only ptrace (that's the syscall used by strace) processes
which have this flag turned on (naturally, you also need to have the same
[ug]id as the process you're wanting to trace). If you are root or have
the CAP_SYS_PTRACE capability, these restrictions don't apply.

Another example -- if you're using an OpenSSH sshd with privilege
separation turned on, you should see two sshd processes associated with
every connection; one of them running as root, the other one as the user.
Still, you can't trace neither the first, nor the second because of
aforementioned criteria.

Peter

-- 
[Name] Peter Kosinar   [Quote] 2B | ~2B = exp(i*PI)   [ICQ] 134813278
------------------------------------------------------------------------------
This List Sponsored by: Cenzic
Concerned about Web Application Security? 
Why not go with the #1 solution - Cenzic, the only one to win the Analyst's 
Choice Award from eWeek. As attacks through web applications continue to rise, 
you need to proactively protect your applications from hackers. Cenzic has the 
most comprehensive solutions to meet your application security penetration 
testing and vulnerability management needs. You have an option to go with a 
managed service (Cenzic ClickToSecure) or an enterprise software 
(Cenzic Hailstorm). Download FREE whitepaper on how a managed service can 
help you: http://www.cenzic.com/news_events/wpappsec.php 
And, now for a limited time we can do a FREE audit for you to confirm your 
results from other product. Contact us at request@cenzic.com for details.
------------------------------------------------------------------------------


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:56:01 EDT