我最近一直在尝试向请求中添加自定义创建的参数。
到目前为止,我的代码如下:
from burp import IBurpExtender
from burp import IContextMenuFactory
from javax.swing import JMenuItem
import sys
import os
params = []
class BurpExtender(IBurpExtender, IContextMenuFactory):
def registerExtenderCallbacks(self,callbacks):
self._helpers = callbacks.getHelpers()
callbacks.setExtensionName("Blind XSS")
callbacks.registerContextMenuFactory(self)
def createMenuItems(self, invocation):
menu= []
menu.append(JMenuItem("Try Blind XSS", None, actionPerformed= lambda x,inv=invocation:self.blindxss(inv)))
return menu
def blindxss(self,invocation):
invMessage = invocation.getSelectedMessages()
bytes_req= invMessage[0].getRequest()
string_req = invMessage[0].getRequest()
requestInfo= self._helpers.analyzeRequest(bytes_req)
test1 = requestInfo.getParameters()
response= invMessage[0].getResponse()
params = []
for p in test1:
name= p.getValue()
self.xss(name)
new_param = self._helpers.buildParameter(p.getName(), 'NEW VALUE', p.getType())
params.append(new_param)
for np in params:
invMessage[0].setRequest(self._helpers.updateParameter(bytes_req, np))
def xss(self,test):
print(test)
但是现在,我完全陷入了应该如何添加setRequest方法的问题,因为invMessage(根据我)是具有请求/响应详细信息的对象。
请帮助我使用新参数创建新请求。
谢谢