
Virustotal 및 기타 서비스를 위한 온라인 해시 검사기
_________ _ _ ______ _____ ______
| | | | | \ | | | | | | \ \ | | | | \ \ /.)
| | | | | | | | | | | | | | | | | | | | /)\|
|_| |_| |_| \_|__|_| |_| |_| _|_|_ |_| |_| // /
/'" "
Online Hash Checker for Virustotal and Other Services
Florian Roth
Munin은 다양한 온라인 소스에서 유용한 정보를 검색하는 온라인 해시 검사 유틸리티입니다.
현재 버전의 Munin은 다음 서비스를 조회합니다:
기본 모드 - 파일에서 해시 읽기

usage: munin.py [-h] [-f path] [--vh search-string]
[--vhrule search-string] [-o output] [--vtwaitquota]
[--vtminav min-matches] [--limit hash-limit]
[--vhmaxage days] [-c cache-db] [-i ini-file]
[-s sample-folder] [--comment] [-p vt-comment-prefix]
[--download] [-d download_path] [--nocache] [--nocsv]
[--verifycert] [--sort] [--web] [-w port] [--cli]
[--rescan] [--debug]
Online Hash Checker
optional arguments:
-h, --help show this help message and exit
-f path File to process (hash line by line OR csv with hash
in each line - auto-detects position and comment)
--vh search-string Query Valhalla for hashes by keyword, tags, YARA
rule name, Mitre ATT&CK software (e.g. S0154),
technique (e.g. T1023) or threat group (e.g. G0049)
--vhrule search-string
Query Valhalla for hashes via rules by keyword,
tags, YARA rule name, Mitre ATT&CK software (e.g.
S0154), technique (e.g. T1023) or threat group
(e.g. G0049)
-o output Output file for results (CSV)
--vtwaitquota Do not continue if VT quota is exceeded but wait
for the next day
--vtminav min-matches
Minimum number of AV matches to query hash info
from VT"
--limit hash-limit Exit after handling this much new hashes in batch
mode (cache ignored).
--vhmaxage days Maximum age of sample on Valhalla to process
-c cache-db Name of the cache database file (default: vt-hash-
db.json)
-i ini-file Name of the ini file that holds the API keys
-s sample-folder Folder with samples to process
--comment Posts a comment for the analysed hash which
contains the comment from the log line
-p vt-comment-prefix Virustotal comment prefix
--download Enables Sample Download from Hybrid Analysis.
SHA256 of sample needed.
-d download_path Output Path for Sample Download from Hybrid
Analysis. Folder must exist
--nocache Do not use cache database file
--nocsv Do not write a CSV with the results
--verifycert Verify SSL/TLS certificates
--sort Sort the input lines
--web Run Munin as web service
-w port Web service port
--cli Run Munin in command line interface mode
--rescan Trigger a rescan of each analyzed file
--debug Debug output
pip3 install -r requirements.txt (macOS에서는 --user 추가)cp munin.ini my.ini (도움말은 API 키 얻기 섹션 참조)python munin.py -i my.ini -f munin-demo.txtVirustotal Retrohunt 결과를 처리하기 전에 줄을 정렬하여 일치하는 시그니처가 블록 단위로 확인되도록 합니다
python3 munin.py -i my.ini -f ~/Downloads/retro_hunt
샘플이 포함된 디렉터리를 처리하고 해시를 온라인에서 확인합니다
python3 munin.py -i my.ini -s ~/malware/case34
명령줄 인터페이스 모드 사용 (v0.14 신규)
python3 munin.py -i my.ini
프로필 > 내 API 키에서 공개 API 키 확인여기에서 등록: https://malshare.com/register.php
여기에서 등록: https://bazaar.abuse.ch/. 그런 다음 계정 개요에서 API 키를 찾을 수 있습니다.
프로필 > API 키 확인Authkey 값을 API 키로 사용현재 고객 또는 초청 연구원 전용
https://valhalla.nextron-systems.com/
Hashlookup CIRCL의 인스턴스는 무료로 제공되며 최선의 노력을 기준으로 제공됩니다.
--cli로 munin을 시작하고 지시를 따릅니다.
예:
python3 munin.py -i my.ini --cli
해시 값이 포함된 내용을 붙여넣고 CTRL+D를 눌러 입력을 완료합니다. 마지막 줄은 끝에 줄 바꿈이 필요합니다.
기본적으로 파일 이름에 현재 날짜가 포함된 CSV 파일이 생성됩니다.

