计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
virustotal-security-scanner【效率与协作】Scan files and URLs using VirusTotal API via curl or Python utilities. Check hashes, upload files, and manage comments.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Interact with VirusTotal API using either standard system tools (curl) or Python utilities.
export VT_API_KEY="your-api-key-here"
CRITICAL: This skill involves sending data to VirusTotal, a public threat intelligence service.
To avoid unnecessary API calls and stay within rate limits, it is recommended to cache the JSON results locally. Use ~/.vt/ to store these reports.
# Create cache directory
mkdir -p ~/.vt
# Save a report to cache
HASH="your-file-hash"
curl --request GET \
--url "https://www.virustotal.com/api/v3/files/$HASH" \
--header "accept: application/json" \
--header "x-apikey: $VT_API_KEY" > ~/.vt/$HASH.json
# Query the cache instead of the API (if jq available)
cat ~/.vt/$HASH.json | jq '.data.attributes.last_analysis_stats'
Calculate the SHA256 hash of a file to check if it exists in VirusTotal.
# Linux
sha256sum /path/to/file
# MacOS
shasum -a 256 /path/to/file
# Windows (PowerShell)
Get-FileHash /path/to/file -Algorithm SHA256
Check if a file hash is already known to VirusTotal.
curl --request GET \
--url "https://www.virustotal.com/api/v3/files/{hash}" \
--header "accept: application/json" \
--header "x-apikey: $VT_API_KEY"
Privacy Note: Only upload files if you have the user's explicit permission.
curl --request POST \
--url "https://www.virustotal.com/api/v3/files" \
--header "accept: application/json" \
--header "x-apikey: $VT_API_KEY" \
--form "file=@/path/to/file"
First, get a unique upload URL:
curl --request GET \
--url "https://www.virustotal.com/api/v3/files/upload_url" \
--header "accept: application/json" \
--header "x-apikey: $VT_API_KEY"
Then upload to that URL:
curl --request POST \
--url "{upload_url_from_previous_step}" \
--header "accept: application/json" \
--header "x-apikey: $VT_API_KEY" \
--form "file=@/path/to/large_file"
Privacy Warning: Do NOT include PII (Personally Identifiable Information) or sensitive data in comments. Context about the file origin or downloader is useful.
curl --request GET \
--url "https://www.virustotal.com/api/v3/files/{hash}/comments?limit=10" \
--header "accept: application/json" \
--header "x-apikey: $VT_API_KEY"
curl --request POST \
--url "https://www.virustotal.com/api/v3/files/{hash}/comments" \
--header "accept: application/json" \
--header "content-type: application/json" \
--header "x-apikey: $VT_API_KEY" \
--data '{"data": {"type": "comment", "attributes": {"text": "File found in /tmp directory via downloader script."}}}'
curl --request POST \
--url "https://www.virustotal.com/api/v3/urls" \
--header "accept: application/json" \
--header "content-type: application/x-www-form-urlencoded" \
--header "x-apikey: $VT_API_KEY" \
--data "url={url_to_analyze}"
Note: The ID for a URL is usually its SHA256 hash.
curl --request GET \
--url "https://www.virustotal.com/api/v3/urls/{url_id_or_hash}" \
--header "accept: application/json" \
--header "x-apikey: $VT_API_KEY"
If system libraries are missing or you prefer Python, use the provided helper scripts.
pip install requests
python3 vt-scanner/calc_hash.py /path/to/file
vt_client.py)This script wraps the API endpoints for easier usage.
python3 vt-scanner/vt_client.py check-file {hash}
Handles both small and large file upload flows automatically.
python3 vt-scanner/vt_client.py upload-file /path/to/file
# For a file
python3 vt-scanner/vt_client.py get-comments {file_hash}
# For a URL
python3 vt-scanner/vt_client.py get-comments {url_id} --url
python3 vt-scanner/vt_client.py add-comment {id} "Your comment here"
python3 vt-scanner/vt_client.py scan-url "http://example.com"
python3 vt-scanner/vt_client.py check-url {url_id}