aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/tools/security/metasploit/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/tools/security/metasploit/update.sh')
-rwxr-xr-xinfra/libkookie/nixpkgs/pkgs/tools/security/metasploit/update.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/tools/security/metasploit/update.sh b/infra/libkookie/nixpkgs/pkgs/tools/security/metasploit/update.sh
new file mode 100755
index 000000000000..e4da457c6f57
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/tools/security/metasploit/update.sh
@@ -0,0 +1,17 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl bundix git libiconv libpcap libxml2 libxslt pkg-config postgresql ruby.devEnv sqlite xmlstarlet nix-update
+
+set -eu -o pipefail
+cd "$(dirname "$(readlink -f "$0")")"
+
+latest=$(curl https://github.com/rapid7/metasploit-framework/releases.atom | xmlstarlet sel -N atom="http://www.w3.org/2005/Atom" -t -m /atom:feed/atom:entry -v atom:title -n | head -n1)
+echo "Updating metasploit to $latest"
+
+sed -i "s#refs/tags/.*#refs/tags/$latest\"#" Gemfile
+
+bundler install
+bundix
+sed -i '/[ ]*dependencies =/d' gemset.nix
+
+cd "../../../../"
+nix-update metasploit --version "$latest"