# 通过VirusTotal API扫描上传文件的病毒？

**URL:** https://meta.discourse.org/t/virus-scanning-of-uploaded-files-via-virustotal-api/203507
**Category:** Feature
**Created:** [2021年九月14日 11:45 UTC](https://meta.discourse.org/t/virus-scanning-of-uploaded-files-via-virustotal-api/203507 "2021-09-14T11:45:50Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Zup](https://avatars.discourse-cdn.com/v4/letter/z/c37758/32.png) [@Zup](https://meta.discourse.org/u/Zup)
#### Post date: [2021年九月14日 11:45 UTC](https://meta.discourse.org/t/virus-scanning-of-uploaded-files-via-virustotal-api/203507/1 "2021-09-14T11:45:50Z")

</div>

我意识到文件病毒扫描功能包含在付费的企业版中，但在隐私和安全日益关键的今天，免费版本是否也应该提供类似功能，以促进信息的自由共享？

我不清楚企业版防病毒软件的具体运作方式，但或许免费版本可以利用 [VirusTotal API](https://developers.virustotal.com/reference#overview) 来检查上传文件的 URL，并在其旁边显示扫描结果？

这种方法是否已被考虑过？或者是否已有我不知情的相关插件可实现类似功能？

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [2021年九月14日 14:58 UTC](https://meta.discourse.org/t/virus-scanning-of-uploaded-files-via-virustotal-api/203507/2 "2021-09-14T14:58:39Z")

</div>

我们的插件是开源的，可在此获取：[https://github.com/discourse/discourse-antivirus。它使用](https://github.com/discourse/discourse-antivirus%E3%80%82%E5%AE%83%E4%BD%BF%E7%94%A8) [ClamAV](https://www.clamav.net/)。

目前，我们仅通过企业版计划直接支持该插件，原因如下：

> [@RESOLVED - Image upload error with Discourse Antivirus](https://meta.discourse.org/t/resolved-image-upload-error-with-discourse-antivirus/169604/4?u=awesomerobot):
>
> discourse-antivirus is a very complex plugin that requires a lot of custom infrastructure and setup. I recommend you remove it unless you are comfortable debugging this kind of stuff yourself.

---

<div class="post-metadata">

### Author: ![featheredtoast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/featheredtoast/32/116994_2.png) [@featheredtoast](https://meta.discourse.org/u/featheredtoast)
#### Post date: [2021年九月20日 23:18 UTC](https://meta.discourse.org/t/virus-scanning-of-uploaded-files-via-virustotal-api/203507/3 "2021-09-20T23:18:15Z")

</div>

同意 Kris 的观点，目前除了我们的 ClamAV 集成外，我并不知道有其他相关方案。不过我也想补充一点：如果有人正在寻找一个有趣的插件项目来开始探索 Discourse 插件，那么让 Discourse 利用类似 VirusTotal API 来扫描上传文件，听起来就是一个不错的方向！

---

<div class="post-metadata">

### Author: ![A\_B](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/a_b/32/240914_2.png) [@A\_B](https://meta.discourse.org/u/A_B)
#### Post date: [2022年一月26日 09:11 UTC](https://meta.discourse.org/t/virus-scanning-of-uploaded-files-via-virustotal-api/203507/4 "2022-01-26T09:11:36Z")

</div>

> [@Zup](#):
>
> 我不知道企业防病毒软件是如何工作的，但也许免费版本可以使用 [VirusTotal API](https://developers.virustotal.com/reference#overview) 来检查上传文件的 URL，并在旁边显示扫描结果？

我希望像您这样的用户能尽早被 VirusTotal 禁止：

> 您同意您不得使用或尝试：  
> 复制、复制、更改、修改、创建衍生作品、公开展示、重新发布、上传、发布、传输、转售或以任何方式分发服务中的材料、信息或功能——包括但不限于以任何方式将服务用于防病毒/URL 扫描程序测试，或 **可能直接或间接损害、竞争或以其他方式阻碍防病毒行业/URL 扫描程序行业** 。

[https://support.virustotal.com/hc/en-us/articles/115002145529-Terms-of-Service](https://support.virustotal.com/hc/en-us/articles/115002145529-Terms-of-Service)

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2022年一月26日 09:22 UTC](https://meta.discourse.org/t/virus-scanning-of-uploaded-files-via-virustotal-api/203507/5 "2022-01-26T09:22:39Z")

</div>

> [@A\_B](#):
>
> 我希望像您这样的用户能被尽早封禁

我认为主题发起者指的是 Discourse 的企业版和免费版。

即便如此，VirusTotal 也提供了一个免费使用的 API，正如在 [Public vs Premium API](https://developers.virustotal.com/reference/public-vs-premium-api) 中所读到的：

> 另一方面，公共 API 是一组可供所有人免费使用的端点。要使用公共 API，您需要做的就是注册 VirusTotal Community 并按照“入门”中的说明获取您的 API 密钥。

我不认为这会造成任何损害。
