Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elreydetoda/103f21b6bded5dbeade2bdef19fa5313 to your computer and use it in GitHub Desktop.
Save elreydetoda/103f21b6bded5dbeade2bdef19fa5313 to your computer and use it in GitHub Desktop.
Modifying and Building Burp Extensions Quick Reference

Quick Reference

This section is a boiled down version of everything above. It should serve as an easy reference. These steps assume you've identified and installed the correct JDK.

Modify and Re-Jar Extension

  1. Locate the jar file: Extender > Extensions > Select extension > Details. bapps\ directory is located at C:\Users\yourusername\AppData\Roaming\BurpSuite\bapps
  2. Backup the original jar file to a different folder, outside of bapps.
  3. Change extension from .jar to .zip, extract contents, delete .zip file
  4. Make your modifications
  5. Re-jar: jar cvf yourJarName.jar -C extractedContentsDirectory/ .
  6. Reload extension in Burp: Extender > Extensions, uncheck Load and check it again

Compile Extension from Source

  1. Clone or download extension source code
  2. Make your modifications, and create build location
  3. Compile source code: javac -cp "C:\Program Files\BurpSuitePro\burpsuite_pro.jar" -d buildLocation sourceCodeLocation\*.java
  4. Create Jar: jar cvf yourJarName.jar buildLocation/*.class anyOtherDependencies1 anyOtherDependencies2
  5. Load Jar into Burp: Extender > Extensions, Add, Extension type Java and locate built jar, Next, Close
  6. Disable original version of extension from BApp store
Container quick notes
podman container run --rm -v "${PWD}":/app --workdir=/app -v ~/BurpSuitePro/burpsuite_pro.jar:/burpsuite_pro.jar docker.io/java javac -cp /burpsuite_pro.jar -d . src/burp/*.java
podman container run --rm -v "${PWD}":/app --workdir=/app -v ~/BurpSuitePro/burpsuite_pro.jar:/burpsuite_pro.jar java jar cvf personalizedCollaboratorEverywhere.jar ./burp/*.class
@elreydetoda
Copy link
Author

elreydetoda commented Aug 17, 2021

for building Collaborator Everywhere ( last built commit ):

podman container run --rm -v "$PWD":/home/gradle/project -w /home/gradle/project -it docker.io/gradle:6.9 gradle fatJar
# or
docker container run --rm -v "$PWD":/home/gradle/project -w /home/gradle/project -it docker.io/gradle:6.9 gradle fatJar

Recently had to rebuild the Collaborator Everywhere plugin, because I was getting a 406 when the plugin would add the collaborator string to the User-Agent header.
So, I downloaded the source, commented out that one line and then rebuilt the project. Once rebuilt I loaded the extension manually ( after disabling the original collaborator everywhere ), and I no longer received the 406.

Also, the build would fail with the grandle:latest tag for the docker image, so that is why I bumped it down to 6.9 instead. I would get this error:

Welcome to Gradle 7.1.1!                                                                                                                                                  
                                                                                                                                                                          
Here are the highlights of this release:                                                                                                                                  
 - Faster incremental Java compilation                                                                                                                                                                                                                                                                                                              
 - Easier source set configuration in the Kotlin DSL                                                                                                                      
                                                                                                                                                                          
For more details see https://docs.gradle.org/7.1.1/release-notes.html                                                                                                     
                                                                                                                                                                                                                                                                                                                                                    
Starting a Gradle Daemon (subsequent builds will be faster)                                                                                                                                                                                                                                                                                         
                                                                                                                                                                          
FAILURE: Build failed with an exception.                                                                                                                                                                                                                                                                                                            
                                                                                                                                                                          
* Where:                                                                                                                                                                                                                                                                                                                                            
Build file '/home/gradle/project/build.gradle' line: 8                                                                                                                    
                                                                                                                                                                          
* What went wrong:                                                                                                                                                        
A problem occurred evaluating root project 'collaborator-everywhere'.                                                                                                     
> Could not find method compile() for arguments [net.portswigger.burp.extender:burp-extender-api:1.7.13] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.                                                                                                                                             
                                                                                                                                                                          
* Try:                                                                                                                                                                    
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.                      
                                                                                                                                                                          
* Get more help at https://help.gradle.org                                                                                                                                
                                                                                                                                                                          
BUILD FAILED in 2s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment