Skip to content

Commit

Permalink
Updated rss_feed plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoles committed Oct 18, 2010
1 parent a237ebf commit d10b6f8
Showing 1 changed file with 19 additions and 23 deletions.
42 changes: 19 additions & 23 deletions plugins/rss_feed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 <bcoles@gmail.com>
# 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=>/<link .*?type=["']application\/rss\+xml["'].*?>/im
} #'
]

def passive
#link=@body.scan(/<link .*?type=["']application\/rss\+xml["'].*?>/im).first
re=/<link .*?type=["']application\/rss\+xml["'].*?>/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=>/<link[^>]*href[\s]*=[\s]*["']([^\'^\"^\s^>]+)[^>]*type[\s]*=[\s]*["']application\/rss\+xml["'][^>]*/i, :version_regexp_offset=>0 },
{ :version=>/<link[^>]*type[\s]*=[\s]*["']application\/rss\+xml["'][^>]*href[\s]*=[\s]*["']([^\'^\"^\s^>]+)[^>]*/i, :version_regexp_offset=>0 },

]

end


0 comments on commit d10b6f8

Please sign in to comment.