user735647
user735647

Reputation: 395

How to block multiple requests coming from same IP

My aim is to block/control multiple requests coming from same IP address using a firewall or router.Can i achieve this programatically? or using some other configuration? Can someone guide me and provide some links that might help my cause.

Thanks

Upvotes: 4

Views: 9389

Answers (2)

Aristos
Aristos

Reputation: 66641

Programmatically you can do that by capturing all page call on global.asax and log on an array the ip calls. If you get from one ip too many calls at short time like a DOS attack you can cut it.

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

Prevent Denial of Service (DOS) attacks

and

Block Dos attacks in asp.net

the last one have an error on the line that stop the comming from indexes, just remove this line.

This examples are a start, you can customize them to your application.

Upvotes: 1

Chris
Chris

Reputation: 28064

Assuming your application has network access to the server that runs your firewall, and assuming you can run an SSH command to that host, you might be able to run an SSH command to echo a command to the firewall's config file to block an IP. Seems like a very bad idea though. Assuming a linux firewall with iptables, here's some relevant information:

Upvotes: 1

Related Questions