Skip to content

Instantly share code, notes, and snippets.

@jamesbcook
Created February 22, 2016 22:35
Show Gist options
  • Save jamesbcook/32cf4b9768e91fe8e7fe to your computer and use it in GitHub Desktop.
Save jamesbcook/32cf4b9768e91fe8e7fe to your computer and use it in GitHub Desktop.
#!/bin/bash
BURPFOLDER="$HOME/Documents/burp"
SAVESTATEROOT="$BURPFOLDER/burpState"
cd $BURPFOLDER
# LATESTBURP=$(ls -1 burpsuite* | tail -n 1)
LATESTBURP=$(ls -1t burp*.jar | head -n1)
echo "Running ${LATESTBURP}"
# If an argument was passed, test to see if that folder exists and set burp's autosavefolder and working directory to it
if [ $1 ]; then
if [ ! -d "$SAVESTATEROOT/$1" ]; then
echo "Creating Directory: $SAVESTATEROOT/$1"
mkdir "$SAVESTATEROOT/$1"
fi
sed -i "s|<entry\ key\=\"workingdirectory\".*|<entry\ key\=\"workingdirectory\"\ value\=\"$SAVESTATEROOT/$1\"/>|" ~/.java/.userPrefs/burp/prefs.xml
sed -i "s|<entry\ key\=\"suite.autoSaveFolder\".*|<entry\ key\=\"suite\.autoSaveFolder\"\ value\=\"$SAVESTATEROOT/$1\"/>|" ~/.java/.userPrefs/burp/prefs.xml
# testScript="tell application \"System Events\"
# set javaPrefsFile to property list file \"$HOME/Library/Preferences/com.apple.java.util.prefs.plist\"
# tell javaPrefsFile
# tell property list item \"/\"
# tell property list item \"burp/\"
# set value of property list item \"suite.autoSaveFolder\" to \"$SAVESTATEROOT/$1\"
# set value of property list item \"workingdirectory\" to \"$SAVESTATEROOT/$1\"
# end tell
# end tell
# end tell
# end tell"
# RESULTS=`osascript -e "$testScript"`;
echo "Burp Option: suite.autoSaveFolder set to $SAVESTATEROOT/$1"
echo "Burp Option: workingdirectory set to $SAVESTATEROOT/$1"
fi
# To Explain: -Djsse.enableSNIExtension=false
# Certain misconfigured websites will send an “Unrecognized Name” warning in the SSL handshake, causing Java to mishandle the connection.
# http://www.zjulian.com/mitigating-burp-suite-error-burpsuite-handshake-alert-unrecognized_name
# java -Xmx4g -classpath $LATESTBURP burp.StartBurp
# java -Djsse.enableSNIExtension=false -Xmx4g -classpath $LATESTBURP burp.StartBurp
# java -jar -Xmx8g $LATESTBURP
# Argh my .profile doesn't get loaded for scripts so this still loads the old Java
# java -Djsse.enableSNIExtension=false -Xmx4g -jar $LATESTBURP
# /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -Djsse.enableSNIExtension=false -Xmx4g -jar $LATESTBURP
# /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/java -Xmx4g -jar $LATESTBURP
java -Xmx2g -Djsse.enableSNIExtension=false -jar $LATESTBURP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment