Sha256: 314c1a4f05a54dbee8b9b19f128355a6e2cbda7d72d1fba55bfbb121dc84bfdf
Contents?: true
Size: 571 Bytes
Versions: 34
Compression:
Stored size: 571 Bytes
Contents
# Exact netname and description from the whois query on an IP # Usage: ruby filter_netinfo.rb [file_ip] require "wmap" puts Wmap.banner whois = Wmap::Whois.new(:verbose=>false) #tracker = Wmap::CidrTracker.new #puts "IP ; Netname ; Net Reference" f_ips = File.open(ARGV[0], 'r:iso-8859-1') f_ips.each do |line| ip=line.chomp.split(',')[1] if whois.is_ip?(ip) or whois.is_cidr?(ip) netname=whois.get_netname(ip) desc=whois.get_net_desc(ip) #tr=tracker.track(ip) puts "#{line.chomp};#{netname};#{desc}" else puts "#{line.chomp};;" end end f_ips.close
Version data entries
34 entries across 34 versions & 1 rubygems