Daniel at Pixelstorm talks about some bulletproof security hacks that could help you prevent most cyber attackers from taking over your site:
Always use HTTPS
This is the first step to establishing good website security, and one you should not overlook just because of how simple it is. Using HTTPS encrypts information that your site receives from your users and vice versa. When you don't use HTTPS, anyone with enough programming skills could easily read the messages sent between your site and your users, and depending on the site you're running, it could end up compromising your users' password information, or worse, their credit card number.
Do: If you don't have HTTPS yet on your site, contact your web hosting service and see whether they have a plan available that could upgrade your protocol into HTTPS.
Check up on your error messages
Error messages do not seem like an obvious pathway that can be exploited by cyberattackers, yet what error messages reveal can tell a lot about how your website works, including its weak points. Savvier cyberattackers could easily take over your website through various methods if you don't immediately fix this vulnerability. From username enumeration attacks to a leak to your software version – that is exactly the possible cyberattacks that your site could experience if you don't create a redirect page for when an error occurs to your site.
Do: Make a separate error page that would redirect users experiencing the error to this page. Be sure that all common errors are covered by this page redirect.
Shield your site from possible SQL injection
SQL injections are a type of cyberattack that occurs when a malicious code is entered into a site through the use of a web form. Now that we've gotten the definition out of the way, let's talk about what an SQL injection can do to a site.
If you've ever heard of a database containing usernames and passwords of a site getting leaked online, then you've just witnessed one of the most common fallouts from failing to prevent an SQL injection attack. Although there are several ways to stop an SQL injection attack from happening, one of the most popular is to implement parameters on queries for your website's database. When you do this, a cyberattacker cannot directly access information contained in a database by hijacking existing commands with their own code snippet via the input form since the queries are contained to execute certain commands based on previously defined parameters.
Another possible way to stop an SQL injection from happening is through input validation strategies such as imposing character count limitations on your web form and banning the usage of certain symbols. The key here is to reduce the loopholes in your code to decrease the risk of it being exploited by malicious actors.
Do: Restructure your website's code to close possible loopholes that cyberattackers can exploit.
Beware of cross-site scripting
Aside from SQL injection, another common cyberattack that your site can experience is cross-site scripting, popularly known as XSS. Cross-site scripting exploits vulnerabilities in websites that commonly use client-side code, which is a type of code that gets immediately loaded when a web page is visited by a user.
Unlike SQL injections, which tend to affect larger groups of people, XSS attacks can be more sophisticated, with the intent to target specific people or gain administrator access to a website. It works by inserting a malicious script in several ways – it can be attached to a website's legitimate URL or even entered through a comment box. So, how do you prevent a cyberattacker that uses this technique?
Just like SQL injection, the answer is to implement input validation strategies. Limit the number of characters that a user can input to your website and do not allow embedded HTML into any of your input boxes.
Do: Include input validation commands in your website's code structure.
Staying one step ahead of cyber attackers can be difficult. But by focusing on certain techniques that are widely known to even the least experienced of cyberattackers, you could provide a basic defensive measure that could keep your site safe.