--web으로 munin을 시작하고 선택적으로 포트 -w port를 지정합니다.
예:
python3 munin.py -i my.ini --web -w 8080
웹 서비스는 다음 URL 구성표에 문자열을 기다립니다.
http://server:port/<string>
문자열은 줄 바꿈이 없는 임의의 문자열일 수 있습니다. 예:
Emotet:1585ad28f7d1e0ca696e6c6c2f1d008a
ed01ebfbc9eb5bbea545af4d01bf5f1071661840480439c6e5babe8e080e41aa;IOC1
dc9b5e8aa6ec86db8af0a7aa897ca61db3e5f3d2e0942e319074db1aaccfdc83
결과는 다음과 같습니다:
{
"comment": "Emotet",
"commenter": "-",
"comments": "0",
"copyright": "Copyright (C) America Online, Inc. 1999 - 2004",
"description": "Utilities",
"expired": false,
"filenames": "sourcedev.exe, MISCUTIL, x8ykNnr_9WofXq7Nh_xuEzSPW.exe, jwuKBLWN681ztj6Zks.exe",
"filetype": "Win32 EXE",
"first_submitted": "2019-01-19 13:46:21 UTC ( 2 months, 2 weeks ago )",
"firstsubmission": "2019-01-19 13:46:21 UTC ( 2 months, 2 weeks ago )",
"harmless": false,
"hash": "1585ad28f7d1e0ca696e6c6c2f1d008a",
"hybrid_available": false,
"hybrid_compromised": "-",
"hybrid_date": "-",
"hybrid_score": "-",
"imphash": "2820d9bdc397f88a8a1e957e1a824482",
"last_submitted": "2019-02-27 09:44:03",
"malshare_available": false,
"md5": "1585ad28f7d1e0ca696e6c6c2f1d008a",
"misp_available": true,
"misp_events": "",
"misp_info": [],
"mssoft": false,
"origname": "-",
"positives": 48,
"rating": "malicious",
"res_color": "\u001b[41m",
"result": "48 / 64",
"revoked": false,
"sha1": "4561d0ad575d5f02fb06e062a37de15861c3bd89",
"sha256": "35e304d10d53834e3e41035d12122773c9a4d183a24e03f980ad3e6b2ecde7fa",
"signed": false,
"signer": "-",
"total": 64,
"urlhaus_available": true,
"vendor_results": {
"CrowdStrike": "win/malicious_confidence_100% (W)",
"ESET-NOD32": "a variant of Win32/Kryptik.GOUY",
"F-Secure": "Trojan.TR/AD.Emotet.pdiuu",
"GData": "Trojan.GenericKD.40960256",
"Kaspersky": "HEUR:Trojan.Win32.Generic",
"McAfee": "Emotet-FLL!1585AD28F7D1",
"Microsoft": "Trojan:Win32/Emotet.DN",
"Sophos": "Mal/Emotet-Q",
"Symantec": "Trojan.Gen.2",
"TrendMicro": "-"
},
"virus": "Microsoft: Trojan:Win32/Emotet.DN / Kaspersky: HEUR:Trojan.Win32.Generic / McAfee: Emotet-FLL!1585AD28F7D1 / CrowdStrike: win/malicious_confidence_100% (W) / ESET-NOD32: a variant of Win32/Kryptik.GOUY / Symantec: Trojan.Gen.2 / F-Secure: Trojan.TR/AD.Emotet.pdiuu / Sophos: Mal/Emotet-Q / GData: Trojan.GenericKD.40960256",
"virusbay_available": false,
"vt_positives": 48,
"vt_queried": false,
"vt_total": 64,
"vt_verbose_msg": "Scan finished, information embedded"
}
Virustotal에 대한 쿼리는 제한(throttle)되어야 합니다. 따라서 웹 서비스는 쿨다운 시간을 적용하며, 이는 15초 대기 시간에서 다른 모든 플랫폼을 처리하는 데 걸린 시간을 빼서 최소화됩니다.
cooldown_time = vt_wait_time - process_time
쿨다운 중에 요청은 다음 응답을 반환합니다:
{"status": "VT cooldown active"}
조회 캐시에 이미 있는 해시를 요청할 때는 쿨다운이 적용되지 않습니다.
Munin 호스트 및 IP 검사 스크립트(munin-host.py)는 IOC 목록의 IP 주소 및 호스트/도메인 이름에 대한 추가 정보를 검색합니다.
usage: munin-host.py [-h] [-f path] [-o output] [-m max-items] [-c cache-db]
[-i ini-file] [--nocache] [--nocsv] [--recursive]
[--download] [-d download_path] [--dups] [--noresolve]
[--ping] [--debug]
Virustotal Online Checker (IP/Domain)
optional arguments:
-h, --help show this help message and exit
-f path File to process (hash line by line OR csv with hash in
each line - auto-detects position and comment)
-o output Output file for results (CSV)
-m max-items Maximum number of items (urls, hosts, samples) to show
-c cache-db Name of the cache database file (default: vt-hosts-
db.json)
-i ini-file Name of the ini file that holds the API keys
--nocache Do not use the load the cache db (vt-check-cache.pkl)
--nocsv Do not write a CSV with the results
--recursive Process the resolved IPs as well
--download Try to download the URLs (directories with host/ip names)
-d download_path Store the downloads to the given directory
--dups Do not skip duplicate hashes
--noresolve Do not perform DNS resolve test on found domain names
--ping Perform ping check on IPs (speeds up process if many
public but internally routed IPs appear in text file)
--debug Debug output

