Package 'virustotal'

Title: R Client for the VirusTotal API
Description: Provides a comprehensive R interface to the VirusTotal API v3.0, a Google service that analyzes files and URLs for viruses, worms, trojans and other malware. Features include file/URL scanning, domain categorization, passive DNS information, IP reputation analysis, IoC relationships, sandbox analysis, and comment/voting systems. Implements rate limiting, error handling, and response validation for robust security analysis workflows.
Authors: Gaurav Sood [aut, cre]
Maintainer: Gaurav Sood <[email protected]>
License: MIT + file LICENSE
Version: 0.6.0
Built: 2026-05-31 07:14:34 UTC
Source: https://github.com/themains/virustotal

Help Index


Get Domain Report

Description

Retrieves comprehensive analysis report for a given domain, including WHOIS information, DNS resolutions, detected URLs, and threat intelligence data.

Usage

domain_report(domain = NULL, ...)

Arguments

domain

Domain name (character string). Required.

...

Additional arguments passed to virustotal_GET

Value

A virustotal_domain_report object containing domain analysis results including WHOIS data, DNS resolutions, detected URLs, categories, and threat intelligence

References

https://docs.virustotal.com/reference/domains

See Also

set_key for setting the API key

Examples

## Not run: 
# Set API key first
set_key('your_api_key_here')

# Get domain reports
report1 <- domain_report("google.com")
report2 <- domain_report("https://www.example.com/path")

print(report1)
summary(report1)

## End(Not run)

Download a file from VirusTotal

Description

Download a file from VirusTotal

Usage

download_file(hash = NULL, output_path = NULL, ...)

Arguments

hash

File hash (MD5, SHA1, or SHA256)

output_path

Local path to save the downloaded file. Optional.

...

Additional arguments passed to virustotal_GET.

Value

Raw file content or saves file to specified path

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

download_file(hash='99017f6eebbac24f351415dd410d522d',
              output_path='/tmp/downloaded_file')

## End(Not run)

Get File Scan Report

Description

Retrieves detailed analysis results for a file from VirusTotal using the v3 API.

Usage

file_report(hash, ...)

Arguments

hash

File hash (MD5, SHA1, or SHA256) or analysis ID

...

Additional arguments passed to virustotal_GET

Value

A virustotal_file_report object containing file analysis results including antivirus scans, file metadata, and threat detection information

References

https://docs.virustotal.com/reference/files

See Also

set_key for setting the API key, scan_file for submitting files

Examples

## Not run: 
# Set API key first
set_key('your_api_key_here')

# Get file report using hash
report <- file_report(hash = '99017f6eebbac24f351415dd410d522d')
print(report)
summary(report)

# Work with the rich nested structure returned by v3 API
print(report$data$attributes$last_analysis_stats)

## End(Not run)

Get Analysis Results

Description

Retrieves the results of a file or URL analysis by its analysis ID.

Usage

get_analysis(id = NULL, ...)

Arguments

id

Analysis ID (character string). Required.

...

Additional arguments passed to virustotal_GET.

Value

list containing analysis results including status and detection stats

References

https://docs.virustotal.com/reference/analysis

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_analysis(id='NjY0MjRlOTFjMDIyYTkyNWM0NjU2NWQzYWNlMzFmZmI6MTI4NTk')

## End(Not run)

Get Behaviour EVTX File

Description

Retrieves the EVTX (Windows Event Log) file from a sandbox analysis.

Usage

get_behaviour_evtx(sandbox_id = NULL, output_path = NULL, ...)

Arguments

sandbox_id

Sandbox report ID (character string). Required.

output_path

Local path to save the EVTX file. Optional.

...

Additional arguments passed to httr::GET.

Value

Raw EVTX content or saves to file if output_path specified

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key, get_behaviour_report for JSON report

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

evtx <- get_behaviour_evtx(sandbox_id='hash_sandboxname')
get_behaviour_evtx(sandbox_id='hash_sandboxname',
                   output_path='/tmp/events.evtx')

## End(Not run)

Get Behaviour HTML Report

Description

Retrieves a detailed HTML report from a sandbox analysis.

Usage

get_behaviour_html(sandbox_id = NULL, output_path = NULL, ...)

Arguments

sandbox_id

Sandbox report ID (character string). Required.

output_path

Local path to save the HTML file. Optional.

...

Additional arguments passed to httr::GET.

Value

Raw HTML content or saves to file if output_path specified

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key, get_behaviour_report for JSON report

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

html <- get_behaviour_html(sandbox_id='hash_sandboxname')
get_behaviour_html(sandbox_id='hash_sandboxname',
                   output_path='/tmp/report.html')

## End(Not run)

Get Behaviour Memory Dump

Description

Retrieves the memory dump file from a sandbox analysis.

Usage

get_behaviour_memdump(sandbox_id = NULL, output_path = NULL, ...)

Arguments

sandbox_id

Sandbox report ID (character string). Required.

output_path

Local path to save the memory dump file. Optional.

...

Additional arguments passed to httr::GET.

Value

Raw memory dump content or saves to file if output_path specified

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key, get_behaviour_report for JSON report

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

memdump <- get_behaviour_memdump(sandbox_id='hash_sandboxname')
get_behaviour_memdump(sandbox_id='hash_sandboxname',
                      output_path='/tmp/memory.dmp')

## End(Not run)

Get Behaviour PCAP File

Description

Retrieves the PCAP (network capture) file from a sandbox analysis.

Usage

get_behaviour_pcap(sandbox_id = NULL, output_path = NULL, ...)

Arguments

sandbox_id

Sandbox report ID (character string). Required.

output_path

Local path to save the PCAP file. Optional.

...

Additional arguments passed to httr::GET.

Value

Raw PCAP content or saves to file if output_path specified

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key, get_behaviour_report for JSON report

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

pcap <- get_behaviour_pcap(sandbox_id='hash_sandboxname')
get_behaviour_pcap(sandbox_id='hash_sandboxname',
                   output_path='/tmp/capture.pcap')

## End(Not run)

Get Behaviour Report

Description

Retrieves a specific behaviour report from a sandbox analysis.

Usage

get_behaviour_report(sandbox_id = NULL, ...)

Arguments

sandbox_id

Sandbox report ID (character string). Required.

...

Additional arguments passed to virustotal_GET.

Value

list containing detailed behaviour report from the sandbox

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key, get_file_behaviours for listing all behaviour reports

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_behaviour_report(sandbox_id='hash_sandboxname')

## End(Not run)

Retrieve comments for an Internet domain

Description

Retrieve comments for an Internet domain

Usage

get_domain_comments(domain = NULL, limit = NULL, cursor = NULL, ...)

Arguments

domain

domain name. String. Required.

limit

Number of entries. Integer. Optional. Default is 10.

cursor

String. Optional.

...

Additional arguments passed to virustotal_GET.

Value

list containing domain comment data including comment text, authors, dates, and any associated metadata from the VirusTotal v3.0 API

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_domain_comments("http://www.google.com")
get_domain_comments("http://www.goodsfwrfw.com") # Domain not found

## End(Not run)

Retrieve information about an Internet domain

Description

Retrieve information about an Internet domain

Usage

get_domain_info(domain = NULL, limit = NULL, cursor = NULL, ...)

Arguments

domain

domain name. String. Required.

limit

Number of entries. Integer. Optional. Default is 10.

cursor

String. Optional.

...

Additional arguments passed to virustotal_GET.

Value

named list

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')
   
get_domain_info("http://www.google.com")
get_domain_info("http://www.goodsfwrfw.com") # Domain not found

## End(Not run)

Retrieve related objects to an Internet domain

Description

Retrieve related objects to an Internet domain

Usage

get_domain_relationship(
  domain = NULL,
  relationship = "subdomains",
  limit = NULL,
  cursor = NULL,
  ...
)

Arguments

domain

domain name. String. Required.

relationship

relationship name. String. Required. Default is subdomains. For all the options see https://docs.virustotal.com/reference

limit

Number of entries. Integer. Optional. Default is 10.

cursor

String. Optional.

...

Additional arguments passed to virustotal_GET.

Value

named list

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')
   
get_domain_relationship("https://www.google.com")
get_domain_relationship("https://www.goodsfwrfw.com") # Domain not found

