protected override void ProcessRequest(byte[] data, UDPListener udpListener, IPEndPoint ipEndPoint, string replyIP, string replyIPv6) { string clientIP = ipEndPoint.Address.ToString(); LLMNRPacket packet = new LLMNRPacket(data); if (packet.Header.IsQuery()) { if (Check(packet.Question.Name, packet.Question.Type, clientIP, out string message)) { byte[] buffer = packet.GetBytes(this.TTL, replyIP, replyIPv6); SendTo(buffer, udpListener, ipEndPoint); } Output("LLMNR", clientIP, packet.Question.Name, packet.Question.Type, message); } }
internal static void ProcessLLMNRRequest(byte[] data, string clientIP, int clientPort, string sourceIP, int sourcePort) { LLMNRPacket packet = new LLMNRPacket(data); LLMNRListener listener = new LLMNRListener(); if (packet.Header.IsQuery()) { if (listener.Check(packet.Question.Name, packet.Question.Type, clientIP, out string message)) { byte[] buffer = packet.GetBytes(UInt32.Parse(Program.argLLMNRTTL), Program.argSpooferIP, Program.argSpooferIPv6); if (!Utilities.ArrayIsNullOrEmpty(buffer)) { UDPSocket.SendTo(clientIP, clientPort, sourceIP, sourcePort, buffer, false); } } Output.SpooferOutput("LLMNR", packet.Question.Type, packet.Question.Name, clientIP, message); } }