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.

objects.rb 794B

12345678910111213141516171819202122232425262728293031323334353637
  1. ##
  2. # $Id$
  3. ##
  4. ##
  5. # This file is part of the Metasploit Framework and may be subject to
  6. # redistribution and commercial restrictions. Please see the Metasploit
  7. # Framework web site for more information on licensing and terms of use.
  8. # http://metasploit.com/framework/
  9. ##
  10. # $Revision$
  11. require 'rubygems'
  12. require 'pathname'
  13. require 'nokogiri'
  14. require 'uri'
  15. class CrawlerObjects < BaseParser
  16. def parse(request,result)
  17. return unless result['Content-Type'].include?('text/html') # TOOD: use MIXIN
  18. hr = ''
  19. m = ''
  20. doc = Nokogiri::HTML(result.body.to_s)
  21. doc.xpath("//object/embed").each do |obj|
  22. s = obj['src']
  23. begin
  24. hreq = urltohash('GET', s, request['uri'], nil)
  25. insertnewpath(hreq)
  26. rescue URI::InvalidURIError
  27. end
  28. end
  29. end
  30. end