lib/wmap/port_scanner.rb
# Main worker method that run through the discovery ports list, check if any response to the HTTP request on the open ports, and finally return the findings in the URL format as an array
Main worker method that run through the discovery ports list, check if any response to the HTTP request on the open ports, and finally return the findings in the URL format as an array
Main worker method that run through the discovery ports list check if any response to the HTTP request on the open ports and finally return the findings in the URL format as an array
def scan (host)
		puts "Perform web service discovery on host: #{host}"
		begin
			pre_scan(host)
			urls=Array.new
			@discovery_tcp_ports.map do |port|
				if tcp_port_open?(host,port)
					url=host_2_url(host,port)
					urls.push(url) unless url.nil?
				end
			end
			if urls.empty?
				puts "No web service detected. "
			else
				urls.map do |url|
					unless @discovered_urls.key?(url)
						@discovered_urls[url]=true
					end
				end
				puts "Detected web service on host #{host}: #{urls}"
			end
			return urls
		rescue Exception => ee
			puts "Exception on method #{__method__}  for #{host}: #{ee}" if @verbose
			return nil
		end
	end
def scan ( host ) puts "Perform web service discovery on host: #{host}" begin pre_scan ( host ) urls = Array . new @discovery_tcp_ports . map do | port | if tcp_port_open? ( host , port ) url = host_2_url ( host , port ) urls . push ( url ) unless url . nil? end end if urls . empty? puts "No web service detected. " else urls . map do | url | unless @discovered_urls . key? ( url ) @discovered_urls [ url ] = true end end puts "Detected web service on host #{host}: #{urls}" end return urls rescue Exception => ee puts "Exception on method #{__method__}  for #{host}: #{ee}" if @verbose return nil end end
Main worker method that run through the discovery ports list, check if any response to the HTTP request on the open ports, and finally return the findings in the URL format as an array
Main worker method that run through the discovery ports list check if any response to the HTTP request on the open ports and finally return the findings in the URL format as an array
host
<not_specific>