Skip to content
This repository has been archived by the owner on May 17, 2022. It is now read-only.

Commit

Permalink
Added highlighting for the scanner issues to now highlight the accept…
Browse files Browse the repository at this point in the history
…ed payload
  • Loading branch information
forced-request committed Dec 23, 2014
1 parent 375551d commit a2d9b45
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions burp-extender/src/burp/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ public boolean sendToDetector(String detectorUrl, IHttpRequestResponse messageIn
String responseAsString = EntityUtils.toString(response
.getEntity());

this.stdout.println("Response: " + responseAsString);

if (responseAsString.toLowerCase().contains(
BurpExtender.triggerPhrase.toLowerCase())) {
String newResponse = this.helpers
Expand All @@ -204,6 +202,25 @@ public boolean sendToDetector(String detectorUrl, IHttpRequestResponse messageIn
return vulnerable;
}

// helper method to search a response for occurrences of a literal match string
// and return a list of start/end offsets
private List<int[]> getMatches(byte[] response, byte[] match)
{
List<int[]> matches = new ArrayList<int[]>();

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;
}

@Override
public List<IScanIssue> doActiveScan(IHttpRequestResponse baseRequestResponse, IScannerInsertionPoint insertionPoint) {
IntruderPayloadGenerator payloadGenerator = new IntruderPayloadGenerator(this);
Expand All @@ -224,9 +241,7 @@ public List<IScanIssue> doActiveScan(IHttpRequestResponse baseRequestResponse, I
vulnerable = sendToDetector(this.slimerURL.getText(), messageInfo);

// Update this to actually detect matches
List<int[]> matches = new ArrayList<int[]>();
byte[] response = baseRequestResponse.getResponse();
matches.add(new int[] { 0, 1 });
List<int[]> matches = getMatches(messageInfo.getResponse(), triggerPhrase.getBytes());

if(vulnerable) {
String payloadStr = new String(payload);
Expand Down

0 comments on commit a2d9b45

Please sign in to comment.