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.

scripts.rb 601B

1234567891011121314151617181920212223242526272829
  1. ##
  2. # This module requires Metasploit: https://metasploit.com/download
  3. # Current source: https://github.com/rapid7/metasploit-framework
  4. ##
  5. require 'pathname'
  6. require 'nokogiri'
  7. require 'uri'
  8. class CrawlerScripts < BaseParser
  9. def parse(request,result)
  10. return unless result['Content-Type'].include? "text/html"
  11. doc = Nokogiri::HTML(result.body.to_s)
  12. doc.xpath("//script").each do |obj|
  13. s = obj['src']
  14. begin
  15. hreq = urltohash('GET', s, request['uri'], nil)
  16. insertnewpath(hreq)
  17. rescue URI::InvalidURIError
  18. # ignored
  19. end
  20. end
  21. end
  22. end