The Wayback Machine - https://web.archive.org/web/20240905180659/https://www.geeksforgeeks.org/logcheck-tool-monitor-kali-linux-system-log-activity/
Open In App

Logcheck Tool – Monitor Kali Linux System Log Activity

Last Updated : 04 Jun, 2024
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report
News Follow

Logcheck is a package or tool to check system log files for security violations and unusual activity, it utilizes the program called logtail remembering the last position is read from the log file. Analyzes security or unusual activity from syslog to monitor Apache log files for errors caused by PHP Scripts. Logcheck is used to detect problems automatically in logfiles and results are sent via e-mail. It runs as cronjob off the hour and after every reboot

The tool has three modes of filtering:

  • Server: Default level containing different daemons
  • Paranoid: High-security machines run as service in this level also it is verbose.
  • Workstation: Level for Sheltered machines, filtering messages.

Logcheck Installation:

The logcheck package/repository is already installed in Ubuntu/Debian distribution, just use the apt-get command to install Logcheck in Linux then it will automatically start the downloading process and dependencies. 

$ apt-get install logcheck

An alternative method to install this is by downloading logcheck-1.1.12.tar.gz version and then installing the logcheck tool by using tar xvf command.

tar xvf logcheck-1.1.12.tar.gz
cd logcheck-1.1.12
make
make install

We can directly use the logcheck from the terminal without installation with the help of sudo or us by which we can change the user ID and also checks the logfiles without offset being updated.

Parameters used here are described as follows,

  • -u – syslog summary enabling 
  • -o – STDOUT mode, not sending mail
  • -t – Testing mode does not update offset
$ sudo -u logcheck logcheck -o -t
Screenshot1243-copy-(1)

Configuration:

Let’s now look at the configuration file logcheck.conf of logcheck located in /etc/logcheck directory and make the necessary changes in the file. 

$ vim /etc/logcheck/logcheck.conf

Logcheck a tool to Monitor Linux System Log Activity

Change the value for REPORTLEVEL of your choice of level for controlling level of filtering of logs, then change the value SENDMAILTO to your e-mail address, so you can receive the reports and logs on the E-mail ID as shown below.

Logcheck a tool to Monitor Linux System Log Activity

Whenever a mail is generated by logcheck has different subject lines for different events which can also be modified to control the subject.

Logcheck a tool to Monitor Linux System Log Activity

With the help of logfiles stored in /etc/logcheck/logcheck.logfiles for maintaining the list of logfiles that have to be monitored. For defining the list to use another file and in case stored in another location, so to define new PATH modify RULEDIR variable. 

Logcheck a tool to Monitor Linux System Log Activity

View the configuration files by navigating to /etc/logcheck/logcheck.logfiles or /etc/logcheck/logcheck.files directory for configuring the mail with respect to the report level given by you, these files contain a list of logfiles to be monitored. 

# vim logcheck.logfiles

Logcheck a tool to Monitor Linux System Log ActivityLogcheck a tool to Monitor Linux System Log Activity

Logcheck works using the files /etc/logcheck/ignore.d.server where it will check for lines that do not match rules in ignore files and then it will include those irregularities in the report which is then sent to the user via e-mail, it also reports unusual activity in log files, hard disk errors, failed authentication attempts and kernel issues. 

Usage:

We know that logcheck sends mail only when any suspicious activity is found, but we can also get the reports immediately or on an hourly basis by executing the following command,

$ logcheck -m

Other parameters to include for sending mail immediately,

  • -h – using this we can mention hostname to use it in the subject of the mail
  • -o – This option is used to send a report to stdout

Logcheck a tool to Monitor Linux System Log Activity

If using a system user it should have valid alias for logcheck and the sender/mailer (mail,sendmail, sSMTP, Postfix) has to be installed,

$ vim /etc/aliases

As we know /etc/logcheck/logcheck.logfiles are used to configure, read and monitor the files. This behavior can also be changed and reading files stored in any different location other than the default location. To do so execute the following command,

$ logcheck -c /etc/logcheck/logcheck.conf
$ logcheck -L /etc/logcheck/logcheck.conf

$ logcheck -t

 In the above command, Logtail is a utility command which has a record of positions the tool read from log files. in order to run the tool in testing mode, it can be done by using -t command and offsets will not be updated.

logcheck-test will test logcheck rules quickly and easily. It will parse logfiles to match the logs by single rule or rule file. The testing single rule against /var/log/syslog

$ logcheck-test -s "RULE"



Similar Reads

