Search code examples
asp.netsecuritycaptchadenial-of-service

How to Show Captcha images for repeated requests


In my project, to avoid spammers and other Security issues, I have to show Captcha Image for repeated requests from same IP Address. That is, If I get multiple requests from same IP Address, then my Captcha should be shown to check the user..

So, my task, If I get 10 requests within 5 seconds from same IP, then Captcha should be enabled to that IP address...

Any Suggestion Will be highly appreciated..


Solution

  • Split the task into steps, and then try to think around each step.

    If I get 10 requests within 5 seconds from same IP,

    1) So you need to identify that you're under attack. E.g. see Block DoS attacks easily in ASP.NET

    then Captcha should be enabled to that IP address...

    2) So you need to show a captcha. E.g. Using a CAPTCHA to Prevent Bots from Using Your ASP.NET Web Razor) Site

    3) Then probably you would need to save "validated" IP into a "white" list.