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
- Host: GitHub
- URL: https://github.com/zbone3/ruby-phishtank
- Owner: zbone3
- License: mit
- Created: 2017-10-20T16:26:27.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-20T22:53:55.000Z (almost 8 years ago)
- Last Synced: 2024-10-30T03:30:51.764Z (12 months ago)
- Topics: api-wrapper, phishing, phishtank, ruby-phishtank
- Language: Ruby
- Homepage: https://github.com/zbone3/ruby-phishtank
- Size: 8.79 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
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