[CentOS-es] Se colaron a mi sistema, ¿cómo saber lo que han hecho?

Miguel González miguel_3_gonzalez en yahoo.es
Dom Dic 29 16:29:01 UTC 2013


On 12/29/2013 5:22 PM, "Ernesto Pérez Estévez, Ing." wrote:
> On 12/29/2013 11:09 AM, Gabriel Pinares wrote:
>> Hola.
>>
>> Desde x IP se han logrado colar utilizando SHELL.
> primero que todo, relax... apagando o reinstalando no resolverás nada..
> así que es PERFECTO que estés tratando de averiguar cómo, para que
> puedas solucionar el hueco... excelente.
>
>
>> - - - - - - - -
>> Dec 29 08:49:35 http sshd[3156]: Accepted password for userz from IPx
>> port 44021 ssh2
>> Dec 29 08:49:35 http sshd[3156]: pam_unix(sshd:session): session
>> opened for user userz by (uid=0)
>> Dec 29 08:49:46 http sshd[3164]: Received disconnect from IPx: 11:
>> PECL/ssh2 (http://pecl.php.net/packages/ssh2)
>> Dec 29 08:49:46 http sshd[3156]: pam_unix(sshd:session): session
>> closed for user userz
>>   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> bien, entraron por ssh, por qué veo PECL? no sé, pero entraron por ssh
> aparentemente. Este usuario userz lo creaste tu? si no lo creaste tu,
> sigue la traza de quién le creó. Este usuario si lo creaste tú.. tenía
> una clave decente y fuerte? Por qué este usuario no tenía /sbin/nologin?
> Primer tip: asegurar los login via SSH.... quizá restringiéndoles.

Parece que han usado la extension SSH2 de PECL:

http://kvz.io/blog/2007/07/24/make-ssh-connections-with-php/

Yo intentaría ver si tienes esa extension en tu sistema con una consulta 
al yum. Si la tienes instalada, yo la desinstalaria o la bloquearia a 
ciertas ips.
>
>> ¿puedo hallar más info de las acciones que ha realizado [IPx] ?
>> ¿cómo? / ¿dónde?
> egrep -Ri IPx /var/log/*
>
> En caso de duda, léete TODOS los logs, buscando información sobre esta
> IP y/o sobre el usuario userz (que me parece creado previamente por el
> atacante, así que el problema posiblemente vaya por otro lado)
Otra cosa que puedes hacer es hacer su - userz y lanzar el comando 
history por si el hacker ha sido tan descuidado que no ha borrado el 
historico de comandos.

Otra cosa, es bastante recomendable utilizar herramientas como fail2ban 
que permiten banear IPs que intentan hacer ataques DDOS, tambien banean 
IPs que rastrean tu servicio SSH.

Si necesitas ayuda profesional, yo soy freelance de sistemas.

Saludos

Miguel



---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com


This message and any attachments are intended for the use of the addressee or addressees only. The unauthorised disclosure, use, dissemination or copying (either in whole or in part) of its content is not permitted. If you received this message in error, please notify the sender and delete it from your system. Emails can be altered and their integrity cannot be guaranteed by the sender.

Please consider the environment before printing this email.



Más información sobre la lista de distribución CentOS-es