From 7d1fee76ca37cbc6a9bcd10e7bfecdc7eefcf005 Mon Sep 17 00:00:00 2001 From: c3rebro Date: Wed, 2 Jan 2019 22:51:31 +0100 Subject: [PATCH] + fixed server path filter --- Program.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Program.cs b/Program.cs index 901c276..e5e026d 100644 --- a/Program.cs +++ b/Program.cs @@ -155,8 +155,19 @@ public static int Main(string[] args){ else { try { //extract server and dn from ldap path attribute - string dn = _arguments[0].Replace("LDAP://",string.Empty).Remove(0,_arguments[0].Replace("LDAP://",string.Empty).IndexOf('/') +1); - string server = _arguments[0].Replace("LDAP://",string.Empty).Remove(_arguments[0].Replace("LDAP://",string.Empty).IndexOf('/'), dn.Length + 1); + string dn = _arguments[0].ToUpper().Replace("LDAP://",string.Empty) + .Replace("LDAPS://",string.Empty) + .Remove(0,_arguments[0].ToUpper() + .Replace("LDAP://",string.Empty).Replace("LDAPS://",string.Empty) + .IndexOf('/') +1) + .ToLower(); + + string server = _arguments[0].ToUpper().Replace("LDAP://",string.Empty) + .Replace("LDAPS://",string.Empty) + .Remove(_arguments[0].ToUpper() + .Replace("LDAP://",string.Empty).Replace("LDAPS://",string.Empty) + .IndexOf('/'), dn.Length + 1) + .ToLower(); LdapDirectoryIdentifier ldapDir = new LdapDirectoryIdentifier(server);