Mirror of metasploit
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

frames.rb 791B

12345678910111213141516171819202122232425262728293031323334353637
  1. ##
  2. # This file is part of the Metasploit Framework and may be subject to
  3. # redistribution and commercial restrictions. Please see the Metasploit
  4. # Framework web site for more information on licensing and terms of use.
  5. # http://metasploit.com/framework/
  6. ##
  7. require 'rubygems'
  8. require 'pathname'
  9. require 'nokogiri'
  10. require 'uri'
  11. class CrawlerFrames < BaseParser
  12. def parse(request,result)
  13. return unless result['Content-Type'].include?('text/html')
  14. doc = Nokogiri::HTML(result.body.to_s)
  15. doc.css('iframe').each do |ifra|
  16. ir = ifra['src']
  17. if ir && !ir.match(/^(\#|javascript\:)/)
  18. begin
  19. hreq = urltohash('GET', ir, request['uri'], nil)
  20. insertnewpath(hreq)
  21. rescue URI::InvalidURIError
  22. end
  23. end
  24. end
  25. end
  26. end