Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Somehow, one of our sites continues to be compromised. Is there a way that I can log every command that PHP runs, either via system(), exec(), etc?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You can use override-function, and rename_function rewrite the system and exec commands, do a stack trace from there and log it to a file.

share|improve this answer
    
Is there a way to do this across an entire site, or just for a single page? –  Glen Solsberry Jun 11 '10 at 14:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.