safest command-line (not GUI) program to view apache logs?
Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
[...] log files may contain information supplied directly by the client, without escaping. Therefore, it is possible for malicious clients to insert control-characters in the log files, so care must be taken in dealing with raw logs.
However, from Googling around, there seem to be no command-line (non-GUI) programs specifically for viewing possibly-malicious apache logs. Or am I wrong? Until now, I have been using less. Is that ok from a security standpoint?
tail -f will only show you the last 10 lines and all new lines coming in. But what if the information you are looking for is above the 10 lines?
(And don't be a smarass and answer with tail -n 20 -f )
The man pages are your friend.
I use tail as such:
tail -f -n 100 /var/log/httpd/access_log
-f The -f option causes tail to not stop when end of file is reached, but rather to wait for additional data to be appended to the input. The -f option is ignored if the standard input is a pipe, but not if it is a FIFO.
-n number The location is number lines.
The default starting location is "-n 10", or the last 10 lines of the input.
yeah, i can see how that could be a problem. so basically, don't feed the logs into any executable context, right?
i was actually worried more about someone using shell control characters to trick the shell itself into executing another (arbitrary) command. but now that i think about it, unredirected output from programs the shell executes are just sent to the shell's own stdout/stderr, and have no chance to influence the shell's commands (stdin). isn't that right?