MetaScan File upload i Java af Sawan K.

VirusTotal er en gratis service, der analyserer mistænkelige filer og URL'er og letter hurtig påvisning af virus, orme, trojanere, og alle former for malware

Dette er projekt er en offentlig API VirusTotal. version 2.0 implementering i Java Scan en given fil

public void scanFile () {. prøv { VirusTotalConfig.getConfigInstance () setVirusTotalAPIKey ("APIKEY"). VirustotalPublicV2 virusTotalRef = ny VirustotalPublicV2Impl ();

ScanInfo scanInformation = virusTotalRef.scanFile (ny File ("/Brugere /kdesilva /Desktop /eicar.com.txt")), Restaurant System.out.println ("___ SCAN OPLYSNINGER ___") System.out.println ("MD5: \\ t" + scanInformation.getMd5 ()); System.out.println ("Perma Link: \\ t" + scanInformation.getPermalink ()); System.out.println ("Ressource: \\ t" + scanInformation.getResource ()); System.out.println ("Scan Dato: \\ t" + scanInformation.getScanDate ()); System.out.println ("Scan Id: \\ 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 ("Svarkode: \\ t" + scanInformation.getResponseCode ()); System.out.println ("færdig".); } Catch (APIKeyNotFoundException ex) { System.err.println ("API-nøgle ikke fundet!" + Ex.getMessage ()); } Catch (UnsupportedEncodingException ex) { System.err.println ("Ikke-understøttet Encoding Format!" + Ex.getMessage ()); } Catch (UnauthorizedAccessException ex) { System.err.println ("Ugyldig API tast" + ex.getMessage ()); } Catch (Exception ex) { System.err.println ("Noget Dårlig skete!" + Ex.getMessage ()); } } Få File Scan Rapport

public void getFileScanReport () { prøv { VirusTotalConfig.getConfigInstance () setVirusTotalAPIKey ("APIKEY"). VirustotalPublicV2 virusTotalRef = ny VirustotalPublicV2Impl ();

String ressource = "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f"; FileScanReport rapport = virusTotalRef.getScanReport (ressource), Restaurant System.out.println ("MD5: \\ t" + report.getMd5 ()); System.out.println ("Perma link: \\ t" + report.getPermalink ()); System.out.println ("Resourve: \\ t" + report.getResource ()); System.out.println ("Scan Dato: \\ t" + report.getScanDate ()); System.out.println ("Scan Id: \\ 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 ("Svarkode: \\ t" + report.getResponseCode ()); System.out.println ("positive: \\ t" + report.getPositives ()); System.out.println ("Total: \\ t" + report.getTotal ()), Restaurant HashMap < String, VirusScanInfo > scanner = report.getScans (); for (String tast: scans.keySet ()) { VirusScanInfo virusInfo = scans.get (nøgle); System.out.println ("Scanner:" + tasten); System.out.println ("\\ t \\ t resut:" + virusInfo.getResult ()); System.out.println ("\\ t \\ t Update:" + virusInfo.getUpdate ()); System.out.println ("\\ t \\ t Version:" + virusInfo.getVersion ()); }

} Catch (APIKeyNotFoundException ex) { System.err.println ("API-nøgle ikke fundet!" + Ex.getMessage ()); } Catch (UnsupportedEncodingException ex) { System.err.println ("Ikke-understøttet Encoding Format!" + Ex.getMessage ()); } Catch (UnauthorizedAccessException ex) { System.err.println ("Ugyldig API tast" + ex.getMessage ()); } Catch (Exception ex) { System.err.println ("Noget Dårlig skete!" + Ex.getMessage ()); } }

For hele artiklen skal du kontrollere: Hvordan til Scan uploaded fil ved hjælp af VirusTotal Java Bibliotek