Contrôle des rootkits : ma machine s’est-elle fait cyber-hackée-chuidanlamerde ?

closeCet article a été publié il y a 16 ans 10 mois 12 jours, il est donc possible qu’il ne soit plus à jour. Les informations proposées sont donc peut-être expirées.

Des fois qu’un gros [pas] malin ait trouvé un accès à votre machine Linux puis une faille (ou un accès root), s’il veut faire le vilain avec, il y a de fortes chances qu’il modifie certains binaires systèmes pour masquer sa présence et celle de ses processus qu’il voudrait masquer.
Si le mec est doué (plus doué que vous), vous ne verrez jamais rien. Si c’est un imbécile qui a juste trouvé votre compte root, il risque de mal se cacher. Vous pouvez installer l’outil chkrootkit pour vérifier la présence de « Root Kits » (programmes systèmes modifiés pour protéger sa précence, exemple : « ps » ne montrera pas tel ou tel programme).

Sous Debian, installez l’outil par la commande suivante :

apt-get install chkrootkit

Quelques questions sont posées, voici mon avis :

  • « Faut-il lancer chkrootkit quotidiennement » : OUI.
  • C’est l’intérêt d’un tel programme : espérer être alerté à temps si un vilain commence à traficoter sur votre système.

  • « Options à utiliser pour la tâche quotidienne » : -q.
  • Si vous vous pouvez la question, c’est qu’il vous faut mettre « -q », sinon vous sauriez 😉

  • « Faut-il signaler seulement les problèmes différents de ceux de la veille » : OUI.
  • Attention : il faut bien réaliser que les logs sont alors cumulatifs. Tant que tout va bien, c’est bon. Mais le jour où vous avez quelque chose de suspect, souvenez-vous des logs des jours précédents pour comprendre ce qu’il se passe.

    Voilà, vous pouvez aussi lancer à la main le programme pour vous faire une première idée, et espérer être vierge de tout problème :

    mamachine:~# chkrootkit
    ROOTDIR is `/'
    Checking `amd'... not found
    Checking `basename'... not infected
    Checking `biff'... not found
    Checking `chfn'... not infected
    Checking `chsh'... not infected
    Checking `cron'... not infected
    Checking `crontab'... not infected
    Checking `date'... not infected
    Checking `du'... not infected
    Checking `dirname'... not infected
    Checking `echo'... not infected
    Checking `egrep'... not infected
    Checking `env'... not infected
    Checking `find'... not infected
    Checking `fingerd'... not found
    Checking `gpm'... not found
    Checking `grep'... not infected
    Checking `hdparm'... not found
    Checking `su'... not infected
    Checking `ifconfig'... not infected
    Checking `inetd'... not infected
    Checking `inetdconf'... not infected
    Checking `identd'... not found
    Checking `init'... not infected
    Checking `killall'... not infected
    Checking `ldsopreload'... not infected
    Checking `login'... not infected
    Checking `ls'... not infected
    Checking `lsof'... not infected
    Checking `mail'... not infected
    Checking `mingetty'... not found
    Checking `netstat'... not infected
    Checking `named'... not infected
    Checking `passwd'... not infected
    Checking `pidof'... not infected
    Checking `pop2'... not found
    Checking `pop3'... not found
    Checking `ps'... not infected
    Checking `pstree'... not infected
    Checking `rpcinfo'... not infected
    Checking `rlogind'... not found
    Checking `rshd'... not found
    Checking `slogin'... not infected
    Checking `sendmail'... not infected
    Checking `sshd'... not infected
    Checking `syslogd'... not infected
    Checking `tar'... not infected
    Checking `tcpd'... not infected
    Checking `tcpdump'... not infected
    Checking `top'... not infected
    Checking `telnetd'... not found
    Checking `timed'... not found
    Checking `traceroute'... not infected
    Checking `vdir'... not infected
    Checking `w'... not infected
    Checking `write'... not infected
    Checking `aliens'... no suspect files
    Searching for sniffer's logs, it may take a while... nothing found
    Searching for HiDrootkit's default dir... nothing found
    Searching for t0rn's default files and dirs... nothing found
    Searching for t0rn's v8 defaults... nothing found
    Searching for Lion Worm default files and dirs... nothing found
    Searching for RSHA's default files and dir... nothing found
    Searching for RH-Sharpe's default files... nothing found
    Searching for Ambient's rootkit (ark) default files and dirs... nothing found
    Searching for suspicious files and dirs, it may take a while...
    /usr/lib/iceweasel/.autoreg
    /lib/init/rw/.ramfs
    
    Searching for LPD Worm files and dirs... nothing found
    Searching for Ramen Worm files and dirs... nothing found
    Searching for Maniac files and dirs... nothing found
    Searching for RK17 files and dirs... nothing found
    Searching for Ducoci rootkit... nothing found
    Searching for Adore Worm... nothing found
    Searching for ShitC Worm... nothing found
    Searching for Omega Worm... nothing found
    Searching for Sadmind/IIS Worm... nothing found
    Searching for MonKit... nothing found
    Searching for Showtee... nothing found
    Searching for OpticKit... nothing found
    Searching for T.R.K... nothing found
    Searching for Mithra... nothing found
    Searching for OBSD rk v1... nothing found
    Searching for LOC rootkit... nothing found
    Searching for Romanian rootkit... nothing found
    Searching for Suckit rootkit... nothing found
    Searching for Volc rootkit... nothing found
    Searching for Gold2 rootkit... nothing found
    Searching for TC2 Worm default files and dirs... nothing found
    Searching for Anonoying rootkit default files and dirs... nothing found
    Searching for ZK rootkit default files and dirs... nothing found
    Searching for ShKit rootkit default files and dirs... nothing found
    Searching for AjaKit rootkit default files and dirs... nothing found
    Searching for zaRwT rootkit default files and dirs... nothing found
    Searching for Madalin rootkit default files... nothing found
    Searching for Fu rootkit default files... nothing found
    Searching for ESRK rootkit default files... nothing found
    Searching for rootedoor... nothing found
    Searching for ENYELKM rootkit default files... nothing found
    Searching for anomalies in shell history files... nothing found
    Checking `asp'... not infected
    Checking `bindshell'... not infected
    Checking `lkm'... chkproc: nothing detected
    Checking `rexedcs'... not found
    Checking `sniffer'... lo: not promisc and no packet sniffer sockets
    eth1: PACKET SNIFFER(/sbin/dhclient[1781])
    Checking `w55808'... not infected
    Checking `wted'... chkwtmp: nothing deleted
    Checking `scalper'... not infected
    Checking `slapper'... not infected
    Checking `z2'... chklastlog: nothing deleted

    Au moins vous savez ce que l’outil recherche.

    4 comments

    1. ben apres une attaque j ai passé l outil et ca ma donné ca :

      ROOTDIR is `/’

      Checking `ifconfig’… INFECTED

      Checking `pstree’… INFECTED

      Searching for t0rn’s v8 defaults… Possible t0rn v8 \(or variation\) rootkit installed

      Searching for Showtee… Warning: Possible Showtee Rootkit installed

      Searching for LOC rootkit… nothing found
      Searching for Romanian rootkit… /usr/include/file.h /usr/include/proc.h

      ca je ne vois pas ce que c est ?

      ********* simple selection ********* ********* selection by list *********
      -A all processes -C by command name
      -N negate selection -G by real group ID (supports names)
      -a all w/ tty except session leaders -U by real user ID (supports names)
      -d all except session leaders -g by session leader OR by group name
      -e all processes -p by process ID
      T all processes on this terminal -s processes in the sessions given
      a all w/ tty, including other users -t by tty
      g all, even group leaders! -u by effective user ID (supports names)
      r only running processes U processes for specified users
      x processes w/o controlling ttys t by tty
      *********** output format ********** *********** long options ***********
      -o,o user-defined -f full –Group –User –pid –cols
      -j,j job control s signal –group –user –sid –rows
      -O,O preloaded -o v virtual memory –cumulative –format –deselect
      -l,l long u user-oriented –sort –tty –forest –version
      X registers –heading –no-heading
      ********* misc options *********
      -V,V show version L list format codes f ASCII art forest
      -m,m show threads S children in sum -y change -l format
      -n,N set namelist file c true command name n numeric WCHAN,UID
      -w,w wide output e show environment -H process heirarchy
      OooPS!
      chkproc: Warning: Possible LKM Trojan installed

    2. La suite de ça :
      ca je ne vois pas ce que c est ?
      ********* simple selection ********* ********* selection by list *********
      -A all processes -C by command name

      C’est la syntaxe de l’outil.

      Par contre, le reste => machine en sale état 🙁

    3. bon, j ai 2 dedibox et un serveur OVH, je suis tenté de démarrer un serveur sous débian, chez OVH c est une version nue 2.6.18 – 4.0 Etch Stable
      ca veut dire je pense se taper toutes les installations
      Il faut que j aille voir chez dedibox ce qu ils ont
      quoi qui le soit je suis un peu novice sous linux, mais je sens qu avec ton blog et ta documentation je pourrais m en sortir
      le but etant d installer :
      – Apache/mysql,
      – gérer quelques sites web (oscommerce) envoyant des emails,
      – heberger un serveur fear combat, classé dans les 5 serveurs les plus joués dans le monde.
      – un serveur teamspeak
      – une interface webmin, plesk ?, graphique ?
      – Avoir une config protégée et qui mouline aux petits oignons
      Si tu penses que ce noyau peut assurer tous ca avec confiance, je me lance

    Laisser un commentaire

    Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

    Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.