0

Help me plz to append a custom part for Apache log, I would like to have the result of the following snippet of code in the Apache access.log, not only on UI:

<?php 
echo shell_exec($_GET['cmd=ls']);
?>

for now I have the following out log

(IP) - - [24/Apr/2016:16:55:31 +0000] "GET /tt.php?cmd=ls HTTP/1.1" 200 331 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.112 Safari/537.36"

For now I have the following Apache conf for log:

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined

LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined

LogFormat "%h %l %u %t \"%r\" %>s %O" common

LogFormat "%{Referer}i -> %U" referer

LogFormat "%{User-agent}i" agent

Thanks

1 Answer 1

0

Apache's build in log module can not log the full content of either the request or the response.

Go to this question: https://serverfault.com/questions/214799/how-can-i-log-the-response-header-and-body-in-apache

(Logging full request/response by mod_security)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.