VirusTotal's email interface lets you upload files via email and receive the scan results in your mailbox. The files are uploaded as email attachments and the results can be received either as plain text or XML.
The files sent via email have a lower priority, therefore, the scan results will not always be sent back immediately. So please do not keep sending the same set of files once and over again if the results are not returned in a reasonable time frame.
Audience
Getting started
Sending and scanning files
Email interface response
This document is intended for programmers who want to write client applications that can interact with VirusTotal using SMTP.
This document assumes that you understand general networking and programming ideas. Even though code examples are built using python, any programming language of your choice can be used to interact with this API, the only requirement is support for SMTP communication.
Note that non-technical users may also read this document and make use of the VirusTotal email interface if they just want to submit files using their favourite email client.
The requirements are very simple, you just need a valid email account and a file that you wish to analyse.
If you want to automate email submissions you will also need to use some programming language and SMTP communication implementation or library.
The sending process is as follows:
If you completed these steps correctly, you will receive an email with the file scan report. The response time will vary depending on the load of the system at the moment in which the file was sent.
This process can be automated making use of a programming or scripting language. Let us see an example in python:
import smtplib from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from email import encoders from email.Utils import formatdate msg = MIMEMultipart() mfrom = 'spam-me-not@virustotal.com' mto = 'scan@virustotal.com' msg['Subject'] = 'SCAN' msg['From'] = mfrom msg['To'] = mto msg['Date'] = formatdate() # Open the file to scan in binary mode fp = open('/path/to/file', 'rb') attachment = MIMEBase('application', 'octet-stream') attachment.set_payload(fp.read()) encoders.encode_base64(attachment) attachment.add_header('Content-Disposition', 'attachment; filename="filename"') fp.close() msg.attach(attachment) # Send the email via your own SMTP server. s = smtplib.SMTP('smtp.yourserver.com') s.sendmail(mfrom, mto, msg.as_string()) s.quit()
As previously stated, the scan results will be returned as an email to the address that was specified in the FROM field of the file submission email. This is an example of the plaintext response:
Complete scanning result of "burro_coche.jpg", processed in VirusTotal at 11/08/2011 10:21:09 (CET). [ file data ] * name..: burro_coche.jpg * size..: 3896 * md5...: e9823d2e819c6051c04ea48e38ddc50f * sha1..: d037fc7ec90cbf5e34201574a62af3f4f71b6bbe * peid..: - [ scan result ] AhnLab-V3 2011.11.07.00/20111107 found nothing AntiVir 7.11.17.40/20111107 found nothing Antiy-AVL 2.0.3.7/20111108 found nothing Avast 6.0.1289.0/20111108 found nothing AVG 10.0.0.1190/20111107 found nothing BitDefender 7.2/20111108 found nothing ByteHero 1.0.0.1/20111104 found nothing CAT-QuickHeal None/20111108 found nothing ClamAV 0.97.3.0/20111108 found nothing Commtouch 5.3.2.6/20111108 found nothing Comodo 10703/20111108 found nothing DrWeb 5.0.2.03300/20111108 found nothing Emsisoft 5.1.0.11/20111108 found nothing eSafe 7.0.17.0/20111107 found nothing eTrust-Vet 36.1.8662/20111108 found nothing F-Prot 4.6.5.141/20111107 found nothing F-Secure 9.0.16440.0/20111108 found nothing Fortinet 4.3.370.0/20111108 found nothing GData 22/20111108 found nothing Ikarus T3.1.1.107.0/20111108 found nothing Jiangmin 13.0.900/20111107 found nothing K7AntiVirus 9.117.5404/20111107 found nothing Kaspersky 9.0.0.837/20111108 found nothing McAfee 5.400.0.1158/20111108 found nothing McAfee-GW-Edition 2010.1D/20111107 found nothing Microsoft 1.7801/20111108 found nothing NOD32 6609/20111108 found nothing Norman 6.07.13/20111107 found nothing nProtect 2011-11-08.01/20111108 found nothing Panda 10.0.3.5/20111107 found nothing PCTools 8.0.0.5/20111108 found nothing Prevx 3.0/20111108 found nothing Rising 23.83.01.01/20111108 found nothing Sophos 4.71.0/20111108 found nothing SUPERAntiSpyware 4.40.0.1006/20111108 found nothing Symantec 20111.2.0.82/20111108 found nothing TheHacker 6.7.0.1.339/20111108 found nothing TrendMicro 9.500.0.1008/20111108 found nothing TrendMicro-HouseCall 9.500.0.1008/20111108 found nothing VBA32 3.12.16.4/20111108 found nothing VIPRE 10996/20111108 found nothing ViRobot 2011.11.8.4761/20111108 found nothing VirusBuster 14.1.51.0/20111107 found nothing
If you requested an XML response (using the SCAN+XML subject), you will receive an email with an XML attachment similar to the following example:
<?xml version="1.0" encoding="iso-8859-1"?> <_root_> <_metadata_> <_filename_>burro_coche.jpg</_filename_> <_internalname_>burro_coche.jpg</_internalname_> <_filesize_>3896</_filesize_> <_md5_>e9823d2e819c6051c04ea48e38ddc50f</_md5_> <_sha1_>d037fc7ec90cbf5e34201574a62af3f4f71b6bbe</_sha1_> <_sha256_>c4e70920f81d1acd07bfc939e0a98a8812370549c7c81cc3ac18853366d23f92</_sha256_> <_ssdeep_>96:LahBEeLevyqgSbhKj2Vl9RStl2Xw6ZFQN/2HKU5PG2Y0:LQBOvjgKnXU/AQAHKUw0</_ssdeep_> <_goodware_>-</_goodware_> <_pdfid_>-</_pdfid_> <_date_>11/08/2011 09:46:58 (CET)</_date_> <_peid_>-</_peid_> <_peinfo_>-</_peinfo_> <_sigcheck_>publisher....: n/a copyright....: n/a product......: n/a description..: n/a original name: n/a internal name: n/a file version.: n/a comments.....: n/a signers......: - signing date.: - verified.....: Unsigned </_sigcheck_> <_exiftool_>file metadata BitsPerSample: 8 ColorComponents: 3 Comment: CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality EncodingProcess: Baseline DCT, Huffman coding FileSize: 3.8 kB FileType: JPEG ImageHeight: 93 ImageSize: 130x93 ImageWidth: 130 JFIFVersion: 1.01 MIMEType: image/jpeg ResolutionUnit: None XResolution: 1 YCbCrSubSampling: YCbCr4:2:0 (2 2) YResolution: 1 </_exiftool_> </_metadata_> <_result_> <_scan_> <_engine_>nProtect</_engine_> <_version_>2011-11-08.01</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>CAT-QuickHeal</_engine_> <_version_>None</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>McAfee</_engine_> <_version_>5.400.0.1158</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>TheHacker</_engine_> <_version_>6.7.0.1.339</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>K7AntiVirus</_engine_> <_version_>9.117.5404</_version_> <_date_>20111107</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>VirusBuster</_engine_> <_version_>14.1.51.0</_version_> <_date_>20111107</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>NOD32</_engine_> <_version_>6609</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>F-Prot</_engine_> <_version_>4.6.5.141</_version_> <_date_>20111107</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Symantec</_engine_> <_version_>20111.2.0.82</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>ByteHero</_engine_> <_version_>1.0.0.1</_version_> <_date_>20111104</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>TrendMicro-HouseCall</_engine_> <_version_>9.500.0.1008</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Avast</_engine_> <_version_>6.0.1289.0</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>eSafe</_engine_> <_version_>7.0.17.0</_version_> <_date_>20111107</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>ClamAV</_engine_> <_version_>0.97.3.0</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Kaspersky</_engine_> <_version_>9.0.0.837</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>BitDefender</_engine_> <_version_>7.2</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>ViRobot</_engine_> <_version_>2011.11.8.4760</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Sophos</_engine_> <_version_>4.71.0</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Comodo</_engine_> <_version_>10703</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>F-Secure</_engine_> <_version_>9.0.16440.0</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>DrWeb</_engine_> <_version_>5.0.2.03300</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>VIPRE</_engine_> <_version_>10996</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>AntiVir</_engine_> <_version_>7.11.17.40</_version_> <_date_>20111107</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>TrendMicro</_engine_> <_version_>9.500.0.1008</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>McAfee-GW-Edition</_engine_> <_version_>2010.1D</_version_> <_date_>20111107</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Emsisoft</_engine_> <_version_>5.1.0.11</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>eTrust-Vet</_engine_> <_version_>36.1.8661</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Jiangmin</_engine_> <_version_>13.0.900</_version_> <_date_>20111107</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Microsoft</_engine_> <_version_>1.7801</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>SUPERAntiSpyware</_engine_> <_version_>4.40.0.1006</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Prevx</_engine_> <_version_>3.0</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>GData</_engine_> <_version_>22</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Commtouch</_engine_> <_version_>5.3.2.6</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>AhnLab-V3</_engine_> <_version_>2011.11.07.00</_version_> <_date_>20111107</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>VBA32</_engine_> <_version_>None</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>PCTools</_engine_> <_version_>8.0.0.5</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Rising</_engine_> <_version_>23.83.01.01</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Ikarus</_engine_> <_version_>T3.1.1.107.0</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Fortinet</_engine_> <_version_>4.3.370.0</_version_> <_date_>20111108</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>AVG</_engine_> <_version_>10.0.0.1190</_version_> <_date_>20111107</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> <_scan_> <_engine_>Panda</_engine_> <_version_>10.0.3.5</_version_> <_date_>20111107</_date_> <_response_>-</_response_> <_notes_>None</_notes_> </_scan_> </_result_> </_root_>