lot of bots are scanning for server breach, and lot of website are exposed to thoose kind of attacks, most of the time the solutions are simple :
- using complex password (the best is to use spécial chars like ¥,§,À,±,..)
- having a system up to date (and CMS too)
- trying to avoid third component
- using a firewall to open only used incoming port
- closing database access to internet
- using ip restriction for sensibles administration tool
- using a log tool
Thoose are commons bots attacks:
brute force
this is method try to find login access by sending login request then testing the result, as long as result is not logged in, it retry another combinaison of login/password until access is granted
mainly aimed on internet:
- FTP (usualy port 21)
- SSH (usualy port 22)
- TS (usualy port 3389)
- Web site login pages (usualy port 80 & 443)
to prevent this kind of attacks:
- (if possible) changing default port
- having a complex password
- trying to avoid use of basic login name (admin/root/administrator,...)
- having a "fail attempt" temporizer, like that it will take too much time to find the good login/password combinaison.
you need to know the first phase of this kind of attacks on website, is to find which web tools you use (CMS name,phpmyadmin,...), once found brute force can start. For application it is easier a simple port scan find wich system tool are used.
Today most of system tool are enougth secure against this kind of attacks, that s why nowaday they focus on website.
known security breach
lot of people are using open sources CMS, as it is open source code can be exploited. All the time breach are found and securised by the dev, but not all server admin do updates.
So once a breach is fixed, breach become known to the public (as Heartbleed, Poodler, ...).
Each time Bots are updated with thoose new informations, looking for site exposed to vulnerability.
to prevent this kind of attacks:
- having a (well) self made site
- getting your system (and web tools) up to date
- not using default folder names
- reading doc on how to secure your CMS, your exposed content, and your code
- blocking strange requests to prevent attacks before attemps with your server configuration.
this is an exemple of blocking rules for apache server:
<Directory />
#Block user agent empty or with suspicious values
RewriteCond %{HTTP_USER_AGENT} ^-?$|\\x.*?\\x|perl|python [NC,OR]
#Block default folders (optional, but prevent 404 logs)
RewriteCond %{REQUEST_URI} MyAdmin|\/pma\/|\/phpmyadmin| [NC,OR]
#Limit request to thoose requiered
RewriteCond %{REQUEST_METHOD} !^(GET|HEAD|POST)$ [OR]
#blocking request who not start by /
RewriteCond %{REQUEST_URI} !^/
#all thoose redirect to the error code you want, i like to use 406 in my case
RewriteRule .* - [END,R=406]
</Directory>
like that most of bots are blocked before being able to test your website breach.
By the way if you keep an eye on logs and security annoncement, you can update rules to increase your bots protections.
Bonus For coders
do not fear bots or hackers, most of the time there s only 4 main things to secure:
- login pages
- code injection
- upload pages
- cross server
don't forget backups, it can be helpfull !