Page 1 of 1

Flood protection?

Posted: 23 Jan 2017, 17:34
by lszlsz
Hi

I regularly get massive request for some random file from a single IP, for example 17845 times for one file in one day. This causes my server to activate a bandwidth limiter and my download counter is messed up.
Is there any kind of flood control possible to prevent this?

Thanks!
Lorenz

Re: Flood protection?

Posted: 26 Jan 2017, 18:51
by Jan
Hi, just use some protection tool for your server and e.g. ban this IP to access your server completely :idea:

Jan

Re: Flood protection?

Posted: 08 Feb 2017, 10:36
by ep98
Try with .htaccess in your root of the site, eg: /public_html - this is a hotlink protection, aka Your server as cloud and files to be linked directly to another page or with any other words, someone is using your hard work for free :) Example, Jan is hot-linking files from GIT (but that's what for is made GitHub)

Those code will not prevent anyone from downloading those files, they just have to be downloaded only trough your site, any external linking will lead to 403 or nasty picture.

Code: Select all

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)example.com/.*$ [NC]
RewriteRule \.(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|xml|php|png|css|pdf)$ - [F]
3rd line - change example.com to your domain
4th line - describe which files should not be touched from outside the domain
in addition to this code block you can add and another line

Code: Select all

RewriteRule \.(gif|jpg)$ http://www.example.com/take-this-big-dick.gif [R,L]
where gif|jpg are the requested files, and example.com leads to the site with some nasty picture :)

Code: Select all

Options -Indexes 
Options +FollowSymLinks
This should be added to prevent user to type domain.com/some-directory without empty index.html to see what's inside. 2nd line tells the application, to load symlinks - eg. on some hosting providers have symlink www pointing -> public_html

Code: Select all

<Limit GET POST>
order allow,deny
deny from xxx.xxx.xx.x
allow from all
</Limit>
the above lines are to ban specific IP address

@Ian - why the hell this stupid phpBB3 does not recognize BBCodes for displaying code and/or image ?
https://postimg.org/image/tja09nhxb/
That's usually how it looks with working code tag

Re: Flood protection?

Posted: 08 Feb 2017, 16:23
by Jan
Hi, thank you for the quide.

When you answer the post here, check if Disable BBCode is not enabled

Image


Jan

Re: Flood protection?

Posted: 12 Feb 2017, 17:29
by ep98
Thanks, you should remove that option by default :)

Re: Flood protection?

Posted: 16 Feb 2017, 18:56
by Jan
Ok