本文整理匯總了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
#