Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed to allow highlight/comment of messages during click events

  • Loading branch information...
commit 3ab16365da26636c912a1a14dcc1118f4e8d7bd5 1 parent 1c5281f
Jamie Finnigan chair6 authored
12 hiccup/MenuItemHandler.py
View
@@ -34,12 +34,20 @@ def menuItemClicked(self, menuItemCaption, selectedMessages):
#deal with request
messages.append(Message.Message(self.global_config, 'clicked', messageReference, True,
remoteHost, remotePort, serviceIsHttps, httpMethod, url, resourceType,
- '', responseContentType, messageInfo.getRequest(), interceptAction))
+ '', responseContentType, messageInfo.getRequest(), interceptAction, messageInfo))
#and response
messages.append(Message.Message(self.global_config, 'clicked', messageReference, False,
remoteHost, remotePort, serviceIsHttps, httpMethod, url, resourceType,
- messageInfo.getStatusCode(), responseContentType, messageInfo.getResponse(), interceptAction))
+ messageInfo.getStatusCode(), responseContentType, messageInfo.getResponse(),
+ interceptAction, messageInfo))
self.plugin_manager.process_menuitem_click(menuItemCaption, messages)
+ for message in messages:
+ if message.is_highlighted():
+ self.logger.debug("need to update highlight for msg : %s" % message)
+ message['messageinfo'].setHighlight(message.get_highlight())
+ if message.is_commented():
+ self.logger.debug("need to update comment for msg : %s" % message)
+ message['messageinfo'].setComment(message.get_comment())
def set_plugin_manager(self, mgr):
self.plugin_manager = mgr
3  hiccup/Message.py
View
@@ -10,7 +10,7 @@ class Message:
def __init__(self, config, toolName, messageReference, messageIsRequest, remoteHost,
remotePort, serviceIsHttps, httpMethod, url, resourceType, statusCode,
- responseContentType, message, interceptAction):
+ responseContentType, message, interceptAction, messageInfo=None):
#create new Message object, based on data passed in from Burp
self.logger = logging.getLogger()
self.global_config = config
@@ -55,6 +55,7 @@ def __init__(self, config, toolName, messageReference, messageIsRequest, remoteH
self.message['interceptaction'] = interceptAction[0]
self.message['highlight'] = None
self.message['comment'] = None
+ self.message['messageinfo'] = messageInfo
def is_changed(self):
if (self.message['raw'].tostring() == self.message['headers'] + self.message['body']):
4 hiccup/PluginManager.py
View
@@ -165,7 +165,7 @@ def process_response(self, message):
else:
self.logger.debug("plugin '%s' is not in scope, SKIPPING" % key)
- def process_menuitem_click(self, caption, message):
+ def process_menuitem_click(self, caption, messages):
self.logger.debug("process_menuitem_click() called with caption '%s'" % caption)
self.logger.debug("current handler_map : %s" % self.global_config['internals']['handler_map'])
if (caption in self.global_config['internals']['handler_map']):
@@ -173,7 +173,7 @@ def process_menuitem_click(self, caption, message):
self.logger.debug("click '%s' maps to plugin '%s'" % (caption, pname))
if (pname in self.pluginobjs):
if (hasattr(self.pluginobjs[pname], 'process_menuitem_click') and inspect.ismethod(self.pluginobjs[pname].process_menuitem_click)):
- self.pluginobjs[pname].process_menuitem_click(caption, message)
+ self.pluginobjs[pname].process_menuitem_click(caption, messages)
else:
self.logger.error("could not process menu click, plugin '%s' has no process_menuitem_click() function" % pname)
else:
7 plugins/disabled/Highlighter.py
View
@@ -14,6 +14,7 @@ class Highlighter (BasePlugin.BasePlugin):
def __init__(self, global_config):
BasePlugin.BasePlugin.__init__(self, global_config, self.required_config, self.plugin_scope)
+ self.global_config.register_menuitem('Highlight yellow', self.plugin_name)
def process_request(self, message):
self.process_message(message)
@@ -27,3 +28,9 @@ def process_message(self, message):
message.set_highlight('cyan')
if message.body_contains('internal only'):
message.set_highlight('red')
+
+ def process_menuitem_click(self, caption, messages):
+ self.logger.debug("processing menuclick '%s'" % caption)
+ if (caption == 'Highlight yellow'):
+ for m in messages:
+ m.set_highlight('yellow')
Please sign in to comment.
Something went wrong with that request. Please try again.