0.0
No commit activity in last 3 years
No release in over 3 years
A straight-forward gem for accessing PhishTank's API to determine if a URL is a phishing site
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 10.0
~> 3.0

Runtime

 Project Readme

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