Metascan Upload di file in Java da Sawan K.

VirusTotal è un servizio gratuito che analizza file sospetti e gli URL e permette la rapida identificazione di virus, worm, trojan, e tutti i tipi di malware.

Attenti progetto è una API pubblica VirusTotal implementazione versione 2.0 in Java Scansione di un determinato file

SCANFILE public void () {. try { VirusTotalConfig.getConfigInstance () setVirusTotalAPIKey ("apikey");. VirustotalPublicV2 virusTotalRef = new VirustotalPublicV2Impl (); Hotel ScanInfo scanInformation = virusTotalRef.scanFile (new File ("/Users /kdesilva /Desktop /eicar.com.txt")); Hotel System.out.println ("___ ___ INFORMAZIONI SCAN"); System.out.println ("MD5: \\ t" + scanInformation.getMd5 ()); System.out.println ("Perma Link: \\ t" + scanInformation.getPermalink ()); System.out.println ("Risorsa: \\ t" + scanInformation.getResource ()); System.out.println ("Scan Data: \\ t" + scanInformation.getScanDate ()); System.out.println ("Id Scan: \\ t" + scanInformation.getScanId ()); System.out.println ("SHA1: \\ t" + scanInformation.getSha1 ()); System.out.println ("SHA256: \\ t" + scanInformation.getSha256 ()); System.out.println ("Verbose Msg: \\ t" + scanInformation.getVerboseMessage ()); System.out.println ("Codice di risposta: \\ t" + scanInformation.getResponseCode ()); System.out.println ("done."); } Catch (APIKeyNotFoundException ex) { System.err.println (+ ex.getMessage () "API Key non trovato!"); } Catch (UnsupportedEncodingException ex) { System.err.println ("Formato di codifica non supportato!" + Ex.getMessage ()); } Catch (UnauthorizedAccessException ex) { System.err.println ("non valido API Key" + ex.getMessage ()); } Catch (Exception ex) { System.err.println ("successo qualcosa di brutto!" + Ex.getMessage ()); } } Get File Scan Relazione Hotel public void getFileScanReport () { try { VirusTotalConfig.getConfigInstance () setVirusTotalAPIKey ("apikey");. VirustotalPublicV2 virusTotalRef = new VirustotalPublicV2Impl (); Hotel Risorsa String = "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f"; Rapporto FileScanReport = virusTotalRef.getScanReport (risorse); Hotel System.out.println ("MD5: \\ t" + report.getMd5 ()); System.out.println ("collegamento Perma: \\ t" + report.getPermalink ()); System.out.println ("Resourve: \\ t" + report.getResource ()); System.out.println ("Scan Data: \\ t" + report.getScanDate ()); System.out.println ("Id Scan: \\ t" + report.getScanId ()); System.out.println ("SHA1: \\ t" + report.getSha1 ()); System.out.println ("SHA256: \\ t" + report.getSha256 ()); System.out.println ("Verbose Msg: \\ t" + report.getVerboseMessage ()); System.out.println ("Codice di risposta: \\ t" + report.getResponseCode ()); System.out.println ("positivi: \\ t" + report.getPositives ()); System.out.println ("Total: \\ t" + report.getTotal ()); Hotel HashMap < stringa, VirusScanInfo > scansioni = report.getScans (); for (String chiave: scans.keySet ()) { VirusScanInfo virusInfo = scans.get (chiave); System.out.println ("Scanner:" + key); System.out.println ("\\ t \\ t resut:" + virusInfo.getResult ()); System.out.println ("\\ t \\ t Aggiornamento:" + virusInfo.getUpdate ()); System.out.println ("\\ t \\ t Version:" + virusInfo.getVersion ()); } Hotel } Catch (APIKeyNotFoundException ex) { System.err.println (+ ex.getMessage () "API Key non trovato!"); } Catch (UnsupportedEncodingException ex) { System.err.println ("Formato di codifica non supportato!" + Ex.getMessage ()); } Catch (UnauthorizedAccessException ex) { System.err.println ("non valido API Key" + ex.getMessage ()); } Catch (Exception ex) { System.err.println ("successo qualcosa di brutto!" + Ex.getMessage ()); } }

Per l'articolo completo si prega di consultare il: Come scansionare file caricati utilizzando VirusTotal Java Biblioteca