## End(Not run)

Retrieve votes for an Internet domain

Description

Retrieve votes for an Internet domain

Usage

get_domain_votes(domain = NULL, limit = NULL, cursor = NULL, ...)

Arguments

domain

domain name. String. Required.

limit

Number of entries. Integer. Optional. Default is 10.

cursor

String. Optional.

...

Additional arguments passed to virustotal_GET.

Value

named list

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')
   
get_domain_votes("http://www.google.com")
get_domain_votes("http://www.goodsfwrfw.com") # Domain not found

## End(Not run)

Get File Behaviour MITRE ATT&CK Trees

Description

Retrieves MITRE ATT&CK techniques observed in file behaviour reports.

Usage

get_file_behaviour_mitre_trees(hash = NULL, ...)

Arguments

hash

File hash (MD5, SHA1, or SHA256). Required.

...

Additional arguments passed to virustotal_GET.

Value

list containing MITRE ATT&CK technique mappings

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key, get_file_behaviour_summary for behaviour summary

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_file_behaviour_mitre_trees(hash='99017f6eebbac24f351415dd410d522d')

## End(Not run)

Get File Behaviour Summary

Description

Retrieves a summary of all behaviour reports for a file.

Usage

get_file_behaviour_summary(hash = NULL, ...)

Arguments

hash

File hash (MD5, SHA1, or SHA256). Required.

...

Additional arguments passed to virustotal_GET.

Value

list containing behaviour summary from all sandboxes

References

https://docs.virustotal.com/reference/file-all-behaviours-summary

See Also

set_key for setting the API key, get_file_behaviours for full behaviour reports

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_file_behaviour_summary(hash='99017f6eebbac24f351415dd410d522d')

## End(Not run)

Get File Behaviours

Description

Retrieves all behaviour reports for a file from various sandboxes.

Usage

get_file_behaviours(hash = NULL, limit = NULL, cursor = NULL, ...)

Arguments

hash

File hash (MD5, SHA1, or SHA256). Required.

limit

Number of reports to retrieve. Integer. Optional.

cursor

String for pagination. Optional.

...

Additional arguments passed to virustotal_GET.

Value

list containing behaviour reports from various sandboxes

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key, get_file_behaviour_summary for summary, get_behaviour_report for individual sandbox reports

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_file_behaviours(hash='99017f6eebbac24f351415dd410d522d')
get_file_behaviours(hash='99017f6eebbac24f351415dd410d522d', limit=5)

## End(Not run)

Retrieve comments for a file

Description

Retrieve comments for a file

Usage

get_file_comments(hash = NULL, limit = NULL, cursor = NULL, ...)

Arguments

hash

File hash (MD5, SHA1, or SHA256)

limit

Number of comments to retrieve. Integer. Optional. Default is 10.

cursor

String for pagination. Optional.

...

Additional arguments passed to virustotal_GET.

Value

list containing file comments

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_file_comments(hash='99017f6eebbac24f351415dd410d522d')

## End(Not run)

Get download URL for a file

Description

Get download URL for a file

Usage

get_file_download_url(hash = NULL, ...)

Arguments

hash

File hash (MD5, SHA1, or SHA256)

...

Additional arguments passed to virustotal_GET.

Value

list containing download URL and metadata

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_file_download_url(hash='99017f6eebbac24f351415dd410d522d')

## End(Not run)

Retrieve relationships for a file

Description

Retrieve relationships for a file

Usage

get_file_relationships(
  hash = NULL,
  relationship = NULL,
  limit = NULL,
  cursor = NULL,
  ...
)

Arguments

hash

File hash (MD5, SHA1, or SHA256)

relationship

Type of relationship: "behaviours", "bundled_files", "compression_parents", "contacted_domains", "contacted_ips", "contacted_urls", "dropped_files", "execution_parents", "itw_domains", "itw_ips", "itw_urls", "overlay_parents", "pcap_parents", "pe_resource_parents", "similar_files", "submissions"

limit

Number of relationships to retrieve. Integer. Optional. Default is 10.

cursor

String for pagination. Optional.

...

Additional arguments passed to virustotal_GET.

Value

