forked from zynga/hiccup
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Highlighter.py
29 lines (20 loc) · 987 Bytes
/
Highlighter.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Hiccup - Burp Suite Python Extensions
# Copyright 2012 Zynga Inc.
from hiccup import BasePlugin
from hiccup import SharedFunctions as shared
# highlight messages that will be visible in Burp, based on certain test results
class Highlighter (BasePlugin.BasePlugin):
plugin_scope = 'http_only'
#accepted colors : 'red', 'orange', 'yellow', 'green', 'cyan', 'blue', 'pink', 'magenta', 'gray'
def __init__(self, global_config):
BasePlugin.BasePlugin.__init__(self, global_config, self.required_config, self.plugin_scope)
def process_request(self, message):
self.process_message(message)
def process_response(self, message):
self.process_message(message)
def process_message(self, message):
self.logger.debug("processing %s" % (message))
if message.host_in_domain('google.com'):
message.set_highlight('cyan')
if message.body_contains('internal only'):
message.set_highlight('red')