An open API service indexing awesome lists of open source software.

https://github.com/zbone3/ruby-phishtank

A simple phishtank.com API gem
https://github.com/zbone3/ruby-phishtank

api-wrapper phishing phishtank ruby-phishtank

Last synced: 8 months ago
JSON representation

A simple phishtank.com API gem

Awesome Lists containing this 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

```shell
$ gem install ruby-phishtank
```

## Getting Started

First, let's require ruby-phishtank
```ruby
require 'phishtank'
```
Here are a few basic examples:

### Fetching raw data as XML
```ruby
client = Phishtank::Raw.new('ACCESS_KEY', 'xml')
raw.check_url('https://google.com')
```
Available formats:
* json
* xml
* php

### Using scanner for parsed data
```ruby
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
```ruby
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