Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want my ASP.net written WEB application to deny entrance to those clients that connect over a Proxy. I want thus to stop automated BOTS.

<?xml version="1.0" encoding="utf-8"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<!-- Web.config file -->
<configuration>
  <system.web>
    <authentication mode="Forms">
      <!-- <forms loginUrl="default.aspx" name="id" protection="All" />-->
    </authentication>
    <httpRuntime targetFramework="4.5" />
    <compilation debug="true" />
  </system.web>
  <appSettings>
    <add key="ValidationSettings:UnobtrusiveValidationMode" value="None" />
    </appSettings>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

  <system.webServer>
    <rewrite>
     
    </rewrite>

  </system.webServer>

</configuration>


What I have tried:

I have googled but not found what the correct sample.
Posted
Updated 30-Jul-17 15:07pm
Comments
Dave Kreskowiak 30-Jul-17 17:02pm    
Sooooo, how are you going to determine that a proxy is in use?

Hint: Good luck with that.
[no name] 30-Jul-17 17:34pm    
Do you mean that it is not possible to track a proxy connection?
Dave Kreskowiak 30-Jul-17 19:12pm    
Yeah, pretty much.

Most company traffic goes through a proxy server to get to the outside world. There's no real way for you to determine that a proxy server is in use.

[no name] 31-Jul-17 7:25am    
@Dave
I already had found a website that blocked me when i connected through any Proxy Websites or over VPS, and it clearly stated that Proxy is not allowed. That's why i asked. The site was running on Debian.
Patrice T 30-Jul-17 21:21pm    
Technically, every client is acting as some kind of proxy as it prevent reloading again and again the static parts (generally pictures) of your site.

1 solution

Hi ,

If you are using IIS 8 you can try below setting

IIS 8.0 	The enableProxyMode attribute was added to enable you to block requests from a client that connects through a proxy. The denyAction attribute was added to specify the default deny mode response that IIS sends back to clients.


IP Security <ipSecurity> | Microsoft Docs[^]
 
Share this answer
 
v2

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