Esempio n. 1
0
        void AddDataToInvestigate(string mapping, MappingType type)
        {
            // avoid dealing with files
            if (String.IsNullOrEmpty(mapping) || mapping.StartsWith("\\\\"))
            {
                Trace.WriteLine("Ignoring addition of mapping " + mapping + "type = " + type);
                return;
            }
            switch (type)
            {
            case MappingType.Name:
                if (!KnownCN.Contains(mapping))
                {
                    if (!CNToInvestigate.Contains(mapping))
                    {
                        CNToInvestigate.Add(mapping);
                    }
                }
                break;

            case MappingType.Sid:
                if (mapping.StartsWith("S-1-5-32-") || mapping.StartsWith(databaseInformation["DomainSid"]))
                {
                    if (!KnownSID.Contains(mapping))
                    {
                        if (!SIDToInvestigate.Contains(mapping))
                        {
                            SIDToInvestigate.Add(mapping);
                        }
                    }
                }
                break;
            }
        }
Esempio n. 2
0
        void AddDataToInvestigate(string mapping, MappingType type)
        {
            // avoid dealing with files
            if (string.IsNullOrEmpty(mapping))
            {
                Trace.WriteLine("Ignoring addition of mapping " + mapping + "type = " + type);
                return;
            }
            else
            {
                switch (type)
                {
                case MappingType.DistinguishedName:
                    if (!nodesByDN.ContainsKey(mapping.ToLowerInvariant()))
                    {
                        if (!CNToInvestigate.Contains(mapping.ToLowerInvariant()))
                        {
                            CNToInvestigate.Add(mapping.ToLowerInvariant());
                        }
                    }
                    break;

                case MappingType.Sid:
                    if (mapping.StartsWith("S-1-5-32-", StringComparison.InvariantCultureIgnoreCase) || mapping.StartsWith(databaseInformation["DomainSid"]))
                    {
                        if (!nodesBySID.ContainsKey(mapping.ToLowerInvariant()))
                        {
                            if (!SIDToInvestigate.Contains(mapping.ToUpperInvariant()))
                            {
                                SIDToInvestigate.Add(mapping.ToUpperInvariant());
                            }
                        }
                    }
                    break;

                case MappingType.FileName:
                    if (mapping.StartsWith("\\\\"))
                    {
                        if (!nodesByFilename.ContainsKey(mapping.ToLowerInvariant()))
                        {
                            if (!FilesToInvestigate.Contains(mapping.ToLowerInvariant()))
                            {
                                FilesToInvestigate.Add(mapping.ToLowerInvariant());
                            }
                        }
                    }
                    break;

                case MappingType.GPODirectory:
                    if (mapping.StartsWith("\\\\"))
                    {
                        if (!nodesGPOByFilename.ContainsKey(mapping.ToLowerInvariant()))
                        {
                            if (!GPOToInvestigate.Contains(mapping.ToLowerInvariant()))
                            {
                                GPOToInvestigate.Add(mapping.ToLowerInvariant());
                            }
                        }
                    }
                    break;
                }
            }
        }