데모 파일을 파싱하여 IP와 호스트를 추출하고, 여전히 확인 가능한 도메인만 확인하지 않고 원격 시스템에서 직접 샘플을 다운로드합니다.
python3 munin-host.py -i your-key.ini -f ./munin-hosts-demo.txt --noresolve --download
IDS 모니터링 네트워크에서 munin-host.py를 사용하면 많은 경보가 발생할 수 있습니다. munin-host.py는 악성 도메인에 대한 DNS 조회를 수행하고 악성 샘플을 다운로드하는 옵션이 있기 때문입니다.
munin-host.py 스크립트는 pycurl 모듈이 필요합니다. macOS에서 작동하게 만드는 것은 까다로울 수 있으며, 빌드 과정에서 openssl이 설치되어 있어야 합니다.
오류가 발생하면 다음을 시도해보세요 (일부 환경에서는 pip3 필요)
pip uninstall pycurl
brew update
brew reinstall openssl
export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig"
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
export PYCURL_SSL_LIBRARY=openssl
pip install pycurl --global-option="--with-openssl"
Hugin 스크립트(hugin.py)는 레트로헌트에서 반환된 모든 샘플에 대한 정보를 검색하고 표시합니다. 큰 장점은 각 샘플 요청 사이에 15초를 기다리지 않고 Virustotal API v3를 통해 전체 JSON 결과 파일을 가져오는 것입니다. 이렇게 하면 결과를 즉시 얻을 수 있습니다. 단점은 Any.run, Hybrid-Analysis, MISP 또는 Valhalla와 같은 다른 서비스가 Hugin과 함께 조회되지 않는다는 것입니다.
usage: hugin.py [-h] [-r retrohunt-name] [-i ini-file]
[--csv-path CSV_PATH] [--debug] [--no-comments]
Retrohunt Checker
optional arguments:
-h, --help show this help message and exit
-r retrohunt-name Name for the queried retrohunt
-i ini-file Name of the ini file that holds the VT API key
--csv-path CSV_PATH Write a CSV with the results
--debug Debug output
--no-comments Skip VirusTotal comments
레트로헌트를 파싱하고 결과를 CSV 파일로 내보냅니다.
python3 hugin.py -i config-with-your-key.ini -r retrohunt-123456789