@@ -0,0 +1,1793 @@
+#!/usr/bin/env python%0A%0Afrom __future__ import print_function%0Afrom stat import *%0Aimport virustotal%0Aimport argparse%0Aimport sys%0Aimport os%0A%0A__author__ = %22Vesselin Bontchev %3Cvbontchev@yahoo.com%3E%22%0A__license__ = %22GPL%22%0A__VERSION__ = %221.00%22%0A%0Aif __name__ == %22__main__%22:%0A    parser = argparse.ArgumentParser(version=%22%25(prog)s version %22 + __VERSION__,%0A%09description=%22Queries VirusTotal for a list of hashes.%22)%0A    parser.add_argument(%22-k%22, %22--key%22, required=True, help=%22API key%22)%0A    parser.add_argument(%22-r%22, %22--rate%22, type=int, default=4, help=%22requests per minute%22)%0A    parser.add_argument(%22hashFile%22, nargs=%22+%22, help=%22file with MD5 hashes of files%22)%0A    args = parser.parse_args()%0A    stdoutIsRedirected = S_ISREG(os.fstat(sys.stdout.fileno()).st_mode)%0A    hashes = %5B%5D%0A    try:%0A        for fileArg in args.hashFile:%0A            with open(fileArg, %22r%22) as hashFile:%0A                hashes += %5Bline.split()%5B0%5D.upper() for line in hashFile%5D%0A        v = virustotal.VirusTotal(args.key, limit_per_min=args.rate)%0A        for hash in hashes:%0A            if (stdoutIsRedirected):%0A                print(%22%25s%22 %25 hash, file=sys.stderr)%0A            report = v.get(hash)%0A            if (report == None):%0A                print(%22%25s%5CtNot found!%22 %25 hash)%0A            else:%0A                report.join()%0A                assert report.done == True%0A                if (report.positives %3E 0):%0A                    for scanner, malware in report:%0A                        if (not malware is None):%0A                            print(%22%25s%5Ct%25s: %25s%22 %25 (hash, scanner%5B0%5D, malware))%0A                            break%0A                else:%0A                    print(%22%25s%5CtNot found!%22 %25 hash)%0A            sys.stdout.flush()%0A    except Exception as e:%0A        print(%22Error: %25s.%22 %25 e, file=sys.stderr)%0A        sys.exit(-1)%0A    sys.exit(0)%0A

Create vtscanhash.py