ruby-phishtank is a straight-forward gem for accessing PhishTank's API to determine if a URL is a phishing site.
- Fetch raw data on a Phishtank phishing listing in formats (as provided by phishtank): json, xml, php.
- Parsed data methods (e.g. is_valid_phishing?, in_database? etc.).
- Phishtank DB snapshot download. Available in formats (as provided by phishtank): json, csv, xml, php_serialized.
- Ruby >= 1.9.3
$ gem install ruby-phishtank
First, let's require ruby-phishtank
require 'phishtank'
Here are a few basic examples:
client = Phishtank::Raw.new('ACCESS_KEY', 'xml')
raw.check_url('https://google.com')
Available formats:
- json
- xml
- php
scanner = Phishtank::Scanner.new('ACCESS_KEY')
parsed_data = scanner.scan('https://phishingsite.com/login.php')
# Determine if phishing site
parsed_data.is_valid_phishing?
# Determine if site was verified by a phishtank community
parsed_data.is_verified?
# Check if site is in Phishtank DB
parsed_data.in_database?
Methods:
- is_valid_phishing?
- is_verified?
- verified_at
- in_database?
- phishing_site_url
- phishtank_details_url
- phish_id
db = Phishtank::DB.new('ACCESS_KEY', 'csv', 'gz')
result = db.download
Available formats:
- json
- csv
- xml
- php_serialized
Available compression methods:
- gz
- bz2
- nil > if no compression required