node-virustotal
Advanced tools
Comparing version 0.3.3 to 0.3.4
@@ -237,7 +237,4 @@ var https = require("https"); | ||
}; | ||
var getFileReport = function(resourceID, responseProc, errProc, scanID) { | ||
var fileResourceURL = "https://www.virustotal.com/vtapi/v2/file/report?resource=" + resourceID + "&apikey=" + key; | ||
if ((scanID != null) && (scanID != "")) { | ||
fileResourceURL = fileResourceURL + "&scan_id=" + scanID; | ||
} | ||
var getFileReport = function(scanID, responseProc, errProc) { | ||
var fileResourceURL = "https://www.virustotal.com/vtapi/v2/file/report?apikey=" + key + "&resource=" + scanID; | ||
var retrieveProc = function(){ | ||
@@ -292,3 +289,3 @@ request({url: fileResourceURL, method: "POST"}, function(error, response, body){ | ||
self.submitFileForAnalysis(filename, filetype, filecontent, function(responseData){ | ||
self.getFileReport(responseData.sha256, responseProc, errProc, responseData.scan_id); | ||
self.getFileReport(responseData.scan_id, responseProc, errProc); | ||
}, errProc); | ||
@@ -295,0 +292,0 @@ }; |
{ | ||
"name": "node-virustotal", | ||
"version": "0.3.3", | ||
"version": "0.3.4", | ||
"description": "An implementation of the Virustotal API for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "code.js", |
@@ -69,3 +69,3 @@ # node-virustotal | ||
### PublicConnection.getFileReport() | ||
getFileReport() asks Virustotal for the report of a file that was previously submitted. It takes 3 or 4 parameters. The first parameter is the file's identification. See the documentation for rescanFile() for the identification. The next two parameters are the usual response and error functions. The 4th parameter is optional this can be used to request the report for a specific scan_id of a file, rather than simply the latest scanjob. This is useful if multiple versions exist, or if there's a hash collision. The scan_id can be obtained from the result of submitFileForAnalysis. By default, if Virustotal reports that the file in question hasn't been scanned yet, then this function will continue to request reports until one is obtained or an error happens. This requesting process happens within the bounds of the job queueing system that the rest of this API uses. However, depending on Virustotal's load, this can take hours, so whatever you do, don't use this for real time responses. | ||
getFileReport() asks Virustotal for the report of a file that was previously submitted. It takes 3 parameters. The first parameter is the file's scan_id , which is obtained as a member variable in the result of submitFileForAnalysis. The next two parameters are the usual response and error functions. By default, if Virustotal reports that the file in question hasn't been scanned yet, then this function will continue to request reports until one is obtained or an error happens. This requesting process happens within the bounds of the job queueing system that the rest of this API uses. However, depending on Virustotal's load, this can take hours, so whatever you do, don't use this for real time responses. | ||
@@ -169,3 +169,2 @@ ### PublicConnection.publishFileComment() | ||
### Honeypot2Connection.submitUrlForScanning() | ||
@@ -190,3 +189,3 @@ This function takes 3 parameters: a URL for scanning "with the protocol", a function to perform if a confirmation is obtained, and a function to perform if an error is obtained. The two functions both take a single parameter. In the case of the first function, said parameter will always be a response object. In the case of the second parameter, this is an error object which may be an object of some kind. It submits a URL for the analysis queue. | ||
### Honeypot2Connection.getFileReport() | ||
getFileReport() asks Virustotal for the report of a file that was previously submitted. It takes 3 or 4 parameters. The first parameter is the file's identification. See the documentation for rescanFile() for the identification. The next two parameters are the usual response and error functions. The 4th parameter is optional this can be used to request the report for a specific scan_id of a file, rather than simply the latest scanjob. This is useful if multiple versions exist, or if there's a hash collision. The scan_id can be obtained from the result of submitFileForAnalysis. By default, if Virustotal reports that the file in question hasn't been scanned yet, then this function will continue to request reports until one is obtained or an error happens. This requesting process happens within the bounds of the job queueing system that the rest of this API uses. However, depending on Virustotal's load, this can take hours, so whatever you do, don't use this for real time responses. | ||
getFileReport() asks Virustotal for the report of a file that was previously submitted. It takes 3 parameters. The first parameter is the file's scan_id , which is obtained as a member variable in the result of submitFileForAnalysis. The next two parameters are the usual response and error functions. By default, if Virustotal reports that the file in question hasn't been scanned yet, then this function will continue to request reports until one is obtained or an error happens. This requesting process happens within the bounds of the job queueing system that the rest of this API uses. However, depending on Virustotal's load, this can take hours, so whatever you do, don't use this for real time responses. | ||
@@ -193,0 +192,0 @@ ### Honeypot2Connection.publishFileComment() |
@@ -8,2 +8,3 @@ var vt = require("./code.js"); | ||
console.log(con.getDelay()); | ||
con.checkIPv4("90.156.201.27",function(data){ | ||
@@ -44,3 +45,3 @@ console.dir(data); | ||
}); | ||
con.getFileReport("de053e0e115fc94a81eb3dc074b02c68efaa60ff4251f386e299d8814ff657a6", function(data){ | ||
con.getFileReport("52d3df0ed60c46f336c131bf2ca454f73bafdc4b04dfa2aea80746f5ba9e6d1c-1273894724", function(data){ | ||
console.log(data); | ||
@@ -47,0 +48,0 @@ }, function(mistake){ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48700
641
375