The API page is | apiprecongitiveav.php |
The Crowel API is | apistatisticspider.php |
The Virus statitics API is | apistatisticvirus.php |
The Honeypot statitics API is | apistatistichack.php |
Java library to access to the API
/*
* GiesaWebFramework
* Copyright (C) Giancarlo Giesa 2007-2021
*
* areos is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* areos is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see < http://www.gnu.org/licenses/>.
*/
package integrationwebsite;
import gbase.ArrayString;
import gbase.GString;
import gbase.InfoRet;
import gbase.InfoRetString;
import gbase.MAC;
import gbase.VFS;
import gbase.XML;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
/**
*
* @author Giancarlo Giesa
*/
public class IntegrationMultiantivirusCom {
private final String ClassName = "IntegrationMultiantivirusCom";
public static void main(String[] args) {
IntegrationMultiantivirusCom a = new IntegrationMultiantivirusCom();
InfoRet job = a.UrlAdd("https://www.test.com/", "virus", "test");
if(!job.noFault()){
System.out.println(job.getFault());
}
System.out.println("URLs("+a.GetUrls().Size()+"):\n"+a.GetUrls().toString("\n"));
System.out.println("\n");
ArrayString list = a.GetSuspects();
System.out.println("IDs "+list.toString(","));
for(int i=0;i < list.Size();i++){
System.out.println(a.GetSuspectBase64(list.Get(i)));
}
}
public InfoRet UrlAdd(String url,String category,String note){
note = URLEncoder.encode(note, StandardCharsets.UTF_8);
category = URLEncoder.encode(category, StandardCharsets.UTF_8);
url = URLEncoder.encode(url, StandardCharsets.UTF_8);
VFS vfs = new VFS();
MAC mac = new MAC(ClassName);
InfoRetString read = vfs.FileGet(mac, "https://www.multiantivirus.com/vhosts/multiantivirus/apiprecongitiveav.php?HIDEHELP=true&CMD=suspecturladd&CATEGORY="+category+"&SUSPECTED="+url+"&NOTE="+note);
XML xml = new XML(read);
if(xml.SubExist("error")){
return new InfoRet(ClassName,"UrlAdd",xml.Sub("error").toString(),false);
}else if(xml.SubExist("result")){
if(xml.Sub("result").toString().compareTo("ok")==0){
return new InfoRet();
}
}
return new InfoRet(ClassName,"UrlAdd","Unknow error, probably a network fail or a PHP error",false);
}
public ArrayString GetUrls(){
VFS vfs = new VFS();
MAC mac = new MAC(ClassName);
GString gs = new GString();
gs.GenerateUUID(1);
InfoRetString read = vfs.FileGet(mac, "https://www.multiantivirus.com/vhosts/multiantivirus/apiprecongitiveav.php?HIDEHELP=true&CMD=suspecturllist&RNDCODE="+gs.toString());
XML xml = new XML(read);
ArrayString ret;
if(xml.SubExist("list"+gs.toString())){
ret = new ArrayString(xml.Sub("list"+gs.toString()).toString(),"\n");
ret.KillEmptyOrSpace();
ret.KillDuplicies();
}else if(xml.SubExist("error")){
ret = new ArrayString(ClassName,"GetUrls",xml.Sub("error"));
}else{
ret = new ArrayString(ClassName,"GetUrls","Not answer from server",false);
}
return ret;
}
public InfoRetString GetSuspectBase64(String id){
VFS vfs = new VFS();
MAC mac = new MAC(ClassName);
InfoRetString read = vfs.FileGet(mac, "https://www.multiantivirus.com/vhosts/multiantivirus/apiprecongitiveav.php?HIDEHELP=true&CMD=suspectget&SUSPECTID="+id);
XML xml = new XML(read);
InfoRetString ret;
if(xml.SubExist("base64")){
ret = new InfoRetString(xml.Sub("base64").toString());
}else if(xml.SubExist("error")){
ret = new InfoRetString(ClassName,"GetSuspectBase64",xml.Sub("error").toString(),false);
}else{
ret = new InfoRetString(ClassName,"GetSuspectBase64","Not answer from server",false);
}
return ret;
}
public ArrayString GetSuspects(){
VFS vfs = new VFS();
MAC mac = new MAC(ClassName);
InfoRetString read = vfs.FileGet(mac, "https://www.multiantivirus.com/vhosts/multiantivirus/apiprecongitiveav.php?HIDEHELP=true&CMD=suspectlist");
XML xml = new XML(read);
ArrayString ret;
if(xml.SubExist("list")){
ret = new ArrayString(xml.Sub("list").toString(),"\n");
ret.KillEmptyOrSpace();
ret.KillDuplicies();
}else if(xml.SubExist("error")){
ret = new ArrayString(ClassName,"GetSuspects",xml.Sub("error").toString(),false);
}else{
ret = new ArrayString(ClassName,"GetSuspects","Not answer from server",false);
}
return ret;
}
}