Diferencia entre revisiones de «Recuperación de un sitio hackeado»

De MoodleDocs
(added page)
 
m (tidy up)
Línea 6: Línea 6:
==Pasos iniciales==
==Pasos iniciales==


* Contact your hosting provider, if you have one.
* Contacte a su provedor de alojamiento (''hosting''), si es que tiene alguno.
* Immediately put the site into ''Maintenance mode'' or better completely off-line until you know you've fixed everything. You need to cut-off the connection the attacker has to your server.
* Immediatamente ponga el sitio en ''Modo de Mantenimiento'' o, mejor aún, desconéctelo de internet completamente hasta que esté seguro de haerlo arreglado completamente. Usted necesita desconectar la conexión en la que su atacante tiene a su servidor.
** You can make a firewall rule to block connections to the server from all ip addresses and then allow only your ip address. Be careful when doing this since your ip address might change from time to time and you can lock yourself out. If that's the case, allow the range that your IP address is in instead.
** Usted puede configurar un cortafuegos (''firewall'') para bloquear conexiones al servidor desde todas las IPs y solamente permitir su dirección IP. Tenga cuidado al hacer esto, porque si su IP cambiara, Usted quedaría desconectado del servidor permanentemente. Para estos casos, es mejor permitir el rango de IPsen donde está su propia IP..
** If your site is self-hosted or you have physical access to the server, an easier way is to get a small router and plug the server into that. Do not connect it to the rest of the network or the internet. You are now free to access it directly or via another computer on the same router.
** Si Usted mismo tiene su servidor y tiene acceso físico al servidor, una forma más simple es conseguir un ruteador (''router'') pequeño y enchufar allí al server. NO lo conecte al resto de la red ni al Internet. Ahora Usted tendrá libertad de accesar al servidor directamen o por medio de otra computadora enchufada al mismo ruteador.
* Find all available older databases and file backups
* Busque todos los respaldos antiguos (copias de seguridad) de archivos y bases de datos disponibles.
* Backup php files, database and data files (Do not overwrite older backups.)
* Respalde los archivos PHP, bases de datos y archivos de datos (Sin sobre-escribir los respaldos ntiguos).
* Make a list of all PHP software and programs/packages installed on the same server.
* Haga una lista de todo el software de PHP y programas/paquetes instalados en el mismo servidor.
* Note main Moodle version and the date of last update and make a list of all contrib modules and custom modifications
* Tome nota de cúal es su versión principal de Moodle y la feca de la última actualización y haga una lista de todos los módulos extra y modificaciones personalizadas que tuviera
* Check the legal ramifications of possibly exposing users' private data. You are probably required by law to notify your users and at least tell them to change passwords on any accounts with any service that shared the same password with their Moodle account.
* Revise las ramificaciones legales de una posible exposición de los datos personales de sus usuarios Es posible que por ley (según su país) tenga que notificar a los usuarios ypor lo menos decirles que deberán cambiar sus contraseñas en cualquier cuenta con cualquier otro servicio en la que usaran la misma contraseña que tenían en este sitio Moodle.
* Finally, if you are unfamiliar with the command line or with computers/servers in general, it's best to get someone who is familiar to help you. You are responsible for your users' information that you store, so you want to make sure the recovery is done right.
* Finalmente, s no está familiarizado con la línea de comando, o con servidores en general, lo mejor s que se consiga a alguien que si lo esté para que le ayude. Usted es responsable de la información de sus usuarios que Usted almacena, por lo que debe de asegurars de que la recuperación se realice adecuadamente..





Revisión del 15:40 26 feb 2013

Moodle 2.x


Vea https://docs.moodle.org/24/en/Hacked_site_recovery

