Friday, June 21, 2013

Python - Basic VirusTotal Uploader

Just my little/quick note about submitting malware sample to Be reminded that this python code is not handling an error properly. Just for quick reference.

import postfile
import sys, getopt

def main(argv):
 inputfile = sys.argv[1]
 host = ""
 mfile = inputfile
 selector = ""
 fields = [("apikey", "YOUR PUBLIC API KEY")]
 file_to_send = open(mfile, "rb").read()
 files = [("file", mfile, file_to_send)]
 json = postfile.post_multipart(host, selector, fields, files)
 print json
if __name__ == "__main__":

You can replace the 'YOUR PUBLIC API KEY' with your own key. Get it at

~ alternat0r

No comments:

Post a Comment