The virustotal package provides access to the VirusTotal API v3, allowing you to scan files and URLs for malware, get domain and IP intelligence, and retrieve comprehensive threat analysis reports.
To get the current development version from GitHub:
Or install the development version:
Scan a file for malware:
# Submit a file for analysis
result <- scan_file("path/to/suspicious_file.exe")
analysis_id <- result$data$idGet file analysis report:
# Get analysis results using file hash
report <- file_report("99017f6eebbac24f351415dd410d522d")
# Access scan results
scan_results <- report$data$attributes$last_analysis_results
total_engines <- length(scan_results)
detections <- sum(sapply(scan_results, function(x) x$category == "malicious"))Request file rescan:
Scan a URL:
# Submit URL for analysis
url_result <- scan_url("http://suspicious-site.com")
analysis_id <- url_result$data$idGet URL analysis report:
Get domain information:
The package automatically handles VirusTotal’s rate limits (4 requests per minute for free accounts). You don’t need to implement your own rate limiting.
All functions include comprehensive input validation and will provide clear error messages for common issues like missing API keys or invalid parameters.