The EuroCMS VirusTotal
Find out where to put this example code?? Is this a library? A Core, Module, widget? Or all of them in one??
<?php
/**
* Analyze suspicious files, domains, IPs and URLs to detect malware and other breaches, automatically share them with the security community.
*
* @param $id string SHA-256, SHA-1 or MD5 identifying the file
*
*/
// https://developers.virustotal.com/reference/file-info
class Virustotal {
private $api_key = 'your api key';
public $http_scheme = 'https';
public $http_domain = 'www.virustotal.com';
public $http_path = '/api';
public $http_api_v = 'v3';
public $http_api_header = 'x-apikey';
public function GetaFileReport($id){
// Retrieve information about a file
// endpoint https://www.virustotal.com/api/v3/files/{id}
$http_scheme = $this->http_scheme;
$http_domain = $this->http_domain;
$http_path = $this->http_path;
$http_api_v = $this->http_api_v;
$api_key = $this->api_key;
$end_point = 'files';
$url = "$http_scheme://$http_domain/$http_path/$http_api_v/$end_point/$id";
return http::GET("$url", $header="http_api_header: $api_key");
# json output
// Responses: 200, 400
}
}