PortSwigger / burp-extensions-montoya-api-examples

Examples for using the Montoya API with Burp Suite
Other
114 stars 13 forks source link

Intruder Payloads example have a wrong #4

Open guijiu43 opened 3 months ago

guijiu43 commented 3 months ago

In MyPayloadGenerator have a litter problem.

Normally, the statement return GeneratedPayload.end(); would cause an invoke error and stop the test. However, I found that it triggers an out-of-bounds error instead. Upon reviewing the code, I noticed that private int payloadIndex; is initialized to 0, but String payload = PAYLOADS.get(payloadIndex);is called after payloadIndex++;. This means the indexing effectively starts from 1. Moreover, the boundary condition check is incorrect. Although the code runs without errors, the first test data point is skipped as a result.