From a806e19b7c24634a7f26d8fa2934bddc544efdcc Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Thu, 10 Sep 2015 23:58:58 -0700 Subject: [PATCH] Add burp wrapper function with downloader. --- dotfiles/zshrc.d/burp.zsh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 dotfiles/zshrc.d/burp.zsh diff --git a/dotfiles/zshrc.d/burp.zsh b/dotfiles/zshrc.d/burp.zsh new file mode 100644 index 0000000..409d5f6 --- /dev/null +++ b/dotfiles/zshrc.d/burp.zsh @@ -0,0 +1,29 @@ +burp() { + setopt localoptions nullglob + local NO_DOWNLOAD + local JAR + if (( ${+argv[(r)*no-download]} )) ; then + NO_DOWNLOAD=1 + shift + else + NO_DOWNLOAD=0 + fi + JAR=(${HOME}/bin/burpsuite*jar(On[1])) 2>/dev/null + if [ -z $JAR ] ; then + if (( $NO_DOWNLOAD )) ; then + echo "Not downloading, --no-download specified" >&2 + return 1 + fi + echo "Burp JAR not found in ${HOME}/bin. Attempting to download free edition." >&2 + wget -q --content-disposition --no-server-response -P ${HOME}/bin \ + https://portswigger.net/DownloadUpdate.ashx\?Product\=Free + if [ $? -ne 0 ] ; then + echo "Download failed." >&2 + return 1 + fi + burp --no-download "$@" + return $? + else + java -jar ${JAR} "$@" + fi +}