Anti rootkit para Linux

Sin duda contra rootkits en Linux los dos más conocidos son rkhunter y chkrootkit, y yo me decanto siempre por el primero. Instalación y setup inicial Instalamos el paquete: aptitude install rkhunter Base de datos de archivos del sistema Hacemos un: rkhunter –propupd Para indexar los archivos del sistema. Deberemos hacerlo al instalar nuevos paquetes o actualizar existentes. Base de firmas Hacemos un update de las firmar: rkhunter –update Escanear bajo demanda Podemos lanzar una ejecución bajo demanda así: rkhunter -c –enable all –disable none –rwo Con –rwo -> –report-warnings-only: sólo mostrará los warning (útil cuando lo ejecutamos vía cron). Otra opción interesante es -q, –quiet que no produce ninguna salida. También tenemos –cronjob deshabilita las opciones interactivas. Por último comentar que la opción –appendlog permite que el log, en lugar de ser sustituido en cada ejecución, vaya creciendo. Conviene personalizar estas variables del fichero de configuración /etc/rkhunter.conf, sobre todo el email: nano /etc/rkhunter.conf Programar un escaneado Pero lo ideal es programar una tarea cron y despreocuparnos. crontab -e Añadimos una linea al final como esta para ejecutarlo a las 4 a.m.: Si nos asusta cada vez que recibimos un email diciendo «» con el asunto «Warnings found for server» podemos hacer en la tarea cron que nos envíe un email con la salida mínima que produce el comando, para saber si preocuparnos: He quitado –quiet. Y esto es todo, hasta la próxima. Espero que os haya resultado interesante.

» Leer más

Error fail2ban in FilterPyinotify callback: ‘module’ object has no attribute ‘_strptime_time’

Esta mañana al resetear el servicio fail2ban me he encontrado con esto: service fail2ban status ● fail2ban.service – LSB: Start/stop fail2ban Loaded: loaded (/etc/init.d/fail2ban) Active: active (running) since jue 2017-01-12 10:03:11 CET; 30s ago Process: 2674 ExecStop=/etc/init.d/fail2ban stop (code=exited, status=0/SUCCESS) Process: 2810 ExecStart=/etc/init.d/fail2ban start (code=exited, status=0/SUCCESS) CGroup: /system.slice/fail2ban.service └─2820 /usr/bin/python /usr/bin/fail2ban-server -b -s /var/run/fail2ban/fail2ban.sock -p /var/run/fail2ban/fail2ban.pid ene 12 10:03:11 server fail2ban.actions[2820]: INFO Set banTime = 86400 ene 12 10:03:11 server fail2ban.jail[2820]: INFO Jail ‘sshd’ started ene 12 10:03:11 server fail2ban.jail[2820]: INFO Jail ‘sshd-ddos’ started ene 12 10:03:11 server fail2ban.jail[2820]: INFO Jail ‘roundcube-iredmail’ started ene 12 10:03:11 server fail2ban.jail[2820]: INFO Jail ‘dovecot-iredmail’ started ene 12 10:03:11 server fail2ban.jail[2820]: INFO Jail ‘postfix-iredmail’ started ene 12 10:03:11 server fail2ban[2810]: Starting authentication failure monitor: fail2ban. ene 12 10:03:11 server systemd[1]: Started LSB: Start/stop fail2ban. ene 12 10:03:11 server fail2ban.filter[2820]: ERROR Error in FilterPyinotify callback: ‘module’ object has no attribute ‘_strptime_time’ ene 12 10:03:11 server fail2ban.filter[2820]: ERROR Error in FilterPyinotify callback: ‘module’ object has no attribute ‘_strptime_time’ El Workaround que he aplicado es establecer en polling el backend para averiguar las modificaciones en ficheros de forma que no utilice librerías externas. (editar jail.conf) # «backend» specifies the backend used to get files modification. # Available options are «pyinotify», «gamin», «polling» and «auto». # This option can be overridden in each jail as well. # # pyinotify: requires pyinotify (a file alteration monitor) to be installed. #            If pyinotify is not installed, Fail2ban will use auto. # gamin:     requires Gamin (a file alteration monitor) to be installed. […]

» Leer más
1 10 11 12 13 14 51