From de84308d90876bf32f9e1fc02bbf9f13267fcbc6 Mon Sep 17 00:00:00 2001 From: Philippe Crama Date: Wed, 13 Dec 2017 08:31:40 +0100 Subject: [PATCH] Enable MD5 & SHA1: VirusTotal allows to query those hashes, too --- libexec/scoop-virustotal.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libexec/scoop-virustotal.ps1 b/libexec/scoop-virustotal.ps1 index fe73ef69d..97b484fca 100644 --- a/libexec/scoop-virustotal.ps1 +++ b/libexec/scoop-virustotal.ps1 @@ -26,8 +26,14 @@ Function Navigate-ToHash($hash) { } Function Start-VirusTotal ($h, $app) { - if ($h -match "(?[sm][hda]*[125]):.*") { - write-host -f darkred "$app uses a $($matches['algo']) hash and VirusTotal only supports SHA256" + if ($h -match "(?[^:]+):(?.*)") { + $hash = $matches["hash"] + if ($matches["algo"] -match "(md5|sha1|sha256)") { + Navigate-ToHash $hash + } + else { + write-host -f darkred "$app uses $($matches['algo']) hash and VirusTotal only supports md5, sha1 or sha256" + } } else { Navigate-ToHash $h