Search code examples
burp

Burp extender ---- How to write a extender of intruder?


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??


Solution

  • 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());