One common method of denial-of-service attack ( DoS) involves saturating the target machine with external communications requests.
If you want an indication of a denial of service (DoS) attack against your system’s , just run this command:
netstat -ant | grep SYN_RECV | wc -l
This command executes this steps.
Show all tcp connections in numeric format :
Parsing connections that are received from the network:
Count how many answers of SYN_RECV are:
You can perform a lot more complex things using netstat.
You can also add this in your .bashrc file.