Skip to content

Instantly share code, notes, and snippets.

@sss
Created December 31, 2010 09:25
Show Gist options
  • Save sss/760888 to your computer and use it in GitHub Desktop.
Save sss/760888 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
require 'rest-client'
require 'mechanize'
agent = Mechanize.new
res = agent.post( 'https://www.virustotal.com/api/get_file_report.json',
'key' => 'your key',
'resource' => 'file hash(md5/sha1/sha256)' )
get_file_report = JSON.parse(res.body)
p get_file_report['report']
res = RestClient.post( 'https://www.virustotal.com/api/get_file_report.json',
'key' => 'your key',
'resource' => 'file hash(md5/sha1/sha256)' )
get_file_report = JSON.parse(res)
p get_file_report['report']
res = RestClient.post( 'https://www.virustotal.com/api/scan_file.json',
:key => 'your key',
:file => File.new("test.txt", 'r'),
:multipart => true)
scan_file_json = JSON.parse(res)
p scan_file_json['scan_id']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment