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.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[...] 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
Quote:
-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.
Quote:
-n number The location is number lines.
Quote:
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.