示例#1
0
        public bool DetectSsl(Ip7Address address)
        {
            var abas        = address.Parts.Where(part => !part.IsHypernet).SelectMany(part => this.FindAbas(part.Characters));
            var babs        = address.Parts.Where(part => part.IsHypernet).SelectMany(part => this.FindAbas(part.Characters));
            var desiredBabs = abas.Select(aba => $"{aba[1]}{aba[0]}{aba[1]}");

            return(babs.Intersect(desiredBabs).Any());
        }
示例#2
0
        public bool DetectTls(Ip7Address address)
        {
            bool abbaInNormal = false, abbaInHypernet = false;

            foreach (var seq in address.Parts)
            {
                if (seq.IsHypernet)
                {
                    abbaInHypernet = abbaInHypernet || this.ContainsAbba(seq.Characters);
                }
                else
                {
                    abbaInNormal = abbaInNormal || this.ContainsAbba(seq.Characters);
                }
            }
            return(abbaInNormal && !abbaInHypernet);
        }
示例#3
0
 protected bool Equals(Ip7Address other)
 {
     return(this.Parts.SequenceEqual(other.Parts));
 }