Flood protection?

Phoca Download - download manager
lszlsz
Phoca Newbie
Phoca Newbie
Posts: 7
Joined: 03 Sep 2013, 15:41

Flood protection?

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48550
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Flood protection?

Post by Jan »

Hi, just use some protection tool for your server and e.g. ban this IP to access your server completely :idea:

Jan
If you find Phoca extensions useful, please support the project
User avatar
ep98
Phoca Professional
Phoca Professional
Posts: 163
Joined: 12 May 2008, 12:00
Contact:

Re: Flood protection?

Post 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
May The Source Be With You !
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48550
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Flood protection?

Post by Jan »

Hi, thank you for the quide.

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

Image


Jan
If you find Phoca extensions useful, please support the project
User avatar
ep98
Phoca Professional
Phoca Professional
Posts: 163
Joined: 12 May 2008, 12:00
Contact:

Re: Flood protection?

Post by ep98 »

Thanks, you should remove that option by default :)
May The Source Be With You !
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48550
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Flood protection?

Post by Jan »

Ok
If you find Phoca extensions useful, please support the project
Post Reply