The term "hacker" is used quite broadly. Really for me, a real "hacker" is basically a web burgular - someone who tries to get in to your website when they're not allowed: breaking and entering. However some "hacks" are a lot more light touch than that, and are really only spammers although sometimes clients with websites refer to them as hackers.
When a client experienced a lot of spam recently, they asked me why someone would try to hack their website. So I said I'd write them a blog post about it!
When spamming becomes hacking.
If you've got a website with a form on it, chances are you've had some spam. People leaving comments that talk nonesense, or are really generic because they're not real ("Loved your blog post - thanks for sharing!" Sorry - it was probably a spam bot, not a real fan.). Years ago spammers always left comments in the hopes of getting a link back from your website to theirs, as that could have helped them with their SEO (getting found in Google), but most blogging platforms don't allow proper links now a days so as to deter that sort of thing, and Google are wise to it too.
When spamming becomes hacking though is when someone's filling in a form to see what it'll get them... will it create them an account on your site so they can get inside and cause mischief? Find payment details? Get into some mailing lists or private records?
Most of the time, they create an account on your website and it gets them no where, but if they try enough sites, they might just stumble upon something.
If you found this article helpful, get more of this by joining our mailing list.
Another thing that's important to understand about hacking, and spamming for that matter, is that it's often automated. Little code-robots built to spider the web and look for forms or ways in, or looking for vunerabilities in known software. That's why it's so important to keep your web technology - both the site itself and your hosting - up to date so that any known holes are plugged.
But what's the motivation?
Back to why hackers hack, I'd say the main reasons were for monetary gain, to cause trouble, arguably to help, and sometimes just because they can.
How can it ever help? Well that's what you call "ethical hacking" - people who look for issues with websites, and report those issues to the people running the website in the hopes for a reward. They don't do any harm - they just look for vunerabilities, or ways in, and then flag them up to the company who own the site and say "hey, because I've helped you out for pointing this out before someone used it for no good, can you pay me a little bit of money?". If you don't, well then truly ethical hackers just go on their way.
As for the guys who do it just because they can - well they just cause a lot of hassle for a lot of people. If there's been an attack on a large organisation's website (I'll talk about types of attack another day), even if the hackers didn't get in, it can still lead to many hours of developer/engineer time during and after the attack just double checking everything - and then hours of meetings and reporting writing afterwards. And of course, if they do actually get in or do any damage, the hassle that causes is immense, especially now (in the UK) any security breach of people's data needs to be reported to the ICO. So why do they do it? If they don't need the details or the mailing list and won't do anything with the credit card details? Just because they can.
Hackers are often clever guys. Maybe they feel under appreciated, maybe they're bored, maybe they were bullied at school and are bitter with the world - who knows really, but managing to "get one over" on a big organisation can be an ego boost.
Show me the money
Of course, there are people who do it for money. And that probably makes the most sense to people reading this. They want to get credit card details and carry out some quick fraudulent transactions, or they want to get their hands on data they can sell so they then get money that way.
A new(ish) reason for hacking can be to mine cryptocurrency - that is a huge topic in itself for another day, but when people need computing power and they don't want to pay for it, they can piggy back other people's hosting.
This "piggybacking" can also be used for phishing type hack campaigns - when someone just uses some of your hosting, without you knowing, to host their dodgy forms that are designed to look like a bank or something. They then send out spam emails, and try to get people to click on fraudulent links to come to what looks like a legitimate website so as to enter personal data... and all of this is going on on your hosting account without you knowing. But it means the hacker isn't paying for the hosting and is harder to trace. So that saves them money, and potentially makes them money depending on the phishing campaign.
And then there are people who are paid to hack. And that leads to the next reason...
I'd say the majority of hacks I've seen are random - just because you use a certain WordPress plugin or something that's known to have an issue. However, sometimes they are targetted. And then that can be because of personal or business vendettas, or of course for political motivations. We hear on the news about Government funded hacks happening to try and find out Government secrets - well that's because someone somewhere really wants the information it thinks someone else has got. Sometimes though, a hack can just be to take a website offline if one party doesn't agree with another party's politics and doesn't want them broadcasting their news.
What can you do about it?
The main things you can do to prevent being a victim of a phishing campaign, or to prevent your website from being hacked, is to be really careful about links you click on and to make sure your website and hosting is always as up to date as possible.