Skip to content

Commit

Permalink
Fixed bug in replacing the edited content in a decode operation
Browse files Browse the repository at this point in the history
  • Loading branch information
mattebit committed Sep 20, 2023
1 parent 2034fea commit ecc3c84
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tool/src/main/java/migt/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ private void processMatchedMsg(MessageType msg_type,
try {
if (mainPane.act_active_op.processed_message != null) {
if (msg_type.msg_to_process_is_request) {
// 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);
} else {
messageInfo.setResponse(mainPane.act_active_op.processed_message);
Expand Down
2 changes: 1 addition & 1 deletion tool/src/main/java/migt/Tools.java
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ public static byte[] editMessageParam(IExtensionHelpers helpers,
if (!isBodyRegex) {
pattern = Pattern.compile("(?<=" + Pattern.quote(param_name) + "=)[^$\\n& ]*");
} else {
pattern = Pattern.compile(Pattern.quote(param_name));
pattern = Pattern.compile(param_name);
}

matcher = pattern.matcher(new String(messageInfo.getBody(isRequest)));
Expand Down

0 comments on commit ecc3c84

Please sign in to comment.