コード例 #1
0
        /// <summary>
        /// Returns a bool indicating whether this instance equals an given object
        /// </summary>
        /// <param name="obj">The object to compare this instance to</param>
        /// <returns>A bool indicating whether this instance equals an given object</returns>
        public override bool Equals(object obj)
        {
            if (obj is DNSSpooferEntry)
            {
                DNSSpooferEntry dsEntry = obj as DNSSpooferEntry;

                return(dsEntry.strName == this.strName && dsEntry.ipaToRedirect == this.ipaToRedirect);
            }

            return(false);
        }
コード例 #2
0
 /// <summary>
 /// Adds a DNS spoofer entry to this DNS spoofer
 /// </summary>
 /// <param name="dnsEntry">The DNS spoofer entry to add</param>
 public void AddDNSSpooferEntry(DNSSpooferEntry dnsEntry)
 {
     if (dnsEntry.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork ||
         dnsEntry.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6)
     {
         lDNSSpooferEntries.Add(dnsEntry);
         this.InvokeExternalAsync(DNSSpooferEntryAdded, new DNSSpooferEventArgs(dnsEntry));
     }
     else
     {
         throw new ArgumentException("Only IPv4 or IPv6 Addresses are currently supported.");
     }
 }
コード例 #3
0
 /// <summary>
 /// Creates a new instance of this class
 /// </summary>
 /// <param name="dsSpooferEntry">The DNS spoofer entry associated with the event</param>
 /// <param name="ipaVictim">The IP address of the victim of this spoof</param>
 /// <param name="strMatchingName">The DNS name which matched</param>
 public DNSSpoofedEventArgs(DNSSpooferEntry dsSpooferEntry, IPAddress ipaVictim, string strMatchingName) : base(dsSpooferEntry)
 {
     this.ipaVictim       = ipaVictim;
     this.strMatchingName = strMatchingName;
 }
コード例 #4
0
 /// <summary>
 /// Creates a new instance of this class
 /// </summary>
 /// <param name="dsSpooferEntry">The DNS spoofer entry associated with the event</param>
 public DNSSpooferEventArgs(DNSSpooferEntry dsSpooferEntry)
 {
     this.dsSpooferEntry = dsSpooferEntry;
 }
コード例 #5
0
 /// <summary>
 /// Removes a DNS spoofer entry from this DNS spoofer
 /// </summary>
 /// <param name="dnsSpooferEntry">The DNS spoofer entry to remove</param>
 public void RemoveDNSSpooferEntry(DNSSpooferEntry dnsSpooferEntry)
 {
     lDNSSpooferEntries.Remove(dnsSpooferEntry);
     this.InvokeExternalAsync(DNSSpooferEntryRemoved, new DNSSpooferEventArgs(dnsSpooferEntry));
 }
コード例 #6
0
 /// <summary>
 /// Returns a bool indicating whether this instance contains a specific DNS spoofer entry
 /// </summary>
 /// <param name="dnsSpooferEntry">The DNS spoofer entry to search for</param>
 /// <returns>A bool indicating whether this instance contains a specific DNS spoofer entry</returns>
 public bool ContainsDNSSpooferEntry(DNSSpooferEntry dnsSpooferEntry)
 {
     return(lDNSSpooferEntries.Contains(dnsSpooferEntry));
 }