Burp Suite User Forum

Create new post

IMessageEditor.isMessageModified() does not detect modification

Mick | Last updated: Oct 07, 2016 01:21AM UTC

I have an extension that uses IMessageEditor.isMessageModified() to determine when a user has modified a request. This works when a user explicitly types a change, however, it does not return true after a user has right-clicked the request and selected either "Change request method" or "Change body encoding" with no keyboard interaction.

Burp User | Last updated: Apr 10, 2017 11:42PM UTC

Any update on this?

PortSwigger Agent | Last updated: Apr 13, 2017 02:50PM UTC

Apologies for the delay - we were investigating this report. Unfortunately, we've not been able to reproduce this problem. Are you able to share some extension code that illustrates the problem? You can email this to support@portswigger.net if you prefer.

Burp User | Last updated: Apr 26, 2017 01:11AM UTC

I generated a quick extension that you can demonstrate the issues with. Source code below. Repro instructions: 1) Load this extension 2) From repeater, right click a message and select "Send Request to TEST" 3) Click the TEST Tab in Burp 4) Click Button labeled "Has Request Changed?". In your extension output console, observe the answer is False 5) Right click the request in the extension and select either "Change Request Method" or "Change Body Encoding". Observe that the contents of the request have changed in the panel. 6) Click the button and observe that False is still printed to the console output. This should be True. 7) type anywhere in the request and click the button. Observe that the answer is True. Let me know if you need any other assistance in reproducing the issue. ---------------------------------------------- from burp import IBurpExtender from burp import ITab from burp import IMessageEditorController from burp import IContextMenuFactory from javax.swing import JTabbedPane; from javax.swing import JMenuItem; from javax.swing import JPanel; from javax.swing import JButton; class BurpExtender(IBurpExtender, ITab, IMessageEditorController, IContextMenuFactory): def registerExtenderCallbacks(self, callbacks): self._callbacks = callbacks callbacks.setExtensionName("TEST") self.requestViewer = None self._panel = JPanel() button = JPanel() run = JButton("Has Request Changed?", actionPerformed=self.printRequestChanged) button.add(run) self._panel.add(button) callbacks.customizeUiComponent(self._panel) callbacks.addSuiteTab(self) callbacks.registerContextMenuFactory(self) def getHttpService(self): return self._currentlyDisplayedItem.getHttpService() def getRequest(self): return self._currentlyDisplayedItem.getRequest() def getResponse(self): return self._currentlyDisplayedItem.getResponse() def getTabCaption(self): return "TEST" def getUiComponent(self): return self._panel def createMenuItems(self, invocation): def addRequestsToTab(e): for messageInfo in messages: self._currentlyDisplayedItem = self._callbacks.saveBuffersToTempFiles(messageInfo) originalTab = self.createRequestTabs(self._currentlyDisplayedItem) originalTab.setSelectedIndex(0) self._panel.add(originalTab) self._panel.revalidate() self._panel.repaint() messages = invocation.getSelectedMessages() ret = [] menuItem = JMenuItem("Send request to TEST"); menuItem.addActionListener(addRequestsToTab) ret.append(menuItem) return ret def createRequestTabs(self, requestResponse,): class RequestResponseTabbedPane(JTabbedPane): def __init__(self, requestResponse): self._requestResponse=requestResponse requestTabs = RequestResponseTabbedPane(requestResponse) self.requestViewer = self._callbacks.createMessageEditor(self, True) responseViewer = self._callbacks.createMessageEditor(self, False) requestTabs.addTab("Request", self.requestViewer.getComponent()) requestTabs.addTab("Response", responseViewer.getComponent()) self._callbacks.customizeUiComponent(requestTabs) self.requestViewer.setMessage(requestResponse.getRequest(), True) if requestResponse.getResponse(): responseViewer.setMessage(requestResponse.getResponse(), False) return requestTabs def printRequestChanged(self, e): if self.requestViewer: print self.requestViewer.isMessageModified()

Burp User | Last updated: Apr 26, 2017 01:13AM UTC

Looks like posting didn't preserve tabs. Here is a link to the POC Extension: https://pastebin.com/ug6rVi7L

PortSwigger Agent | Last updated: Apr 26, 2017 01:35PM UTC

Many thanks for this - we've now reproduced the issue. We'll get this fixed in the next update.

PortSwigger Agent | Last updated: Apr 28, 2017 01:44PM UTC

Just to let you know that we have fixed this issue in today's release (1.7.22). Thanks again for your feedback, and please let us know if you run into any other problems.

You must be an existing, logged-in customer to reply to a thread. Please email us for additional support.