Archive

Articles taggués ‘commands’

(D)DoS Deflate

13/03/2024 Comments off

About

(D)DoS Deflate is a lightweight bash shell script designed to assist in the process of blocking a denial of service attack. It utilizes the command below to create a list of IP addresses connected to the server, along with their total number of connections. It is one of the simplest and easiest to install solutions at the software level.

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

IP addresses with over a pre-configured number of connections are automatically blocked in the server’s firewall, which can be direct iptables or Advanced Policy Firewall (APF). (We highly recommend that you use APF on your server in general, but deflate will work without it.)

Notable Features

  • It is possible to whitelist IP addresses, via /usr/local/ddos/ignore.ip.list.
  • Simple configuration file: /usr/local/ddos/ddos.conf
  • IP addresses are automatically unblocked after a preconfigured time limit (default: 600 seconds)
  • The script can run at a chosen frequency via the configuration file (default: 1 minute)
  • You can receive email alerts when IP addresses are blocked.

Installation

wget http://www.inetbase.com/scripts/ddos/install.sh
chmod 0700 install.sh
./install.sh

Uninstallation

wget http://www.inetbase.com/scripts/ddos/uninstall.ddos
chmod 0700 uninstall.ddos
./uninstall.ddos

Questions?

Although most things are explained on this page, if you have any further questions, you may contact the original developer of the script, Zaf.

Categories: Réseau, Système Tags: ,

cssh: un outil pour les paresseux…

08/03/2024 Comments off

Cluster ssh

Cluster ssh

Cluster ssh est un outil merveilleux ! Combien de fois ai-je du retaper les mêmes commandes dans deux fenêtres shell différentes sous prétexte que les serveurs faisaient la même chose… Je pense à mes deux serveurs DNS, par exemple.

Évidemment, il faut faire attention à ce qu’on tape car la moindre erreur est reproduite en double… Mais quel bonheur de faire deux fois le travail et surtout d’avoir des configurations identiques quand on le désire.

Autre avantage: si on ouvre plusieurs sessions ssh dans la même commande shell, cssh redimensionne les fenêtres automatiquement.

Attention: si vous ajouter des fenêtres après coup sur Ubuntu, il les superposera sur les précédentes ce qui n’est pas folichon… Il faut prévoir votre nombre de session au départ. Par contre, sur Mac OS X, l’excellent csshX fait le boulot correctement.

Categories: Système Tags: ,

15 Linux Find Command Examples (Part2)

08/03/2024 Comments off

Find Files Based on Access / Modification / Change Time

You can find files based on following three file time attribute.

Access time of the file. Access time gets updated when the file accessed.
Modification time of the file. Modification time gets updated when the file content modified.
Change time of the file. Change time gets updated when the inode data changes. Lire la suite…

Categories: Système Tags: ,

15 Practical Linux Find Command Examples

06/03/2024 Comments off

Apart from the basic operation of looking for files under a directory structure, you can also perform several practical operations using find command that will make your command line journey easy.

In this article, let us review 15 practical examples of Linux find command that will be very useful to both newbies and experts. Lire la suite…

Categories: Système Tags: ,

15 Examples To Master Linux Command Line History

06/03/2024 Comments off

When you are using Linux command line frequently, using the history effectively can be a major productivity boost. In fact, once you have mastered the 15 examples that I’ve provided here, you’ll find using command line more enjoyable and fun.

1. Display timestamp using HISTTIMEFORMAT

Typically when you type history from command line, it displays the command# and the command. For auditing purpose, it may be beneficial to display the timepstamp along with the command as shown below.

# export HISTTIMEFORMAT='%F %T '
# history | more
1 2008-08-05 19:02:39 service network restart
2 2008-08-05 19:02:39 exit
3 2008-08-05 19:02:39 id
4 2008-08-05 19:02:39 cat /etc/redhat-release

2. Search the history using Control+R

Lire la suite…

Categories: Système Tags: ,