Giter VIP home page Giter VIP logo

virustotal.js's Introduction

About

VirusTotal API 2.0 client for node.js.

Installation

npm install virustotal.js

Reference

Usage mode

var virustotal = require('virustotal.js');
virustotal.setKey('your-api-key');
virustotal.scanFile('file.exe', function (err, res) {
	if (err) {
		console.error(err);
		return;
	}
	
	console.log(res);
	
});

virustotal.js's People

Contributors

saltwaterc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

virustotal.js's Issues

Crash after exceed the max request per minute

Unhandled error when the maximum request per minute (4 for public API) is exceed.

/home/yago/Programacion/virustotal-test/node_modules/virustotal.js/lib/virustotal.js:104
        jsonHandler(res.buffer.toString(), callback);
                               ^
TypeError: Cannot call method 'toString' of undefined
    at /home/yago/Programacion/virustotal-test/node_modules/virustotal.js/lib/virustotal.js:104:26
    at /home/yago/Programacion/virustotal-test/node_modules/virustotal.js/node_modules/http-request/lib/main.js:59:6
    at Request.finish (/home/yago/Programacion/virustotal-test/node_modules/virustotal.js/node_modules/http-request/lib/request.js:737:3)
    at Request.saveBuffer (/home/yago/Programacion/virustotal-test/node_modules/virustotal.js/node_modules/http-request/lib/request.js:116:8)
    at /home/yago/Programacion/virustotal-test/node_modules/virustotal.js/node_modules/http-request/lib/main.js:53:13
    at Request.success (/home/yago/Programacion/virustotal-test/node_modules/virustotal.js/node_modules/http-request/lib/request.js:722:3)
    at ClientRequest.<anonymous> (/home/yago/Programacion/virustotal-test/node_modules/virustotal.js/node_modules/http-request/lib/request.js:371:10)
    at ClientRequest.g (events.js:180:16)
    at ClientRequest.emit (events.js:95:17)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (http.js:1692:21)

And my test case:

var virustotal = require('virustotal.js');
virustotal.setKey('__PUBLIC_API_KEY__');

for (var i = 0; i < 9; i++) { 
    virustotal.getUrlReport('google.com', function (err, res) {
        if (err) {
            console.error(err);
            return;
        }

        console.log(res);
    });
}

write after end when using scanFile

Pretty tricky to pin this down inside any of the dependencies, but I'm consistently seeing

 { [Error: write after end]
  url: 'https://www.virustotal.com/vtapi/v2/file/scan',
  method: 'POST' }

even when I just run the example code on its own.

The file exists, and attempting to scan any other files yields the same result.

This is on OS X and Linux (Ubuntu) so far

Any idea what the cause of this will be?

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.