1

I've been tasked with checking if the domain controller for a C# MVC web portal has been hard-coded, and if it has, update it. I have access to the source but I can't seem to locate where the domain controller is defined.

I'm wondering where the domain controller is usually set up in an MVC project (in a config file or within a controller class) or at least what the code would look like.

Any advice would be helpful.

NightOwl888
  • 55,572
  • 24
  • 139
  • 212
J Though
  • 11
  • 1
  • I wpuld start with the startup.cs, startup.auth.cs, or in an override of the `Authorize` attribute if in use. – S. Walker Feb 12 '18 at 00:47
  • 1
    Perhaps the domain controller is found automatically, with some additional code? If it is truly hardcode, you should search the whole project in Visual Studio using CTRL+SHIFT+F, type in a part of the expected hardcoded value, and Find. – Kind Contributor Feb 12 '18 at 01:20

1 Answers1

0

It depends. How would a domain controller be used? Is the site using Windows authentication? Is it accessing Active Directory for some other purpose?

Regardless, the easiest way would likely be to get a list of all your domain controllers (if you have one domain, there likely isn't that many) and do a solution-wide search for each.

Gabriel Luci
  • 38,328
  • 4
  • 55
  • 84