Burp Suite User Forum

Login to post

highlight many keyword in the response

luffy | Last updated: Feb 02, 2021 02:55AM UTC

I want to mark many keyword in the response, example code: // helper method to search a response for occurrences of a literal match string // and return a list of start/end offsets // https://github.com/PortSwigger/example-scanner-checks/blob/master/java/BurpExtender.java private List<int[]> getMatches(byte[] response, byte[] match) { List<int[]> matches = new ArrayList<>(); int start = 0; while (start < response.length) { start = _helpers.indexOf(response, match, true, start, response.length); if (start == -1) break; matches.add(new int[]{start, start + match.length}); start += match.length; } return matches; } CustomScanIssue issue = new CustomScanIssue(baseRequestResponse.getHttpService(), analyzedRequest.getUrl(), new IHttpRequestResponse[]{_callbacks.applyMarkers(baseRequestResponse, new ArrayList<>(), getMatches(response, "key".getBytes()))}, DETAIL, ISSUE_TYPE, ISSUE_NAME, SEVERITY, CONFIDENCE, "", "", ""); issues.add(issue); getMatches only support one keyword??

Uthman, PortSwigger Agent | Last updated: Feb 02, 2021 09:34AM UTC

You can have multiple matches since it is a list/array. Have you looked at the implementation from line 64-78? - https://github.com/PortSwigger/example-scanner-checks/blob/2f79bd8e02feeee4b264c093c34fcf505d3e7c90/java/BurpExtender.java#L64

You need to Log in to post a reply. Or register here, for free.