I'm trying to send a spoofed time to a Windows machine when it requests time from the NTP server.
My server so far will display packets and send back data, however I can't seem to figure out exactly what I need to send to give Windows a fake time. I've tried capturing legitimate packets to send but failed.
In this example I'm just sending white space, I'm trying to figure out what data to send to tell the computer for example the time is 10:00AM when it's actually 12PM.
I intend to spoof DNS queries on a LAN to redirect them to this server which will respond with an incorrect time.
I've heard it can be done but have never seen a tool to do it, so that's what I'm trying to do now.
require 'socket'
class UDPServer
def initialize(port)
@port = port
end
def start
@socket = UDPSocket.new
@socket.bind('', @port)
data = " "
while true
packet = @socket.recvfrom(1024)
puts packet
@socket.send("${data}", 0, '10.0.0.16', "#{@port}")
end
end
end
server = UDPServer.new(123)
server.start