
Vthunting은 Virus Total 헌팅에 대한 보고서를 생성하고 이메일, Slack 또는 Telegram으로 전송하는 데 사용되는 작은 스크립트입니다.
VThunting이 이제 VirusTotal에 등재되었습니다.
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>"
# Microsoft Teams Bot config
TEAMS_CHANNEL_WEBHOOK = ""
설정이 완료되면 다음 명령어로 파일을 실행할 수 있습니다:
python vthunting.py --help
usage: vthunting.py [OPTION]
-h, --help Print this help
-r, --report Print the VT hunting report
-s, --slack_report Send the report to a Slack channel
-e, --email_report Send the report by email
-t, --telegram_report Send the report to Telegram
-m, --teams_report Send the report to Microsoft Teams
-j, --json Get full JSON report
먼저 요구 사항을 설치해야 합니다:
pip install -r requirements.txt
Virus Total에서 API 키를 받으세요. https://developers.virustotal.com/v3.0/reference
앱을 만들려면 여기 문서를 참조하세요: https://support.google.com/accounts/answer/185833
토큰을 생성하려면 여기로 이동하여 단계를 따르세요: https://api.slack.com/custom-integrations/legacy-tokens
토큰을 받으려면 @BotFather와 대화하여 Telegram 봇을 만들어야 합니다. 봇을 구성하고 토큰을 받는 데 도움을 줍니다. 토큰을 받으면 https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates를 방문하여 채널 ID를 확인하세요.
보고서를 받을 Microsoft Teams 채널에 웹후크 커넥터를 추가하세요. https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using#setting-up-a-custom-incoming-webhook
이 스크립트를 어디서나 접근하려면 확장자 없이 다음 위치로 복사하세요:
cp vthunting.py /usr/local/bin/vthunting
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
저장소를 Git 클론하고 스크립트에서 보고를 위한 API를 구성하세요. Dockerfile에 VirusTotal API를 추가하세요.
그런 다음 다음 명령어를 실행하세요:
# Build the container
docker build -t vthunting:latest .
# run the script:
docker run -t vthunting -r
이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 LICENSE.md 파일을 참조하세요.