list containing file relationships

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_file_relationships(hash='99017f6eebbac24f351415dd410d522d', 
                       relationship='contacted_domains')

## End(Not run)

Get file upload URL for large files

Description

Get a special URL for uploading files larger than 32MB to VirusTotal for analysis.

Usage

get_file_upload_url(...)

Arguments

...

Additional arguments passed to virustotal_GET.

Value

list containing upload URL and other metadata

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key, scan_file for regular file uploads

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_file_upload_url()

## End(Not run)

Retrieve votes for a file

Description

Retrieve votes for a file

Usage

get_file_votes(hash = NULL, limit = NULL, cursor = NULL, ...)

Arguments

hash

File hash (MD5, SHA1, or SHA256)

limit

Number of votes to retrieve. Integer. Optional. Default is 10.

cursor

String for pagination. Optional.

...

Additional arguments passed to virustotal_GET.

Value

list containing file votes

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_file_votes(hash='99017f6eebbac24f351415dd410d522d')

## End(Not run)

Retrieve comments for an IP address

Description

Retrieve comments for an IP address

Usage

get_ip_comments(ip = NULL, limit = NULL, cursor = NULL, ...)

Arguments

ip

IP Address. String. Required.

limit

Number of entries. Integer. Optional. Default is 10.

cursor

String. Optional.

...

Additional arguments passed to virustotal_GET.

Value

named list

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_ip_comments("64.233.160.0")

## End(Not run)

Retrieve information about an IP address

Description

Retrieves report on a given IP address.

Usage

get_ip_info(ip = NULL, limit = NULL, cursor = NULL, ...)

Arguments

ip

IP address. Required.

limit

Number of entries. Optional.

cursor

String. Optional.

...

Additional arguments passed to virustotal_GET.

Value

named list

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_ip_info("64.233.160.0")

## End(Not run)

Retrieve votes for an IP address

Description

Retrieve votes for an IP address

Usage

get_ip_votes(ip = NULL, limit = NULL, cursor = NULL, ...)

Arguments

ip

IP address. String. Required.

limit

Number of entries. Integer. Optional. Default is 10.

cursor

String. Optional.

...

Additional arguments passed to virustotal_GET.

Value

named list

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_ip_votes("64.233.160.0")

## End(Not run)

Retrieve comments for a URL

Description

Retrieve comments for a URL

Usage

get_url_comments(url_id = NULL, limit = NULL, cursor = NULL, ...)

Arguments

url_id

URL or URL ID from VirusTotal

limit

Number of comments to retrieve. Optional.

cursor

String for pagination. Optional.

...

Additional arguments passed to virustotal_GET.

Value

list containing URL comments

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_url_comments(url_id='http://www.google.com')

## End(Not run)

Retrieve relationships for a URL

Description

Retrieve relationships for a URL

Usage

get_url_relationships(
  url_id = NULL,
  relationship = NULL,
  limit = NULL,
  cursor = NULL,
  ...
)

Arguments

url_id

URL or URL ID from VirusTotal

relationship

Type of relationship. See VirusTotal docs for options.

limit

Number of relationships to retrieve. Optional.

cursor

String for pagination. Optional.

...

Additional arguments passed to virustotal_GET.

Value

list containing URL relationships

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_url_relationships(url_id='http://www.google.com',
                      relationship='communicating_files')

## End(Not run)

Retrieve votes for a URL

Description

Retrieve votes for a URL

Usage

get_url_votes(url_id = NULL, limit = NULL, cursor = NULL, ...)

Arguments

url_id

URL or URL ID from VirusTotal

limit

Number of votes to retrieve. Integer. Optional. Default is 10.

cursor

String for pagination. Optional.

...

Additional arguments passed to virustotal_GET.

Value

list containing URL votes

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

get_url_votes(url_id='http://www.google.com')

## End(Not run)

Get IP Address Report

Description

Retrieves comprehensive analysis report for an IP address, including geolocation, ASN information, DNS resolutions, and detected URLs.

Usage

ip_report(ip = NULL, ...)

Arguments

ip

a valid IPv4 or IPv6 address. Required.

...

Additional arguments passed to virustotal_GET.

Value

