简体   繁体   中英

In asp.net MVC, How to prevent webrequest to a particular controller?

I have an e-commerce website on top of NopCommerce platform where there was an SMS resend OTP service written in MVC Controller (www.mysite.com/customer/resendotp).

A week ago someone started attacking this URL via different IP addresses to send OTP messages. So we renamed our MVC controller to newresendotp (www.mysite.com/customer/newresendotp).

Now unfortunately the attack is still going on to our old mvc controller. I want to prevent all requests to this MVC controller. How do I do that?

How about blocking the request in IIS by adding the url to the old controller (www.mysite.com/customer/resendotp) as a Request Blocking rule?

https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/request-blocking-rule-template

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM