Remove the ::ffff prefix from returned IPv4 addresses

git-svn-id: file:///home/svn/framework3/trunk@6423 4d416f70-5f16-0410-b530-b9f4589650da
unstable
HD Moore 2009-03-29 03:24:59 +00:00
parent 2552633f9b
commit 12e3114873
2 changed files with 19 additions and 5 deletions

View File

@ -102,11 +102,16 @@ class Metasploit3 < Msf::Auxiliary
# The response parsers
#
def parse_reply(pkt)
@results ||= {}
# Ignore "empty" packets
return if not pkt[1]
if(pkt[1] =~ /^::ffff:/)
pkt[1] = pkt[1].sub(/^::ffff:/, '')
end
# Ignore duplicates
hkey = "#{pkt[1]}:#{pkt[2]}"
return if @results[hkey]

View File

@ -69,6 +69,7 @@ class Metasploit3 < Msf::Auxiliary
# Create an unbound UDP socket
udp_sock = Rex::Socket::Udp.create()
print_status(">> progress (#{batch[0]}-#{batch[-1]}) #{idx}/#{@comms.length * batch.length}...")
@comms.each do |comm|
data = create_probe(comm)
@ -82,13 +83,15 @@ class Metasploit3 < Msf::Auxiliary
nil
end
if (idx % 50 == 0)
while (r = udp_sock.recvfrom(65535, 0.10) and r[1])
if (idx % 10 == 0)
while (r = udp_sock.recvfrom(65535, 0.01) and r[1])
parse_reply(r)
end
end
idx += 1
if( (idx+=1) % 1000 == 0)
print_status(">> progress (#{batch[0]}-#{batch[-1]}) #{idx}/#{@comms.length * batch.length}...")
end
end
end
@ -109,6 +112,12 @@ class Metasploit3 < Msf::Auxiliary
#
def parse_reply(pkt)
return if not pkt[1]
if(pkt[1] =~ /^::ffff:/)
pkt[1] = pkt[1].sub(/^::ffff:/, '')
end
asn = ASNData.new(pkt[0])
inf = asn.access("L0.L0.L0.L0.V1.value")
if (inf)