From ecc3c84c8bacf39fa96b886d13fe279e15442576 Mon Sep 17 00:00:00 2001 From: Matteo Bitussi Date: Wed, 20 Sep 2023 17:31:23 +0200 Subject: [PATCH] Fixed bug in replacing the edited content in a decode operation --- tool/src/main/java/migt/BurpExtender.java | 3 +++ tool/src/main/java/migt/Tools.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tool/src/main/java/migt/BurpExtender.java b/tool/src/main/java/migt/BurpExtender.java index 425c0fa..64fa73c 100644 --- a/tool/src/main/java/migt/BurpExtender.java +++ b/tool/src/main/java/migt/BurpExtender.java @@ -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); diff --git a/tool/src/main/java/migt/Tools.java b/tool/src/main/java/migt/Tools.java index 6a6b7f3..91ba4bd 100644 --- a/tool/src/main/java/migt/Tools.java +++ b/tool/src/main/java/migt/Tools.java @@ -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)));