Pasos iniciales

  • Contacte a su provedor de alojamiento (hosting), si es que tiene alguno.
  • Immediatamente ponga el sitio en Modo de Mantenimiento o, mejor aún, desconéctelo de internet completamente hasta que esté seguro de haerlo arreglado completamente. Usted necesita desconectar la conexión en la que su atacante tiene a su servidor.
    • Usted puede configurar un cortafuegos (firewall) para bloquear conexiones al servidor desde todas las IPs y solamente permitir su dirección IP. Tenga cuidado al hacer esto, porque si su IP cambiara, Usted quedaría desconectado del servidor permanentemente. Para estos casos, es mejor permitir el rango de IPsen donde está su propia IP..
    • Si Usted mismo tiene su servidor y tiene acceso físico al servidor, una forma más simple es conseguir un ruteador (router) pequeño y enchufar allí al server. NO lo conecte al resto de la red ni al Internet. Ahora Usted tendrá libertad de accesar al servidor directamen o por medio de otra computadora enchufada al mismo ruteador.
  • Busque todos los respaldos antiguos (copias de seguridad) de archivos y bases de datos disponibles.
  • Respalde los archivos PHP, bases de datos y archivos de datos (Sin sobre-escribir los respaldos ntiguos).
  • Haga una lista de todo el software de PHP y programas/paquetes instalados en el mismo servidor.
  • Tome nota de cúal es su versión principal de Moodle y la feca de la última actualización y haga una lista de todos los módulos extra y modificaciones personalizadas que tuviera
  • Revise las ramificaciones legales de una posible exposición de los datos personales de sus usuarios Es posible que por ley (según su país) tenga que notificar a los usuarios ypor lo menos decirles que deberán cambiar sus contraseñas en cualquier cuenta con cualquier otro servicio en la que usaran la misma contraseña que tenían en este sitio Moodle.
  • Finalmente, s no está familiarizado con la línea de comando, o con servidores en general, lo mejor s que se consiga a alguien que si lo esté para que le ayude. Usted es responsable de la información de sus usuarios que Usted almacena, por lo que debe de asegurars de que la recuperación se realice adecuadamente..


Remember, everything on the system should be considered untrusted until you know to what extent the hacker was able to intrude (Does he have root server permissions or just access to modify certain files?) Do some forensic research into how the person (or program) got in and what they did before just restoring a backup or running anti-virus software. For all you know, the backup could have been modified to contain a backdoor program that allows the attacker back in later. You want to close the vulnerability the attacker used so it doesn't happen again.

Evaluación del daño

  • Find out when exactly was the site hacked.
    • Check the modification dates on files. You're looking for any application files that were modified around the time of the initial intrusion. These files are suspect.
    • Check your server logs for any suspicious activity around that date or few hours before, such as strange page parameters, failed login attempts, command history (especially as root), unknown user accounts, etc.
    • Be sure to take into account updates you've downloaded, as that will change the times for modified system files and/or Moodle.
  • Look for any modified or uploaded files on your web server - look for oldest file that does not belong in Moodle.

Recuperación

  • Restore last backup right before the incident.
  • Download the latest stable version and upgrade your site.
  • Change your passwords.
  • Depending on the extent of the attack, a complete format and reinstall of the operating system might be in order.
  • Be sure to implement any fixes you found during your investigation and double-check existing security on the server to see if it can't be improved.
    • This also means you should review any customizations/add-ons you made for Moodle. Are you sure you properly escaped all user inputs? What about the permissions on your web server directories and database?

Control del SPAM

  • Spam in profiles or forum posts does not mean your site was actually hacked.
  • Use the Spam cleaner tool (Settings > Site administration > Reports > Spam cleaner) regularly to find spam.

Prevención

  • Always keep your site up-to-date and use the latest stable version. Git is an easy way to do this.
  • Regularly run the Security overview report (Settings > Site administration > Reports > Security overview).
  • Understand how to properly set permissions and file ownership to maximise security. If this is a mystery, you mustn't ignore it - read about it or ask in the forums!
  • Make sure you have a properly configured firewall/packet filter on your server.
  • When making customizations to Moodle or other web applications on your server, be sure to review your code and make sure it doesn't add any new vulnerabilities.
  • You might also consider running a anti-rootkit program such as rkhunter that will help you see if rootkits or other strange happenings are occurring on your server. RootkitRevealer is a comparable Windows program.
  • SELinux or AppArmor are very good at mitigating several forms of attacks on the server itself. Windows has something similar called EMET.

Vea también

Enlaces externos

  • [1]: rkhunter official site
  • [2]: Windows Sysinternals site, where you will find RootkitRevealer among other useful programs.
  • [3]: SELinux wikipedia article. Check the References and See Also section.
  • [4]: A great article on Microsoft Technet detailing some very important security concepts. A good read no matter what OS you use.
  • [5]: Part 2 of the Microsoft Technet article above.
  • [6]: A thread from ServerFault which has yet more good information on recovery from an intrusion. Robert Moir's comment provide lots of good information.
  • [7]: An article on cert.org which details the steps one should take after a server compromise. It was written in 2000, so program specific information may be out-dated.

Discusiones en el foro "Using Moodle":