Most internet web sites are built using open source CMS like WordPress, Joomla, Drupal and Magento and because their popularity they are most exposed to hackers attacks.
You can keep your web site safe in these ways and limit/prevent these attacks.
– keep the CMS (and the theme and the plugins/extensions/modules) always updated
– don’t download/use themes and plugins/extensions/modules from unknown/untrusty sources
– don’t use nulled scripts (they are “cracked” commercial scripts)
– use security plugins/extensions/modules like Better WP Security, Bulletproof Security, WP Security Scan and Limit Login Attempts for WordPress, Admin Tools and RSFirewall! for Joomla, Drupal and Magento are enough robust by themselves but you can use these Drupal modules for an extra protection and Enhanced Admin Security or Two Factor Authenticator for the e-commerce software.
– use strong passwords (for admin panel, for database and for the FTP access)
– make regular backups of all files and database, so you can easily restore if your web site will be compromised