-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] scoop-virustotal is not working #4965
Comments
Good catch! Can you make a PR? |
After some investigations, Web api is now protected by a 'X-VT-Anti-Abuse-Header' headder. So even getting a simple scan result now requires a api key too. diff --git a/libexec/scoop-virustotal.ps1 b/libexec/scoop-virustotal.ps1
index b7d16cfe..9ab7dd7b 100644
--- a/libexec/scoop-virustotal.ps1
+++ b/libexec/scoop-virustotal.ps1
@@ -81,10 +81,12 @@ $explained_rate_limit_sleeping = $False
$requests = 0
Function Get-VirusTotalResult($hash, $app) {
+ $api_key = get_config virustotal_api_key
$hash = $hash.ToLower()
- $url = "https://www.virustotal.com/ui/files/$hash"
+ $url = "https://www.virustotal.com/api/v3/files/$hash"
$wc = New-Object Net.Webclient
$wc.Headers.Add('User-Agent', (Get-UserAgent))
+ $wc.Headers.Add('x-apikey', $api_key)
$result = $wc.downloadstring($url)
$stats = json_path $result '$.data.attributes.last_analysis_stats'
$malicious = json_path $stats '$.malicious' |
Can you give an example of package that asks for API key? I can still use the |
It's embarrassing that the link I provided is not even valid. It's just that the scoop code consumes the invalid url and does not throw errors. |
I have had a tested fix done. |
Bug Report
Current Behavior
It seems that this exists for a long time.
Expected Behavior
Additional context/output
Possible Solution
System details
Windows version: [e.g. 7, 8, 10]
OS architecture: [e.g. 32bit, 64bit]
PowerShell version: [output of
"$($PSVersionTable.PSVersion)"
]Additional software: [(optional) e.g. ConEmu, Git]
Scoop Configuration
//# Your configuration here
The text was updated successfully, but these errors were encountered: