diff --git a/plugins/rss_feed.rb b/plugins/rss_feed.rb index 64a7091eb..86096174c 100644 --- a/plugins/rss_feed.rb +++ b/plugins/rss_feed.rb @@ -4,34 +4,30 @@ # web site for more information on licensing and terms of use. # http://www.morningstarsecurity.com/research/whatweb ## - - -Plugin.define "RSSFeed" do +# Version 0.2 # Brendan Coles +# Fixed regex +## +Plugin.define "RSS-Feed" do author "Caleb Anderson" -version "0.1" -description "rss feed detection" - -examples %w|adrianlamologs.blogspot.com www.wired.com| +version "0.2" +description "This plugin detects RSS feeds and extracts the RSS feed source." + +examples %w| +itsecuritysolutions.org +morningstarsecurity.com +ha.ckers.org +www.kiwicon.org +adrianlamologs.blogspot.com +www.wired.com +| matches [ -{:name=>"rss link type", -:regexp=>//im -} #' -] -def passive - #link=@body.scan(//im).first - re=//im #' - if @body =~ re - link=@body.scan(re).first - url=link.scan(/href=["'](.*?)["']/i).first.first rescue nil - end - - return [{:name=>"rss link",:string=>url}] unless url.nil? - return [] -end +# Extract RSS feed source +{ :version=>/]*href[\s]*=[\s]*["']([^\'^\"^\s^>]+)[^>]*type[\s]*=[\s]*["']application\/rss\+xml["'][^>]*/i, :version_regexp_offset=>0 }, +{ :version=>/]*type[\s]*=[\s]*["']application\/rss\+xml["'][^>]*href[\s]*=[\s]*["']([^\'^\"^\s^>]+)[^>]*/i, :version_regexp_offset=>0 }, +] end -