Thanks to Al for helping me to compile this.
For debugging (and modularity in general), be sure to separate out your logic from the file with the BurpExtender class, which is what Burp needs for the thing to work. This file should be stripped down to the bare essentials.
Install Jython obviously.
You’ll find classes you can import from Burp’s extender tab.
To import a class, use from burp import <name_here>
For example: from burp import IBurpExtender
Coding in this manner will enable you to debug with pdb using python 2 (Jython has started moving to python 3 compatibility, but isn’t there yet), and not have to rely on print statements.
You aren’t able to use a lot of libraries, which (in my opinion) is where a lot of the power of python comes from, aside from how easy it is to code in. Subsequently, if you want something like Beautiful Soup, you’re out of luck.
No package manager because you are not building a packaged executable.
apply plugin: 'java'
apply plugin: 'idea'
repositories {
mavenCentral()
}
dependencies {
compile 'net.portswigger.burp.extender:burp-extender-api:1.7.13'
}
sourceSets {
main {
java {
srcDir 'src'
}
}
}
task bigJar(type: Jar) {
baseName = project.name + '-all'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
This will allow for the generation of a jar file that’s required by Burp and includes the burp libraries.
External dependencies are great!
It’s Java.