list containing IP analysis results including geolocation, ASN information, DNS resolutions, detected URLs, and threat intelligence

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

ip_report(ip="8.8.8.8")
ip_report(ip="2001:4860:4860::8888")

## End(Not run)

Add a comment to an Internet domain

Description

Add a comment to an Internet domain

Usage

post_domain_comments(domain = NULL, comment = NULL, ...)

Arguments

domain

domain name. Required.

comment

comment text. Required. Words starting with # become tags.

...

Additional arguments passed to virustotal_POST.

Value

named list

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

post_domain_comments(domain = "https://google.com", comment = "Great!")

## End(Not run)

Add a vote for a hostname or domain

Description

Add a vote for a hostname or domain

Usage

post_domain_votes(domain = NULL, vote = NULL, ...)

Arguments

domain

domain name. Required.

vote

vote. Required.

...

Additional arguments passed to virustotal_POST.

Value

named list

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

post_domain_votes("http://google.com", vote = "malicious")

## End(Not run)

Add a comment to a file

Description

Add a comment to a file

Usage

post_file_comments(hash = NULL, comment = NULL, ...)

Arguments

hash

File hash (MD5, SHA1, or SHA256)

comment

Comment text to add

...

Additional arguments passed to virustotal_POST.

Value

list containing response data

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

post_file_comments(hash='99017f6eebbac24f351415dd410d522d',
                   comment='This file appears to be suspicious')

## End(Not run)

Add a vote to a file

Description

Add a vote to a file

Usage

post_file_votes(hash = NULL, verdict = NULL, ...)

Arguments

hash

File hash (MD5, SHA1, or SHA256)

verdict

Vote verdict: "harmless" or "malicious"

...

Additional arguments passed to virustotal_POST.

Value

list containing response data

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

post_file_votes(hash='99017f6eebbac24f351415dd410d522d', verdict='malicious')

## End(Not run)

Add a comment to an IP address

Description

Add a comment to an IP address

Usage

post_ip_comments(ip = NULL, comment = NULL, ...)

Arguments

ip

IP address. Required.

comment

Comment. Required.

...

Additional arguments passed to virustotal_POST.

Value

named list

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

post_ip_comments(ip = "64.233.160.0", comment = "test")

## End(Not run)

Add a vote for an IP address

Description

Add a vote for an IP address

Usage

post_ip_votes(ip = NULL, vote = NULL, ...)

Arguments

ip

IP address. Required.

vote

vote. Required.

...

Additional arguments passed to virustotal_POST.

Value

named list

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

post_ip_votes(ip = "64.233.160.0", vote = "malicious")

## End(Not run)

Add a comment to a URL

Description

Add a comment to a URL

Usage

post_url_comments(url_id = NULL, comment = NULL, ...)

Arguments

url_id

URL or URL ID from VirusTotal

comment

Comment text to add

...

Additional arguments passed to virustotal_POST.

Value

list containing response data

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

post_url_comments(url_id='http://www.google.com',
                  comment='This URL appears suspicious')

## End(Not run)

Add a vote to a URL

Description

Add a vote to a URL

Usage

post_url_votes(url_id = NULL, verdict = NULL, ...)

Arguments

url_id

URL or URL ID from VirusTotal

verdict

Vote verdict: "harmless" or "malicious"

...

Additional arguments passed to virustotal_POST.

Value

list containing response data

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

post_url_votes(url_id='http://www.google.com', verdict='harmless')

## End(Not run)

Request rescan of a domain

Description

Request a new analysis of a domain already in VirusTotal's database. Returns an analysis ID for use with domain_report.

Usage

rescan_domain(domain = NULL, ...)

Arguments

domain

Domain name to rescan. Required.

...

Additional arguments passed to virustotal_POST.

Value

list containing analysis details and ID

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key, domain_report for getting reports

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

# Request rescan of a domain
rescan_domain("google.com")

## End(Not run)

Request rescan of a file

Description

Request a new analysis of a file already present in VirusTotal's database. Returns an analysis ID for use with file_report.

Usage

rescan_file(hash = NULL, ...)

Arguments

hash

File hash (MD5, SHA1, or SHA256) or file ID. Required.

...

