How to block multiple requests coming from the same IP address

My goal is to block / manage multiple requests coming from the same IP using a firewall or router. Can I achieve this programmatically? or using some other configuration? Can anyone please help me and provide some links that might help my case.

thank

+3


source to share


2 answers


Assuming your application has network access to the server that is running your firewall, and assuming you can run an SSH command to that host, you can run the SSH command to echo the command to the firewall config file to block the IP. Sounds like a very bad idea. Assuming a linux firewall with iptables, here is some relevant information:



+1


source


Programmatically you can do this by grabbing all the calls in the global.asax page and registering the array that ip calls. If you receive too many calls from one ip in a short time, for example a DOS attack, you can cut it off.

There are two source code examples that I know and show here.

Preventing Denial of Service (DOS) Attacks

and



Block Dos attacks in asp.net

the latter has an error on the line that stops sending from the indices, just remove that line.

These examples are a start, you can customize them in your application.

+1


source







All Articles