/// <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); }
/// <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."); } }
/// <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; }
/// <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; }
/// <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)); }
/// <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)); }