Skip to content

Instantly share code, notes, and snippets.

@santrancisco
Last active April 8, 2022 14:05
Show Gist options
  • Save santrancisco/7558e139ecdd6c5a9fb2628fcca4545e to your computer and use it in GitHub Desktop.
Save santrancisco/7558e139ecdd6c5a9fb2628fcca4545e to your computer and use it in GitHub Desktop.
Example_jython_burp_extension
# Just color requests hitting different ports on Burp so we can easily identify which user session is which.
from burp import IBurpExtender
from burp import IProxyListener
import re
class BurpExtender(IBurpExtender, IProxyListener):
# define registerExtenderCallbacks: From IBurpExtender Interface
def registerExtenderCallbacks(self, callbacks):
self._callbacks = callbacks
self._helpers = callbacks.getHelpers()
self._callbacks.setExtensionName("Proxy Coloring")
callbacks.registerProxyListener(self)
return
# IProxyListener.processProxyMessage - color it for message coming through different port.
def processProxyMessage(self, messageIsRequest, message):
colors = ['gray','magenta','red', 'orange', 'blue' , 'green', 'cyan', 'blue', 'pink','gray']
# Determine the highlighted color base of the last digit of the port number.
message.getMessageInfo().setHighlight(colors[int(message.getListenerInterface().split(':')[1])%10])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment