README.md in virustotalx-0.1.1 vs README.md in virustotalx-1.0.0

- old
+ new

@@ -1,12 +1,13 @@ # virustotalx [![Gem Version](https://badge.fury.io/rb/virustotalx.svg)](https://badge.fury.io/rb/virustotalx) [![Build Status](https://travis-ci.org/ninoseki/virustotalx.svg?branch=master)](https://travis-ci.org/ninoseki/virustotalx) [![Coverage Status](https://coveralls.io/repos/github/ninoseki/virustotalx/badge.svg?branch=master)](https://coveralls.io/github/ninoseki/virustotalx?branch=master) +[![CodeFactor](https://www.codefactor.io/repository/github/ninoseki/virustotalx/badge)](https://www.codefactor.io/repository/github/ninoseki/virustotalx) -Yet another VirusTotal API wrapper for Ruby +Yet another VirusTotal API (version 3) wrapper for Ruby. ## Installation ```bash gem install virustotalx @@ -17,62 +18,91 @@ ```ruby require "virustotalx" # or require "virustotal" -# when given nothing, it tries to load your API key from ENV["VIRUSTOTASL_API_KEY"] +# when given nothing, it tries to load your API key from ENV["VIRUSTOAL_API_KEY"] api = VirusTotal::API.new # or you can set it manually api = VirusTotal::API.new(key: "YOUR_API_KEY") hash = "726a2eedb9df3d63ec1b4a7d774a799901f1a2b9" -api.file.report(hash) -api.file.scan("PAHT_TO_FILE") -api.file.rescan(hash) -api.file.upload_url -api.file.download(hash) -api.file.behaviour(hash) -api.file.network_traffic(hash) -api.file.clusters("DATETIME") -api.file.search("resource:#{hash}") +api.file.get(hash) +api.file.upload("/tmp/test.txt") -api.url.report("http://github.com") -api.url.scan("https://github.com/ninoseki/virustotalx") +api.url.get("http://github.com") +api.url.analyse("https://github.com/ninoseki/virustotalx") -api.domain.report("github.com") +api.domain.get("github.com") -api.ip_address.report("1.1.1.1") - -# it returns nil when given a non-existing resource to #report methods -api.domain.report("a_domain_which_does_not_exist.com") -# => nil +api.ip_address.get("1.1.1.1") ``` -See `/spec/clients` for more. - ## Supported API endpoints -* [VirusTotal API reference](https://developers.virustotal.com/reference) +* [VirusTotal API reference](https://developers.virustotal.com/v3.0/reference#overview) -| HTTP Method | URL | Public / Private | API method | -|-------------|-----------------------|------------------|-----------------------------------------------------------| -| GET | /file/report | Public | `VirusTotal::Client::File#report(resource, allinfo: nil)` | -| POST | /file/scan | Public | `VirusTotal::Client::File#scan(path)` | -| GET | /file/scan/upload_url | Private | `VirusTotal::Client::File#upload_url` | -| POST | /file/rescan | Public | `VirusTotal::Client::File#rescan(resource)` | -| GET | /file/download | Private | `VirusTotal::Client::File#download(hash)` | -| GET | /file/behaviour | Private | `VirusTotal::Client::File#behaviour(hash)` | -| GET | /file/network-traffic | Private | `VirusTotal::Client::File#network_traffic(hash)` | -| GET | /file/feed | Private | N/A | -| GET | /file/clusters | Private | `VirusTotal::Client::File#clusters(date)` | -| GET | /file/search | Private | `VirusTotal::Client::File#search(query, offset: nil)` | -| GET | /url/report | Public | `VirusTotal::Client::URL#report(resource, allinfo: nil)` | -| POST | /url/scan | Public | `VirusTotal::Client::URL#scan(url)` | -| GET | /url/feed | Private | N/A | -| GET | /domain/report | Public | `VirusTotal::Client::Domain#report(domain)` | -| GET | /ip-address/report | Public | `VirusTotal::Client::IPAddress(ip)` | -| GET | /comments/ | Public | N/A | -| POST | /comments/put | Public | N/A | +### Files + +| HTTP Method | URL | API method | +|-------------|------------------------------------|------------------------------------------------------------| +| POST | /files | api.file.upload(filepath) | +| GET | /files/upload_url | api.file.upload_url | +| GET | /files/{id} | api.file.get(id) | +| POST | /files | api.file.upload(path) | +| POST | /files/{id}/analyse | api.file.analyse(id) | +| GET | /files/{id}/comments | api.file.comments(id) | +| POST | /files/{id}/comments | api.file.add_comment(id, text) | +| GET | /files/{id}/votes | api.file.votes(id) | +| POST | /files/{id}/votes | api.file.add_vote(id, verdict) | +| GET | /files/{id}/download_url | api.file.downbload_url(id) | +| GET | /files/{id}/download | api.file.download(id) | +| GET | /files/{id}/{relationship} | api.file.`relationship`(id) (e.g. api.file.behaviours(id)) | +| GET | /file_behaviours/{sandbox_id}/pcap | api.file.pcap(sandbox_id) | + +### URLs + +| HTTP Method | URL | API method | +|-------------|-----------------------------|----------------------------------------------------------------| +| POST | /urls | N/A | +| GET | /urls/{id} | api.url.get(id) | +| POST | /urls/{id}/analyse | api.url.analyse(id) | +| GET | /urls/{id}/comments | api.url.comments(id) | +| POST | /urls/{id}/comments | api.url.add_comment(id) | +| GET | /urls/{id}/votes | api.url.votes(id) | +| POST | /urls/{id}/votes | api.url.add_vote(id, text) | +| GET | /urls/{id}/network_location | api.url.network_location(id) | +| GET | /urls/{id}/{relationship} | api.url.`relationship`(id) (e.g. api.url.downloaded_files(id)) | + +Note: you can use a URL as an id. + +### Domains + +| HTTP Method | URL | API method | +|-------------|----------------------------------|--------------------------------------------------------------| +| GET | /domains/{domain} | api.domain.get(domain) | +| GET | /domains/{domain}/comments | api.domain.comment(domain) | +| POST | /domains/{domain}/comments | api.domain.add_comment(domain, text) | +| GET | /domains/{domain}/{relationship} | api.domain.`relationship`(domain) (e.g. api.domain.(domain)) | + +### IP addresses + +| HTTP Method | URL | API method | +|-------------|-----------------------------------|---------------------------------------------------------------------------------| +| GET | /ip_addresses/{ip} | api.ip_address.get(ip) | +| GET | /ip_addresses/{ip}/comments | api.ip_address.comments(id) | +| POST | /ip_addresses/{ip}/comments | api.ip_address.add_comment(id, text) | +| GET | /ip_addresses/{ip}/{relationship} | api.ip_address.`relationship`(id) (e.g. api.ip_address.communicating_files(ip)) | + +### Analyses + +| HTTP Method | URL | API method | +|-------------|----------------|----------------------| +| GET | /analyses/{id} | api.analysis.get(ip) | + +## Graphs + +N/A. ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).