Skip to content

Commit

Permalink
Fixed bugs on jwt and message replacement
Browse files Browse the repository at this point in the history
- Sometime messages were replaced even if no edits were made on them
- There was a bug that caused the tool to not throw an error when wrong jwt edits were made
  • Loading branch information
mattebit committed Sep 22, 2023
1 parent a44f4f4 commit a0a7bb7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions tool/src/main/java/migt/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.awt.*;
import java.io.OutputStream;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Objects;

/**
Expand Down Expand Up @@ -175,9 +176,13 @@ private void processMatchedMsg(MessageType msg_type,
// TODO: fix randomly replaced messages
// sometimes the bytes of the processed message is different from the original one, but the string
// of both messages is equal
messageInfo.setRequest(mainPane.act_active_op.processed_message);
if (!Arrays.equals(message.getRequest(), mainPane.act_active_op.processed_message)) {
messageInfo.setRequest(mainPane.act_active_op.processed_message);
}
} else {
messageInfo.setResponse(mainPane.act_active_op.processed_message);
if (!Arrays.equals(message.getResponse(), mainPane.act_active_op.processed_message)) {
messageInfo.setResponse(mainPane.act_active_op.processed_message);
}
}
}
} catch (UnsupportedOperationException e) {
Expand Down
8 changes: 4 additions & 4 deletions tool/src/main/java/migt/EditOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -307,12 +307,12 @@ public void execute(List<Var> vars) throws ParsingException {
this.result = false;
return;
}
}
applicable = true;

if (sign) {
} else if (sign) {
applicable = true;
tmp_imported_api.jwt.sign = true;
tmp_imported_api.jwt.private_key_pem = jwt_private_key_pem;
} else {
throw new ParsingException("missing jwt section in Edit operation");
}

break;
Expand Down

0 comments on commit a0a7bb7

Please sign in to comment.