Skip to content

Commit

Permalink
Fix empty-bucket issue
Browse files Browse the repository at this point in the history
  • Loading branch information
albinowax committed Feb 6, 2018
1 parent 4ebbebf commit 3d47012
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 3 additions & 3 deletions resources/boring_headers
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
host
user-agent
zcookie
zuser-agent
zreferer
cookie
zreferrer
zvia
zaccess-control-request-method
zorigin
Expand All @@ -25,7 +26,6 @@ if
proxy
trailer
waf-stuff-below
referrer
negotiate
javascript
action
Expand Down
6 changes: 6 additions & 0 deletions src/burp/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,11 @@ public byte[] buildBulkRequest(ArrayList<String> params) {
String merged = prepBulkParams(params);
String replaceKey = "TCZqBcS13SA8QRCpW";
byte[] built = Utilities.addOrReplaceHeader(request, replaceKey, "foo");

if (params.isEmpty() || "".equals(merged)) {
return built;
}

Iterator<String> dupeCheck= params.iterator();

while (dupeCheck.hasNext()) {
Expand All @@ -705,6 +710,7 @@ public byte[] buildBulkRequest(ArrayList<String> params) {
built = Utilities.replace(built, toReplace.getBytes(), ("old"+toReplace).getBytes());
}
}

return Utilities.setHeader(built, replaceKey, "x\r\n"+merged);
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/burp/ParamAttack.java
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,11 @@ ArrayList<String> calculatePayloads(IHttpRequestResponse baseRequestResponse, Pa


if (type == Utilities.PARAM_HEADER) {
//bonusParams.addSource("User-Agent\nCookie\nHost\n");
bonusParams.addSource("/Users/james/Dropbox/lists/favourites/request-headers.txt");
}

if (Utilities.OBSERVED) {
// int pad = params.size() % bucketSize;
// for (int i = 0; i<pad; i++) {
// params.add(Utilities.generateCanary());
// }
if (type == Utilities.PARAM_HEADER) {
params.replaceAll(x -> x.toLowerCase().replaceAll("[^a-z0-9_-]", ""));
params.replaceAll(x -> x.replaceFirst("^[_-]+", ""));
Expand Down

0 comments on commit 3d47012

Please sign in to comment.