Skip to content

zbone3/ruby-phishtank

Repository files navigation

Ruby-Phishtank

ruby-phishtank is a straight-forward gem for accessing PhishTank's API to determine if a URL is a phishing site.

Features

  • 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.

Requirements

  • Ruby >= 1.9.3

Installation

$ gem install ruby-phishtank

Getting Started

First, let's require ruby-phishtank

require 'phishtank'

Here are a few basic examples:

Fetching raw data as XML

client = Phishtank::Raw.new('ACCESS_KEY', 'xml')
raw.check_url('https://google.com')

Available formats:

  • json
  • xml
  • php

Using scanner for parsed data

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

Downloading DB snapshot

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

Releases

No releases published

Packages

No packages published