Giter Club home page Giter Club logo

virustotal's Introduction

virustotal

This is a PHP library for the VirusTotal.COM public API version 2.0. It's based upon the work of Adrian at www.TheWebHelp.com. As Adrian didn't include a license with his work, I didn't either (I cannot put part of his work under a license of my choice, after all).

Requirements

  • PHP (of course; tested with 5.4) with CURL support.
  • an API key (available for free at the VirusTotal website)

Usage

Usage is pretty easy. Best demonstrated using an example:

require_once('virustotal.class.php');
$vt = new virustotal($apikey);
$res = $vt->checkFile($filename,$hash); // $hash is optional. Pass the $scan_id if you have it, or the file hash
switch($res) {
  case -99: // API limit exceeded
    // deal with it here – best by waiting a little before trying again :)
    break;
  case  -1: // an error occured
    // deal with it here
    break;
  case   0: // no results (yet) – but the file is already enqueued at VirusTotal
    $scan_id = $vt->getScanId();
    $json_response = $vt->getResponse();
    break;
  case   1: // results are available
    $json_response = $vt->getResponse();
    break;
  default : // you should not reach this point if you've placed the break before :)
}
// deal with the JSON response here

For details on the JSON response (both on enqueuing a file and when getting the final scan results), please consult the VirusTotal API documentation. For details on the PHP class in this repository, consult the code. You should find it well documented :)

virustotal's People

Contributors

izzysoft avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.