Skip to content

Commit

Permalink
Fix error during value probing on JSON discoveries
Browse files Browse the repository at this point in the history
  • Loading branch information
albinowax committed Sep 9, 2024
1 parent cde9095 commit 53f8afa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/burp/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -449,15 +449,15 @@ public byte[] buildBulkRequest(ArrayList<String> params) {
}
}

class JsonParamNameInsertionPoint extends ParamInsertionPoint {
class JsonParamNameInsertionPoint extends ParamNameInsertionPoint {
byte[] headers;
byte[] body;
String baseInput;
String attackID;
JsonElement root;

public JsonParamNameInsertionPoint(byte[] request, String name, String value, byte type, String attackID) {
super(request, name, value, type); // BulkUtilities.encodeJSON(value)
super(request, name, value, type, attackID);
int start = BulkUtilities.getBodyStart(request);
this.attackID = attackID;
headers = Arrays.copyOfRange(request, 0, start);
Expand Down
2 changes: 1 addition & 1 deletion src/burp/DiscoveredParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public void explore() {

canSeeCache = canSeeCache(workedAttack.getFirstRequest().getResponse());
IHttpRequestResponse scanBaseAttack = injector.probeAttack(name).getFirstRequest();
ParamNameInsertionPoint insertionPoint = (ParamNameInsertionPoint) injector.getInsertionPoint();
ParamNameInsertionPoint insertionPoint = (ParamNameInsertionPoint) injector.getInsertionPoint();
RawInsertionPoint valueInsertionPoint = insertionPoint.getValueInsertionPoint(name);

if (type == BulkUtilities.PARAM_HEADER) {
Expand Down
5 changes: 4 additions & 1 deletion src/burp/OfferHostnameOverride.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ public class OfferHostnameOverride implements ContextMenuItemsProvider {
public List<Component> provideMenuItems(ContextMenuEvent event)
{
List<Component> menuItemList = new ArrayList<>();

if (event.selectedRequestResponses().isEmpty()) {
return menuItemList;
}

HttpRequestResponse requestResponse = event.messageEditorRequestResponse().isPresent() ? event.messageEditorRequestResponse().get().requestResponse() : event.selectedRequestResponses().get(0);
String serviceHost = requestResponse.httpService().host();
String hostHeader = requestResponse.request().headerValue("host");
Expand Down

0 comments on commit 53f8afa

Please sign in to comment.