Skip to content

Commit 7e026eb

Browse files
committedJan 17, 2021
#2 Added ability to disable the functionality to 'Surround placeholders with single quotes automatically (safe mode)' globally
1 parent 5907547 commit 7e026eb

File tree

1 file changed

+7
-1
lines changed
  • burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/models

1 file changed

+7
-1
lines changed
 

‎burp-send-to-extension/src/main/java/net/bytebutcher/burpsendtoextension/models/CommandObject.java

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package net.bytebutcher.burpsendtoextension.models;
22

3+
import burp.BurpExtender;
34
import com.google.common.collect.Lists;
45
import com.google.gson.annotations.SerializedName;
56
import net.bytebutcher.burpsendtoextension.models.placeholder.AbstractRequestResponseInfoPlaceholder;
@@ -202,8 +203,13 @@ private String replaceCommandPlaceholder(String internalPlaceHolder, List<Map<St
202203
// combine the values of all messages using the defined placeholder separator
203204
value = getValid(placeholderMap, context).stream().map(m -> m.get(internalPlaceHolder)).map(iPlaceholder -> iPlaceholder.getValue(context)).collect(Collectors.joining(((StringSeparatedPlaceholderBehaviour) getPlaceholderBehaviourList().get(messageIndex)).getSeparator()));
204205
}
206+
boolean isSafeModeActivated = BurpExtender.getConfig().isSafeModeActivated();
205207
boolean doesRequireShellEscape = placeholderMap.get(0).get(internalPlaceHolder).doesRequireShellEscape();
206-
command = command.replace(internalPlaceHolder, doesRequireShellEscape ? "'" + StringUtils.shellEscape(value) + "'" : value);
208+
if (isSafeModeActivated && doesRequireShellEscape) {
209+
command = command.replace(internalPlaceHolder, "'" + StringUtils.shellEscape(value) + "'");
210+
} else {
211+
command = command.replace(internalPlaceHolder, value);
212+
}
207213
return command;
208214
}
209215

0 commit comments

Comments
 (0)
Please sign in to comment.