/plugins/email.rb

https://github.com/urbanadventurer/WhatWeb · Ruby · 42 lines · 14 code · 7 blank · 21 comment · 1 complexity · 68904050e51fc7b325b4c360b23b743e MD5 · raw file

  1. ##
  2. # This file is part of WhatWeb and may be subject to
  3. # redistribution and commercial restrictions. Please see the WhatWeb
  4. # web site for more information on licensing and terms of use.
  5. # https://morningstarsecurity.com/research/whatweb
  6. ##
  7. Plugin.define do
  8. name "Email"
  9. authors [
  10. "Andrew Horton",
  11. # v0.2 # removed :certainty. end at an optional ?, return the email address as a :string.
  12. # v0.3 # added
  13. ]
  14. version "0.6"
  15. description "Extract email addresses. Find valid email address and syntactically invalid email addresses from mailto: link tags. We match syntactically invalid links containing mailto: to catch anti-spam email addresses, eg. bob at gmail.com. This uses the simplified email regular expression from http://www.regular-expressions.info/email.html for valid email address matching."
  16. # More Info:
  17. # The regex will only detect anti-spam e-mail addresses if present in "mailto:"
  18. # The regex does not validate e-mail addresses in "mailto:"
  19. #
  20. # Example:
  21. # <a href="mailto:bob at gmail dot com"> will return "bob at gmail dot com"
  22. # <p>Contact me: bob at gmail dot com</p> will not be detected
  23. # <p>Contact me: bob@gmail.com</p> will return "bob@gmail.com"
  24. # Google results as at 2011-03-19 #
  25. # 902 for "contact me" ("@hotmail.com"|"@gmail.com"|"@yahoo.com")
  26. # Matches #
  27. matches [
  28. # Detect valid email address in the page
  29. { :string=>/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/i },
  30. # Detect any email address in a mailto: tag
  31. { :string=>/<[^>]+href=[^>]*mailto:([^\'\"\?>]+)[^>]*>/i },
  32. ]
  33. end