Do not reply to non TXT records for now

git-svn-id: file:///home/svn/framework3/trunk@5599 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2008-07-26 02:53:49 +00:00
parent 30e29858a2
commit 067d19051e
1 changed files with 3 additions and 1 deletions

View File

@ -72,6 +72,7 @@ class Auxiliary::Server::Dns::SpoofHelper < Msf::Auxiliary
begin begin
name = '' name = ''
while @run while @run
reply = false
packet, addr = @sock.recvfrom(65535) packet, addr = @sock.recvfrom(65535)
if (packet.length == 0) if (packet.length == 0)
break break
@ -90,10 +91,11 @@ class Auxiliary::Server::Dns::SpoofHelper < Msf::Auxiliary
print_status("DNS #{addr[3]}:#{addr[1]} XID #{request.id} #{name}") print_status("DNS #{addr[3]}:#{addr[1]} XID #{request.id} #{name}")
answer = Resolv::DNS::Resource::IN::TXT.new("#{addr[3]}:#{addr[1]} #{name}") answer = Resolv::DNS::Resource::IN::TXT.new("#{addr[3]}:#{addr[1]} #{name}")
request.add_answer(name, 1, answer) request.add_answer(name, 1, answer)
reply = true
end end
} }
@sock.send(request.encode(), 0, addr[3], addr[1]) @sock.send(request.encode(), 0, addr[3], addr[1]) if reply
end end
# Make sure the socket gets closed on exit # Make sure the socket gets closed on exit