3

Recently, I need to write a custom payload generator in burp's intruder module enter image description here

Then I googled it and do as the articles from internet, but there are two interface, I don't know what to do.

enter image description here

Should I implement them both or what ?? Can anyone give me an answer??

anonymous
  • 61
  • 7

1 Answers1

2

Yes, you need to implement both to get a working generator. There is an example here. The key parts are:

class IntruderPayloadGenerator implements IIntruderPayloadGenerator
{
    ...
}

class IntruderPayloadGeneratorFactory implements IIntruderPayloadGeneratorFactory
{
    @Override
    public IIntruderPayloadGenerator createNewInstance(IIntruderAttack attack)
    {
        // return a new IIntruderPayloadGenerator to generate payloads for this attack
        return new IntruderPayloadGenerator();
    }
    ...
}

callbacks.registerIntruderPayloadGeneratorFactory(IntruderPayloadGeneratorFactory());
PortSwigger
  • 300
  • 1
  • 8