lib/wmap/port_scanner.rb
# Parallel scanner - by utilizing fork manager 'parallel' to spawn numbers of child processes on multiple hosts/IPs simultaneously
Parallel scanner - by utilizing fork manager 'parallel' to spawn numbers of child processes on multiple hosts/IPs simultaneously
Parallel scanner - by utilizing fork manager ' parallel ' to spawn numbers of child processes on multiple hosts / IPs simultaneously
def scans (targets,num=@max_parallel)
		all_urls=Array.new
		targets = targets - ["", nil]
		if targets.size > 0
			puts "Start the parallel port scan on the target list:\n #{targets}"
			Parallel.map(targets.shuffle, :in_processes => num) { |target|
				scan(target)
			}.each do |process|
				if process.nil?
					next
				elsif process.empty?
				else
					process.map do |url|
						unless @discovered_urls.key?(url)
							@discovered_urls[url]=true
						end
					end
					all_urls+=process
				end
			end
		end
		puts "Port scanning done successfully with the found web services: #{all_urls}"
		return all_urls
	rescue Exception => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
		return nil
	end
def scans ( targets , num = @max_parallel ) all_urls = Array . new targets = targets - [ "" , nil ] if targets . size > 0 puts "Start the parallel port scan on the target list:\n #{targets}" Parallel . map ( targets . shuffle , :in_processes => num ) { | target | scan ( target ) } . each do | process | if process . nil? next elsif process . empty? else process . map do | url | unless @discovered_urls . key? ( url ) @discovered_urls [ url ] = true end end all_urls += process end end end puts "Port scanning done successfully with the found web services: #{all_urls}" return all_urls rescue Exception => ee puts "Exception on method #{__method__}: #{ee}" if @verbose return nil end
Parallel scanner - by utilizing fork manager 'parallel' to spawn numbers of child processes on multiple hosts/IPs simultaneously
Parallel scanner - by utilizing fork manager ' parallel ' to spawn numbers of child processes on multiple hosts / IPs simultaneously
# 10/5/2013 add additional logic to eliminate invalid /duplicate target(s) #do nothing
targets
<not_specific>
num
<not_specific>