Click here to Skip to main content
15,860,943 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi experts,

I have a problem in my application, in which I want to enable Captcha Options If the Server gets simultaneous requests from the same IP address. That is, If my website receives 10 or more requests from the same IP address within the short time period (say 10 seconds), then the captcha should be enabled for that IP address...

Can Anybody know how to do this...

Please guide me with your knowledge..

Thanks in advance...
Posted
Comments
Kornfeld Eliyahu Peter 10-Jun-14 5:51am    
First you have to record those requests (I believe we talking about login requests) somewhere so you can decide if it's time to sow the CAPTCHA.
Whenever you stored attempt show that it's time for CAPTCHA add it dynamically to your page...

1 solution

There is no foolproof way to get the actual IP address of the client. If the client is sitting behind a firewall or a proxy or a NAT, the IP you get will be incorrect. You can try using the ASP.NET Session Id to check if the request came a previous client.

What you do is store the list of requests from the same Session Id in a list and with every new request, check this list to find out how many requests you've received in the past X seconds and take steps accordingly.
 
Share this answer
 
Comments
Manikandan K 10-Jun-14 6:15am    
can you please send me a bit of code to start with...
[no name] 11-Jun-14 8:04am    
No, I don't write code for free.
Manikandan K 11-Jun-14 8:24am    
k fine...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900