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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
[...] 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?