for tech in techs:
      for func in self.tamper.techniques[tech]:
        for payload in self.PayloadList:
          tampered = func(payload)
          self.tamperedPayloads.append(tampered)
    # Remove duplicate payloads
    self.tamperedPayloads = list(dict.fromkeys(self.tamperedPayloads))

class IntruderPayloadGenerator(IIntruderPayloadGenerator):
  def __init__(self, extender):
    self.extender = extender
    self.payloadIndex = 0
    self.extender.generatePayloads()
  
  def hasMorePayloads(self):
    return self.payloadIndex < len(self.extender.tamperedPayloads)

  def getNextPayload(self, baseValue):
    payload = self.extender.helper.stringToBytes(self.extender.tamperedPayloads[self.payloadIndex])
    self.payloadIndex += 1
    return payload

  def reset(self):
    self.payloadIndex = 0

try:
    FixBurpExceptions()
except NameError:
    pass
Exemplo n.º 2
0
        self._currentMessage = content
        return

    def getMessage(self):
        # determine whether the user modified the deserialized data
        if (self._txtInput.isTextModified()):
            # reserialize the data
            text = self._txtInput.getText()
            input = self._extender._helpers.urlEncode(
                self._extender._helpers.base64Encode(text))

            # update the request with the new parameter value
            return self._extender._helpers.updateParameter(
                self._currentMessage,
                self._extender._helpers.buildParameter("data", input,
                                                       IParameter.PARAM_BODY))

        else:
            return self._currentMessage

    def isModified(self):

        return self._txtInput.isTextModified()

    def getSelectedData(self):

        return self._txtInput.getSelectedText()


FixBurpExceptions()  # ADDED LINE