Sysmon – Graphical System Activity Monitor for Linux
Sysmon is a graphical system monitor for Linux. It shows the information about the CPU, GPU, Memory, HDD/SDD and network connections. It is similar to the Windows task manager. It is completely written into the python programming language. Sysmon shows the all information in the form of Graphical visualization. There are some features of these tool
2 min read
How to Monitor System Activity in Linux | top Command
top command is used to show the Linux processes. It provides a dynamic real-time view of the running system. Usually, this command shows the summary information of the system and the list of processes or threads which are currently managed by the Linux Kernel. As soon as you will run this command it will open an interactive command mode where the t
10 min read
Installing atop Tool To Monitor the System Process in Linux
atop is an ASCII full-screen interactive performance monitor which is kind of similar to the top command to view the load over a Linux system. The job of the most critical hardware resources (from a performance point of view) at the system level, i.e. CPU, memory, disk, and network can be seen. atop enable us to identify which processes are actuall
7 min read
Webkiller v2.0 - Tool Information Gathering tool in Kali Linux
Webkiller is a free and open-source tool available on GitHub. Webkiller is used as an information-gathering tool. Webkiller is used to scan websites for information gathering and finding vulnerabilities in websites and webapps. The whois data collection gives us information about Geoip lookup, Banner grabbing, DNS lookup, port scanning, sub-domain
3 min read
Cewl Tool - Creating Custom Wordlists Tool in Kali Linux
In this article, we will see how to create a wordlist with the Kali Linux tool Cewl and what options are available in this post. Cewl is a Ruby program that crawls a URL to a defined depth, optionally following external links, and produces a list of keywords that password crackers such as John the Ripper can use to crack passwords. can. FAB (Files
4 min read
Tool-X - Hacking Tool Installer in Kali Linux
Tool-X is a free and open-source tool written in python that is available on GitHub. Tool-X is used by security researchers and pen-testers in the early stages of reconnaissance and pen-testing. It is an installer framework for Kali Linux that has approximately 300 tools available on its menu. It will provide a command-line user interface that you
2 min read
Monitor and Find Statistics for Linux Processes Using pidstat Tool
Pidstat is a command-line tool and part of sysstat suite to monitor the Linux system. It is used to monitor every individual task currently being managed by the Linux kernel on the Linux system. Features of pistat: It can monitor every task running on the systemIt can also monitor the child's task of any task.It shows the total CPU usage by every t
4 min read
Progress - Tool to monitor progress of basic command in Linux
Progress is a command-line-based tiny tool which is formerly known as a Coreutils Progress Viewer. This tool is written in the C language. This command looks for the Coreutils basic command like cp, mv, dd, tar, gzip, cat, etc. which are currently running on the system and display the percentage of copied data. This tool can also show the estimated
2 min read
Kali-Whoami - Stay anonymous on Kali Linux
In today's life, we are surrounded by a lot of cyber security tools and we talk about our online anonymity, but are we really anonymous? A single mistake can reveal our anonymity, so here is a tool that can help us to make anonymity possible and it is called WHOAMI. It is very useful and has a very simple UI. Note: if you are a parrot user then you
3 min read
How to Monitor Linux Commands Executed by System Users in Real-time?
If you are a Linux system administrator then you would definitely want to monitor the interactive activity of all system users, like monitoring the Linux commands they execute in real-time. In this brief Linux system security article, we will be going to discuss how to monitor all Linux shell commands executed by system users in real-time. Let's se
1 min read
How to Monitor System Usage, Outages and Troubleshoot Linux Servers
As we know that Linux is very reliable and a great system administrator should always know the system's behavior and its utilization at every moment of time. So if an administrator or a user wants to monitor its complete system then they have to do the following Storage Space Utilization Linux provides two commands which are used to inspect storage
5 min read
Using htop to Monitor System Processes on Linux
htop a Linux tool that is used in process-managing and terminal-based system monitoring. It allows real-time monitoring of processes and performs every task to monitor the process in the Linux system. The tool is written in the C programming language by Hisham Muhammad. It displays a complete list of processes running on the system and gives inform
5 min read
SAR command in Linux to monitor system performance
sar (System Activity Report) It can be used to monitor Linux system's resources like CPU usage, Memory utilization, I/O devices consumption, Network monitoring, Disk usage, process and thread allocation, battery performance, Plug and play devices, Processor performance, file system and more. Linux system Monitoring and analyzing aids in understandi
6 min read
Kali Linux - Password Cracking Tool
Password cracking is a mechanism that is used in most of the parts of hacking. Exploitation uses it to exploit the applications by cracking their administrator or other account passwords, Information Gathering uses it when we have to get the social media or other accounts of the C.E.O. or other employees of the target organization, Wifi Hacking use
5 min read
Sherlock - Hunt Username on Social Media Kali Linux Tool
Sherlock is a free and open-source tool available on GitHub. This tool is free you can download it from Github and can use it for free of cost. Sherlock is used to finding usernames on social media on 300 sites. As you know many users register themselves on social media platforms using their own name. Suppose we need to find someone on any social m
3 min read
Gasmask – Information Gathering Tool in Kali Linux
Gasmask is a free and open-source tool available on Github. Gasmask is an Open Source Intelligence and Information Gathering Tool based on (OSINT). Gasmask is capable of doing everything almost you need for reconnaissance as per your need it can perform reconnaissance easily. Gasmask works as an open-source tool intelligence tool. It integrates wit
7 min read
Knock - Subdomain Scanner Tool in Kali Linux
Knock is a tool written in Python and is designed to enumerate subdomains in a target domain through a wordlist. Installation: First clone the tool from the GitHub repository by using the below command. git clone https://github.com/santiko/KnockPy.git Then Change to your preferred directory. cd KnockPy How to use: Run tool: To run the tool and to k
1 min read
R3con1z3r – Lightweight Information Gathering Tool in Kali Linux
R3con1z3r is a free and open-source tool available on Github. R3con1z3 is one of the easiest and useful tools for performing reconnaissance on websites and web apps. The R3con1z3r tool is also available for Linux on Github. R3con1z3r is written in python language. You must have python language installed into your Kali Linux operating system. R3con1
5 min read
Auto Scanning to SSL Vulnerability - A2SV Tool in Kali Linux
A2SV is a free and open-source tool available on GitHub which is used as an information-gathering tool for SSL vulnerability. A2SV is used to scan websites for information gathering and finding SSL vulnerabilities in websites and webapps. A2SV is one of the easiest and useful tools for performing reconnaissance on websites and web apps for SSL Vuln
2 min read
Anubis - Subdomain enumeration and information gathering tool in Kali Linux
Anubis is a tool for information gathering. This tool is very useful in the initial phases of penetration testing. The main technique used to find subdomain using many modules is to target bruteforce with an improved wordlist Anubis is a free and open-source tool available on GitHub. This tool is free means you can download and use this tool free o
2 min read
Fcrackzip Tool - Crack a Zip File Password in Kali Linux
The fcrackzip utility and wordlists are included by default in Kali to crack passwords for these compressed files. Because of their compact size and encryption algorithm, we frequently use zipped files. These zipped files have a password protection feature that ensures the files' confidentiality. When you've forgotten your password and are stuck tr
3 min read
Grim - Information Gathering Tool in Kali Linux
Grim is a free and open-source tool available on GitHub. Grim is used to scanning websites for information gathering and finding vulnerabilities. Grim is written in PHP. It uses PHP script to do reconnaissance. Grim is so powerful that it can detect content management systems while scanning, it can detect IP addresses, it can detect webserver recor
2 min read
InfoSploit – Information Gathering Tool in Kali Linux
InfoSploit is a free and open-source tool available on Github. InfoSploit is used as an information-gathering tool. InfoSploit is used to scan websites for information gathering and finding vulnerabilities in websites and web apps. InfoSploit is one of the easiest and most useful tools for performing reconnaissance on websites and web apps. The Inf
7 min read
Legion Tool in Kali Linux
If you are using Kali Linux 2020.1 or up, then instead of Sparta, Kali Linux comes with the Legion, fork version of Sparta with improved features. Legion tool is a super-extensible and semi-automated network penetration testing framework. Legion is very easy to operate. Features of Legion Tool: GUI with panels and a long list of options that allow
2 min read
Installation of Wpscan Tool in Kali Linux
Wpscan (WordPress vulnerability Scanner) is a black box WordPress vulnerability scanner. Wpscan is used to scan remote WordPress installations or websites to find security issues. WordPress can also be used to enumerate WordPress plugins and themes and brute-force logins. Approximately 35% of the internet runs on WordPress, WordPress is a free cont
2 min read
Sparta Tool in Kali Linux
Information Gathering is a very important step before starting penetration testing. Mostly, Pen Testers begin their work by collecting information and this requires a lot of patience and effort. The information Gathering category has many tools that work differently, but the sole purpose is to gather information. The major tools are MSFConsole, dns
3 min read
Maltego Tool in Kali Linux
Maltego is an open-source intelligence forensic application. Which will help you to get more accurate information and in a smarter way. In simple words, it is an information-gathering tool. Features of Maltego: It is used for gathering information for security related work. It will save your time and make you work smarter and accurately.It will hel
2 min read
Hashcat Tool in Kali Linux
Hashcat is famous as the fastest password cracker and password recovery utility. Hashcat is designed to break or crack even the most complex passwords in a very less amount of time. Features of hashcat: The 90+ Algorithm can be implemented with performance and optimization in mind.The number of threads can be configured.Hashcat is a multi-algorithm
2 min read
ClamAV and ClamTk Antivirus Scanner Tool for Kali Linux
Malware, viruses, and Trojans are uncommon in Linux, although they are not unheard of. So, if you just require an antivirus once in a while, ClamAV is a great option. ClamAV is a free antivirus program that may be used for email scanning, online scanning, and endpoint security. It includes a multi-threaded daemon that is versatile and scalable, a c
6 min read
Kali Linux - Cisco-Torch Tool
Cisco-Torch is one of the best penetration testing and scanning tool. It is a mass scanning and exploitation tool. Which was written while working on the edition of “Hacking Exposed Cisco Networks”. Installation: It comes pre-installed in Kali-Linux but if not then just type the given command in the terminal box. sudo apt-get install cisco-torchHow
1 min read