Virus Total Hunting是一个基于VT api版本3的小工具,可以每天,每周或每月搜索有关恶意软件的报告。报告可以通过电子邮件,Slack渠道或Telegram发送。该工具还可以在cli中用于随时获取报告。默认的结果数为10,但可以在配置部分增加或减少。此工具仅适用于Virus Total Intelligence API。
报告示例
以下摘录是生成报告的示例:
__ _______ _ _ _ _
\ \ / /_ _| | | | |_ _ _ __ | |_(_)_ __ __ _
\ \ / / | | | |_| | | | | '_ \| __| | '_ \ / _` |
\ V / | | | _ | |_| | | | | |_| | | | | (_| |
\_/ |_| |_| |_|\__,_|_| |_|\__|_|_| |_|\__, |
|___/
McAfee ATR | Thomas Roccia | @fr0gger_
Get latest hunting notification from VirusTotal
Latest report from 2018-12-24 10:20:30.158831
-------------------------------------------------------------------------------------
Rule name: FancyBear_ComputraceAgent
Match date: 2018-12-24 17:38:17
SHA256: f5157e5b8afe1f79f29c947449477d13ede3d7341699256e62966474a7ee1eb5
Tags: [apt28, fancybear_computraceagent]
-------------------------------------------------------------------------------------
Rule name: Winexe_RemoteExecution
Match date: 2018-12-24 15:01:15
SHA256: 1e194647c05b0068c31cd443b5bcacc2dd41799e5d21a40e0c58adbad01c28c6
Tags: [winexe_remoteexecution, apt28]
-------------------------------------------------------------------------------------
Rule name: hatman_compiled_python: hatman
Match date: 2018-12-24 00:28:21
SHA256: 14c64fc93ae68f01989db992bf8ee47ffd33edf66223b84f3fae52f9a843a03f
Tags: [triton, hatman, hatman_compiled_python]
-------------------------------------------------------------------------------------
Rule name: Stuxnet_unpacked
Match date: 2018-12-24 15:00:00
SHA256: 86b05279bf4930ffc0c00e4fd22c8ab9e964e8d45d39bfca42e129b95dc33481
Tags: [stuxnet, stuxnet_unpacked]
-------------------------------------------------------------------------------------
Rule name: Stuxnet
Match date: 2018-12-24 14:59:59
SHA256: 86b05279bf4930ffc0c00e4fd22c8ab9e964e8d45d39bfca42e129b95dc33481
Tags: [stuxnet]
-------------------------------------------------------------------------------------
[truncated]
开始
下载脚本:git clone https://github.com/fr0gger/vthunting
然后使用API密钥和信息配置配置部分:
# Virus Total API
VTAPI = "<API_KEY>"
number_of_result = "" # 10 by default
# Email configuration
smtp_serv = "<SMTP_SERV>"
smtp_port = ""
gmail_login = "<EMAIL>"
gmail_pass = "<APP_PASS>" # pass from APP
gmail_dest = "<DEST_EMAIL>"
# Slack Bot config
SLACK_BOT_TOKEN = "<API>"
SLACK_CHANNEL = "<SLACK_CHANNEL>"
# Telegram Bot config
TOKEN = "<API>"
chat_id = "<CHAT_ID>"
配置准备就绪后,您可以运行以下文件:python vthunting.py --help
usage: vthunting.py [OPTION]
-h, --help 输出帮助信息
-r, --report 输出报告
-s, --slack_report 将报告发送到Slack
-e, --email_report 通过电子邮件发送报告
-t, --telegram_report 将报告发送给Telegram
您首先需要安装要求:pip install -r requirements.txt
VT API
从Virus Total获取您的API密钥。https://developers.virustotal.com/v3.0/reference
电子邮件配置(gmail)
要创建应用,您可以在此处找到相关文档:https://support.google.com/accounts/answer/185833
Slack Bot配置
要生成令牌,您需要转到此处并按照以下步骤操作:https://api.slack.com/custom-integrations/legacy-tokens
Telegram机器人配置
要获得令牌,您需要通过与@BotFather交谈来创建Telegram机器人,它将帮助您配置机器人并获取令牌。 获得令牌后,请访问https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates
以获取频道ID。
使用crontab配置任务计划程序
您可以使用crontab运行脚本并定期接收报告。crontab -e
以下是每天上午10:15收到报告的示例。
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user command to be executed
15 10 * * * /usr/local/bin/vthunting -r -t -e -s >> vthunt.log
*参考来源:github,由周大涛编译,转载请注明来自FreeBuf.COM