Script Shell de détection des logiciels malveillants et des portes dérobées


5

J'essaie de créer un script shell qui peut détecter automatiquement les logiciels malveillants, les backdoors et les rootkits et j'essaie de le rechercher.J'ai trouvé des choses comme

find . -name “*.js” | xargs grep -l “eval(unescape”
find . -name “*.php” | xargs grep -l “eval(base64_decode” 

Mais je ne trouve pas que ceux-ci pertinents pour trouver les fichiers .php et .js et essayer de voir s'il s'agit de logiciels malveillants.Quelqu'un peut-il s'il vous plaît m'aider à donner une idée générale que je peux utiliser pour le script afin qu'il puisse faire le travail de détection des logiciels malveillants, des portes dérobées et des rootkits.Plus précisément pour dire comment trouver ces malwares, backdoors et rootkits sur un système ubuntu.Merci.

6

You ask about 3 different things...

  1. Root kits;
  2. Backdoors;
  3. Malware.

Root kits

Most root kits use the kernel to hide themselves and they are only visible from within the kernel.

If you want to know how to find them why not use the power of open source and install rkhunter and see how they do it? You can find the source here.

Besides that CERT has a thorough explanation on what to look for when dealing with root kits. Highlights from the link:

  • Examine log files for connections from unusual locations or other unusual activity
  • Look for setuid and setgid files (especially setuid root files) everywhere on your system

    find / -user root -perm -4000 -print
    find / -group kmem -perm -2000 -print
    
  • Check your system binaries to make sure that they haven't been altered.

  • Examine all the files that are run by 'cron' and 'at.'
  • Check for unauthorized services.
  • Examine the /etc/passwd file on the system and check for modifications to that file.
  • Check your system and network configuration files for unauthorized entries.
  • Look everywhere on the system for unusual or hidden files (files that start with a period and are normally not shown by 'ls').

Most of these you can do from command line.

Also worth reading:

Backdoors

The problem with backdoors is that they generally are flaws in software that get abused. The basic set of rules...

  1. immediately install security updates when you're notified;
  2. do not install antivirus, as you really don't need it in Linux; unless you share files with Windows
  3. enable the firewall (sudo ufw enable) without further tweaks;
  4. stick to the official repo's as much as possible, and only deviate from them when strictly necessary and with much caution;
  5. keep Java (both openJDK and Oracle Java) disabled by default in your browser, and only enable it when needed;
  6. use Wine with caution;
  7. and most important of all: use your common sense. The biggest security threat is generally found between keyboard and chair.

Worth reading:

Malware

Scan /etc/hosts for weird IP adresses and host names. If you look at these:

either a browser extension or an alteration to /etc/hosts is the cause.

Also a good read is: