本文整理汇总了Python中burp.IMessageEditorTab方法的典型用法代码示例。如果您正苦于以下问题:Python burp.IMessageEditorTab方法的具体用法?Python burp.IMessageEditorTab怎么用?Python burp.IMessageEditorTab使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类burp
的用法示例。
在下文中一共展示了burp.IMessageEditorTab方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: isEnabled
# 需要导入模块: import burp [as 别名]
# 或者: from burp import IMessageEditorTab [as 别名]
def isEnabled(self, content, isRequest):
"""
Check if we can enable or not the MessageEditorTab. Overrides IMessageEditorTab.
:param content: message request/response
:param isRequest: check if is request
:return: True or False depending if the request is enabled to be edited with this tab.
"""
if isRequest:
rBody = self._helpers.analyzeRequest(content)
else:
rBody = self._helpers.analyzeResponse(content)
message = content[rBody.getBodyOffset():].tostring().strip()
try:
content = json.loads(str(message))
if isinstance(content, list):
content = content[0]
return 'query' in content and \
any([content['query'].strip().startswith(qtype) for qtype in ['query', 'mutation', 'subscription', '{']])
except ValueError:
return False
示例2: setMessage
# 需要导入模块: import burp [as 别名]
# 或者: from burp import IMessageEditorTab [as 别名]
def setMessage(self, content, isRequest):
"""
Message Setter. Overrides IMessageEditorTab.
:param content: message request/response
:param isRequest: check if is request
:return: the modified body
"""
if content is not None:
r = self._helpers.analyzeRequest(content)
self._currentMessage = content
message = content[r.getBodyOffset():].tostring()
try:
self.payload_view.refresh(message)
except ValueError:
pass
示例3: getMessage
# 需要导入模块: import burp [as 别名]
# 或者: from burp import IMessageEditorTab [as 别名]
def getMessage(self):
"""
Message Getter. Overrides IMessageEditorTab.
:return: the current message
"""
if self.isModified():
try:
request_body = self.payload_view.textarea().getText()
r = self._helpers.analyzeRequest(self._currentMessage)
return self._helpers.buildHttpMessage(r.getHeaders(), request_body)
except Exception as ex:
print(ex)
return self._helpers.buildHttpMessage(r.getHeaders(), self._currentMessage[r.getBodyOffset():].tostring())
示例4: createNewInstance
# 需要导入模块: import burp [as 别名]
# 或者: from burp import IMessageEditorTab [as 别名]
def createNewInstance(self, controller, editable):
# create a new instance of our custom editor tab
return Base64InputTab(self, controller, editable)
#
# class implementing IMessageEditorTab
#
示例5: __init__
# 需要导入模块: import burp [as 别名]
# 或者: from burp import IMessageEditorTab [as 别名]
def __init__(self, extender, controller, editable):
self._extender = extender
self._editable = editable
# create an instance of Burp's text editor, to display our deserialized data
self._txtInput = extender._callbacks.createTextEditor()
self._txtInput.setEditable(editable)
return
#
# implement IMessageEditorTab
#
示例6: createNewInstance
# 需要导入模块: import burp [as 别名]
# 或者: from burp import IMessageEditorTab [as 别名]
def createNewInstance(self, controller, editable):
# create a new instance of our custom editor tab
return ProtobufHelperTab(self, controller, editable)
#
# class implementing IMessageEditorTab
#
示例7: getUiComponent
# 需要导入模块: import burp [as 别名]
# 或者: from burp import IMessageEditorTab [as 别名]
def getUiComponent(self):
"""
Get UI Component. Overrides IMessageEditorTab.
:return: UI txt component
"""
return self.payload_view.this
示例8: processHttpMessage
# 需要导入模块: import burp [as 别名]
# 或者: from burp import IMessageEditorTab [as 别名]
def processHttpMessage(self, toolFlag, messageIsRequest, messageInfo):
key = "0123456789012345"
iv = "9876543210987654"
# only process requests
if messageIsRequest:
info = getInfo(messageInfo, messageIsRequest, self._helpers)
headers = info.getHeaders()
# get the body
body = getBody(messageInfo.getRequest(), messageIsRequest, self._helpers)
# encrypt the caidao post body
encryptedBody = encryptJython(body, key, iv)
newMSG = self._helpers.buildHttpMessage(headers, encryptedBody)
messageInfo.setRequest(newMSG)
else:
info = getInfo(messageInfo.getResponse(), messageIsRequest, self._helpers)
headers = info.getHeaders()
# get the body
body = getBody(messageInfo.getResponse(), messageIsRequest, self._helpers)
# decrypt the aes body
decryptedBody = decryptJython(body, key, iv)
newMSG = self._helpers.buildHttpMessage(headers, decryptedBody)
messageInfo.setResponse(newMSG)
#
# class implementing IMessageEditorTab
#
示例9: __init__
# 需要导入模块: import burp [as 别名]
# 或者: from burp import IMessageEditorTab [as 别名]
def __init__(self, extender, controller, editable):
self._extender = extender
self._editable = editable
# Parsia: Burp helpers object
self.helpers = extender._helpers
# create an instance of Burp's text editor, to display our decrypted data
self._txtInput = extender._callbacks.createTextEditor()
self._txtInput.setEditable(editable)
#
# implement IMessageEditorTab
#