demos/filter_known_services.rb
# Create a known service map by parsing last quarter scan list
Create a known service map by parsing last quarter scan list
Create a known service map by parsing last quarter scan list
def parse_old
	host_tracker=Wmap::HostTracker.instance
	@services=Hash.new
	f_site=File.open(ARGV[0],'r')
	f_site.each do |line|
		site=line.chomp.strip
		site=host_tracker.url_2_site(site)
		abort "Error on processing site: #{site}" if site.nil?
		host=host_tracker.url_2_host(site)
		abort "Error on processing host: #{host}" if host.nil?
		ip=host_tracker.local_host_2_ip(host)
		ip=host_tracker.host_2_ip(host) if ip.nil?
		next if ip.nil?
		next unless host_tracker.is_ip?(ip)
		port=host_tracker.url_2_port(site)
		key=ip+":"
		key+=port.to_s
		@services[key]=true unless @services.key?(key)
	end
	f_site.close
	host_tracker=nil
end
def parse_old host_tracker = Wmap :: HostTracker . instance @services = Hash . new f_site = File . open ( ARGV [ 0 ] , 'r' ) f_site . each do | line | site = line . chomp . strip site = host_tracker . url_2_site ( site ) abort "Error on processing site: #{site}" if site . nil? host = host_tracker . url_2_host ( site ) abort "Error on processing host: #{host}" if host . nil? ip = host_tracker . local_host_2_ip ( host ) ip = host_tracker . host_2_ip ( host ) if ip . nil? next if ip . nil? next unless host_tracker . is_ip? ( ip ) port = host_tracker . url_2_port ( site ) key = ip + ":" key += port . to_s @services [ key ] = true unless @services . key? ( key ) end f_site . close host_tracker = nil end
Create a known service map by parsing last quarter scan list
Create a known service map by parsing last quarter scan list