def registerExtenderCallbacks(self, callbacks): """ Burp initialisation function. Gets called when the extension is loaded and is in charge of building the UI. Args: callbacks: contains a burp callbacks object, as documented here https://portswigger.net/burp/extender/api/burp/IBurpCallbacks.html """ utility.setupLogging() utility.log("Loaded Benteveo Toolbox v0.2.2") state = State() # Endpoint table models are in charge of storing and disiplaying information in tables. state.endpointTableModel = EndpointTableModel(state, callbacks) state.requestTableModel = RequestTableModel(state, callbacks) state.replacementRuleTableModel = ReplacementRuleTableModel() # ToolboxUI handles building the Swing UI. ui = ToolboxUI() splitpane = ui.buildUi(state, callbacks) # Burp callbacks, to handle interactions with Burp. callbacks.addSuiteTab(Tab(splitpane)) callbacks.registerHttpListener(HttpListener(state, callbacks)) callbacks.setExtensionName("Benteveo Toolbox") callbacks.registerExtensionStateListener(ExtensionStateListener(state)) # Periodically check for new issues and report to slack. issueChecker = IssueChecker(state, callbacks) state.timer = Timer() state.timer.scheduleAtFixedRate(issueChecker, 1000, 1000)
from java.lang import Thread from java.util import Date from java.util import Timer from java.util import TimerTask class MyTask(TimerTask): def __init__(self, message): self.message = message def run(self): print Date(self.scheduledExecutionTime()), self.message # start a new timer 'daemon' my_timer = Timer(1) # add some tasks to the time queue start_time = Date() my_timer.schedule(MyTask("Python rules!"), start_time, 1000) my_timer.schedule(MyTask("... and Java too :)"), start_time, 3000) print "Start executing the tasks at", start_time Thread.currentThread().sleep(20000)