From e3365d827a4a557e6096a41efb0fc921ce86909a Mon Sep 17 00:00:00 2001 From: Chris Long Date: Wed, 16 Sep 2020 15:46:27 -0700 Subject: [PATCH] Improve velociraptor release URL resolution The Velociraptor project sometimes creates releases that don't follow a URL convention and add a "-1" to the build number and URL. This update should help handle those cases. --- Vagrant/bootstrap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Vagrant/bootstrap.sh b/Vagrant/bootstrap.sh index 6bc6e3c..1d1cf86 100644 --- a/Vagrant/bootstrap.sh +++ b/Vagrant/bootstrap.sh @@ -399,7 +399,7 @@ install_velociraptor() { mkdir /opt/velociraptor fi echo "[$(date +%H:%M:%S)]: Attempting to determine the URL for the latest release of Velociraptor" - LATEST_VELOCIRAPTOR_LINUX_URL=$(curl -sL https://github.com/Velocidex/velociraptor/releases/latest | grep 'linux-amd64' | grep -Eo "/(?[^\"]+)" | grep amd | sed 's#^#https://github.com#g') + LATEST_VELOCIRAPTOR_LINUX_URL=$(curl -sL https://github.com/Velocidex/velociraptor/releases/latest | grep linux-amd64 | grep href | head -1 | cut -d '"' -f 2 | sed 's#^#https://github.com#g') echo "[$(date +%H:%M:%S)]: The URL for the latest release was extracted as $LATEST_VELOCIRAPTOR_LINUX_URL" echo "[$(date +%H:%M:%S)]: Attempting to download..." wget -P /opt/velociraptor --progress=bar:force "$LATEST_VELOCIRAPTOR_LINUX_URL"