File Integrity Check Script

Once on one server it was necessary to monitor the integrity of the file in which the changes were made, and if someone performed a system update, then this file could change and corrections had to be made again.
Usually I use a Zabbix agent and a Zabbix server for such purposes, but this server was single and it makes no sense to install a Zabbix server on it, so I wrote a simple script:

Continue reading “File Integrity Check Script”

Script for email notifications when detecting prohibited files

Once, a vulnerability was revealed on one of the file hosting services through which an attacker could upload files to a PHP server and execute it, the vulnerability was fixed and just in case, I wrote a script that would send an email if a PHP file was found in the specified directory:

Continue reading “Script for email notifications when detecting prohibited files”

Script to check the free space on the HDD

Usually I use Zabbix to monitor free space on the disk system, which also notifies when it is running out, but Zabbix is not used on some servers, so I wrote a small script that performs this check and sends an email notification, for example, if there is less than 12Gb of free memory:

Continue reading “Script to check the free space on the HDD”

The script against DDOS attacks

I will give an example of a simple script against DDOS attacks for NAT servers.
The script is executed when the total number of “conntrack” connections is more than 500000, it saves to the text file the IP address which has the most “conntrack” connections, who has more than 10,000 – adds to the ipset list.

Continue reading “The script against DDOS attacks”