Additional arguments passed to virustotal_POST.

Value

list containing analysis details and ID

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

rescan_file(hash='99017f6eebbac24f351415dd410d522d')

## End(Not run)

Request rescan of an IP address

Description

Request a new analysis of an IP address already in VirusTotal's database. Returns an analysis ID for use with ip_report.

Usage

rescan_ip(ip = NULL, ...)

Arguments

ip

IP address to rescan (IPv4 or IPv6). Required.

...

Additional arguments passed to virustotal_POST.

Value

list containing analysis details and ID

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key, ip_report for getting reports

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

# Request rescan of an IPv4 address
rescan_ip("8.8.8.8")

# Request rescan of an IPv6 address
rescan_ip("2001:4860:4860::8888")

## End(Not run)

Request rescan of a URL

Description

Request a new analysis of a URL already present in VirusTotal's database. Returns an analysis ID for use with url_report.

Usage

rescan_url(url_id = NULL, ...)

Arguments

url_id

URL or URL ID (base64 encoded URL without padding). Required.

...

Additional arguments passed to virustotal_POST.

Value

list containing analysis details and ID

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key, url_report for getting reports

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

# Request rescan using URL
rescan_url("http://www.google.com")

# Request rescan using URL ID
rescan_url("687474703a2f2f7777772e676f6f676c652e636f6d2f")

## End(Not run)

Submit a file for scanning

Description

Uploads a file to VirusTotal for malware analysis using the v3 API.

Usage

scan_file(file_path, ...)

Arguments

file_path

Required; Path to the file to be scanned

...

Additional arguments passed to virustotal_POST

Value

A virustotal_file_scan object with analysis ID and links

References

https://docs.virustotal.com/reference/files-scan

See Also

set_key for setting the API key, file_report for retrieving scan results

Examples

## Not run: 
# Set API key first
set_key('your_api_key_here')

# Scan a file
result <- scan_file(file_path = 'suspicious_file.exe')
print(result)

## End(Not run)

Submit URL for scanning

Description

Submit a URL for analysis. Returns analysis details including an ID that can be used to retrieve the report using url_report

Usage

scan_url(url = NULL, ...)

Arguments

url

URL to scan; string; required

...

Additional arguments passed to virustotal_POST.

Value

list containing analysis details and ID

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

scan_url("http://www.google.com")

## End(Not run)

Set VirusTotal API Key

Description

Stores your VirusTotal API key in an environment variable for use by other package functions. Get your API key from https://www.virustotal.com/.

Usage

set_key(api_key = NULL)

Arguments

api_key

VirusTotal API key (character string). Required.

Value

Invisibly returns TRUE on success

References

https://docs.virustotal.com/reference

Examples

## Not run: 
# Set your API key
set_key('your_64_character_api_key_here')

# Verify it's set
Sys.getenv("VirustotalToken")

## End(Not run)

Get URL Report

Description

Retrieve a scan report for a given URL or URL ID from VirusTotal.

Usage

url_report(url_id = NULL, ...)

Arguments

url_id

URL or URL ID from VirusTotal. String. Required.

...

Additional arguments passed to virustotal_GET.

Value

list containing URL analysis results including scan details, detection information, and metadata

References

https://docs.virustotal.com/reference

See Also

set_key for setting the API key, scan_url for submitting URLs

Examples

## Not run: 

# Before calling the function, set the API key using set_key('api_key_here')

# Get report using URL
url_report("http://www.google.com")

# Get report using URL ID (base64 encoded URL without padding)
url_report("687474703a2f2f7777772e676f6f676c652e636f6d2f")

## End(Not run)

Print package information and configuration status

Description

Print package information and configuration status

Usage

virustotal_info()

Value

Invisible NULL

See Also

Other utilities: cleanup_temp_files(), create_safe_temp_dir(), format_file_size(), is_safe_environment(), utilities, validate_vt_response(), virustotal_version()


Get package version information

Description

Get package version information

Usage

virustotal_version()

Value

Character string with package version

See Also

Other utilities: cleanup_temp_files(), create_safe_temp_dir(), format_file_size(), is_safe_environment(), utilities, validate_vt_response(), virustotal_info()