Changeset 33708
- Timestamp:
- 2019-11-20T11:30:47+13:00 (4 years ago)
- Location:
- gs2-extensions/malware-checker/trunk/java
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
gs2-extensions/malware-checker/trunk/java/AddComment.sh
r33665 r33708 1 1 #!/bin/bash 2 2 3 java -cp target/malware-checker-1.0-SNAPSHOT-jar-with-dependencies.jar org.greenstone.virustotal.AddComment $* 3 if [ -f virustotal-key.txt ] ; then 4 apikey=`cat virustotal-key.txt` 5 fi 6 7 java -cp target/malware-checker-1.0-SNAPSHOT-jar-with-dependencies.jar org.greenstone.virustotal.AddComment $apikey $* 4 8 5 9 -
gs2-extensions/malware-checker/trunk/java/GetFileScanReport.sh
r33665 r33708 1 1 #!/bin/bash 2 2 3 java -cp target/malware-checker-1.0-SNAPSHOT-jar-with-dependencies.jar org.greenstone.virustotal.GetFileScanReport $* 3 if [ -f virustotal-key.txt ] ; then 4 apikey=`cat virustotal-key.txt` 5 fi 6 7 java -cp target/malware-checker-1.0-SNAPSHOT-jar-with-dependencies.jar org.greenstone.virustotal.GetFileScanReport $apikey $* 4 8 5 9 -
gs2-extensions/malware-checker/trunk/java/ScanFile.sh
r33665 r33708 1 1 #!/bin/bash 2 2 3 java -cp target/malware-checker-1.0-SNAPSHOT-jar-with-dependencies.jar org.greenstone.virustotal.ScanFile $* 3 if [ -f virustotal-key.txt ] ; then 4 apikey=`cat virustotal-key.txt` 5 fi 6 7 java -cp target/malware-checker-1.0-SNAPSHOT-jar-with-dependencies.jar org.greenstone.virustotal.ScanFile $apikey $* 4 8 5 9 -
gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/AddComment.java
r33664 r33708 10 10 11 11 public class AddComment { 12 13 public static void printUsage() { 14 System.err.println("Usage: AddComment api-key resource-id comment"); 15 System.exit(1); 16 } 17 12 18 public static void main(String[] args) { 19 String apiKey = null; 20 String resourceID = null; 21 String comment = null; 13 22 14 23 try { 15 VirusTotalConfig.getConfigInstance().setVirusTotalAPIKey("09311639ef4193fc22faa35d493a5bf12dc44844a55f03812e40bd1a16fd7b6f"); 24 25 if (args.length==3) { 26 apiKey = args[0]; 27 resourceID = args[1]; 28 comment = args[2]; 29 } 30 else { 31 printUsage(); 32 } 33 34 35 VirusTotalConfig.getConfigInstance().setVirusTotalAPIKey(apiKey); 16 36 VirustotalPublicV2 virusTotalRef = new VirustotalPublicV2Impl(); 17 18 String resourceID = null;19 String comment = null;20 resourceID = args[0];21 comment = args[1];22 37 23 38 GeneralResponse gRespo = virusTotalRef.makeAComment(resourceID, comment); -
gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/GetFileScanReport.java
r33664 r33708 18 18 public class GetFileScanReport { 19 19 20 public static void printUsage() { 21 System.err.println("Usage: GetFileScanReport api-key resource-id"); 22 System.exit(1); 23 } 20 24 21 25 public static void main(String[] args) { 22 26 try { 23 VirusTotalConfig.getConfigInstance().setVirusTotalAPIKey("09311639ef4193fc22faa35d493a5bf12dc44844a55f03812e40bd1a16fd7b6f"); 27 String apiKey = null; 28 String resourceID = null; 29 30 if (args.length==2) { 31 apiKey = args[0]; 32 resourceID = args[1]; 33 } 34 else { 35 printUsage(); 36 } 37 38 VirusTotalConfig.getConfigInstance().setVirusTotalAPIKey(apiKey); 24 39 VirustotalPublicV2 virusTotalRef = new VirustotalPublicV2Impl(); 25 40 26 String resourceID = null;27 resourceID = args[0];28 41 FileScanReport report = virusTotalRef.getScanReport(resourceID); 29 42 -
gs2-extensions/malware-checker/trunk/java/src/main/java/org/greenstone/virustotal/ScanFile.java
r33664 r33708 15 15 public class ScanFile { 16 16 public static void printUsage(){ 17 System.err.println("Usage: ScanFile [ all]file");17 System.err.println("Usage: ScanFile [-all] api-key file"); 18 18 System.exit(1); 19 19 } 20 20 21 21 public static void main(String[] args) { 22 String apiKey = null; 22 23 String inputFileName = null; 24 23 25 boolean printall=false; 24 if (args.length<1 || args.length> 2){26 if (args.length<1 || args.length>3){ 25 27 printUsage(); 26 28 27 29 } 28 else if(args.length==2){ 29 if(args[0].equals("all")){ 30 inputFileName = args[1]; 30 else if(args.length==3){ 31 if(args[0].equals("-all")){ 32 apiKey = args[1]; 33 inputFileName = args[2]; 31 34 printall=true; 32 35 } … … 36 39 37 40 } 38 39 else{ 40 inputFileName = args[0]; 41 else if(args.length==2){ 42 apiKey = args[0]; 43 inputFileName = args[1]; 44 } 45 else { 46 printUsage(); 41 47 } 42 48 43 49 try { 44 50 45 VirusTotalConfig.getConfigInstance().setVirusTotalAPIKey("09311639ef4193fc22faa35d493a5bf12dc44844a55f03812e40bd1a16fd7b6f"); 51 VirusTotalConfig.getConfigInstance().setVirusTotalAPIKey(apiKey); 52 46 53 VirustotalPublicV2 virusTotalRef = new VirustotalPublicV2Impl(); 47 54
Note:
See TracChangeset
for help on using the changeset viewer.