定制 monaz/vt-php-api3 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

monaz/vt-php-api3

最新稳定版本:v0.1-beta

Composer 安装命令:

composer require monaz/vt-php-api3

包简介

The unofficial PHP client library for VirusTotal Public API v3.0

README 文档

README

This is an unofficial PHP client library for VirusTotal. With this library you can interact with the VirusTotal REST API v3 and automate your workflow quickly and efficiently.

This is an upgraded version of Virus Total Public API v2.0 PHP Wrapper.

Things you can do with this sdk:

  • Scan files and URLs
  • Get information about files, URLs, domains, etc
  • And much more ...

Installation:

Install using composer by running:

composer require monaz/vt-php-api3

Or include the following in your composer.json:

{
  "require": {
    "monaz/vt-php-api3": "dev-master"
  }
}

Then run:

composer update

Usage:

<?php
require_once 'Vendors/autoload.php';

$apiKey = 'your_api_key';

// Scan file
$fileScanner = new \Monaz\VirusTotal\File($apiKey);
$resp = $fileScanner->scan('foo.txt');
$result = $fileScanner->getReport($resp['hash']);

// Scan Url
$urlScanner = new \Monaz\VirusTotal\Url($apiKey);
$resp = $urlScanner->scan('foo.txt');
$result = $urlScanner->getReport($resp['hash']);

// Get Domain Report
$domainScanner = new \Monaz\VirusTotal\Domain($apiKey);
$result = $domainScanner->getReport("domain.com");

// Get IP Report
$ipScanner = new \Monaz\VirusTotal\Ip($apiKey);
$result = $ipScanner->getReport("1.1.1.1");
?>

Since the helper scanners does not wrap all the available VirusTotal API endpoints, we have created request helpers that you can utilize to make direct requests.

<?php
require_once 'Vendors/autoload.php';

$apiKey = 'your_api_key';

$baseClient = new \Monaz\VirusTotal\BaseClient($apiKey);

$baseClient->makePostRequest("endpoint", $payload, $type);
$baseClient->makeGetRequest("endpoint", $payload);
$baseClient->makePatchRequest("endpoint", $payload);
$baseClient->makeDeleteRequest("endpoint");
?>

The $type parameter in makePostRequest can be form_data and multipart. You can choose the required one based on VirusTotal API doc of the desired endpoint.

Contributing

Thank you for considering contributing to the library! Just fork and when you are done make an PR. Just make sure you run the tests before submitting your request.

You can run the phpunit tests using this command:

"vendor/bin/phpunit" --coverage-text --configuration phpunit.xml.dist tests

License

The library is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 482
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 2
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-04-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固