lib/wmap/url_checker.rb
# Use MD5 algorithm to fingerprint the URL / site response payload (web page content)
Use MD5 algorithm to fingerprint the URL / site response payload (web page content)
Use MD5 algorithm to fingerprint the URL / site response payload ( web page content )
def response_body_md5(url)
		puts "MD5 finger print page body content: #{url}" if @verbose
		raise "Invalid url: #{url}" unless is_url?(url)
		url=url.strip.downcase
		timeo = @http_timeout/1000.0
		uri = URI.parse(url)
		fp=""
		http = Net::HTTP.new(uri.host, uri.port)
		http.open_timeout = timeo
		http.read_timeout = timeo
		if (url =~ /https\:/i)
			http.use_ssl = true
			http.verify_mode = OpenSSL::SSL::VERIFY_NONE
			http.ssl_version = @ssl_version
		end
		request = Net::HTTP::Get.new(uri.request_uri)
		response = http.request(request)
		response_body = response.body.to_s
		fp=Digest::MD5.hexdigest(response_body) unless response_body.nil?
		@url_finger_print[url] = fp
		return fp
	rescue Exception => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
	end
def response_body_md5 ( url ) puts "MD5 finger print page body content: #{url}" if @verbose raise "Invalid url: #{url}" unless is_url? ( url ) url = url . strip . downcase timeo = @http_timeout / 1000.0 uri = URI . parse ( url ) fp = "" http = Net :: HTTP . new ( uri . host , uri . port ) http . open_timeout = timeo http . read_timeout = timeo if ( url =~ / https \: /i ) http . use_ssl = true http . verify_mode = OpenSSL :: SSL :: VERIFY_NONE http . ssl_version = @ssl_version end request = Net :: HTTP :: Get . new ( uri . request_uri ) response = http . request ( request ) response_body = response . body . to_s fp = Digest :: MD5 . hexdigest ( response_body ) unless response_body . nil? @url_finger_print [ url ] = fp return fp rescue Exception => ee puts "Exception on method #{__method__}: #{ee}" if @verbose end
Use MD5 algorithm to fingerprint the URL / site response payload (web page content)
Use MD5 algorithm to fingerprint the URL / site response payload ( web page content )
# Bypass the remote web server cert validation test
url
<not_specific>