Version: 2.5.8 Update

This commit is contained in:
gh0stkey
2023-11-16 19:44:27 +08:00
parent 548315e163
commit 765807de6e
2 changed files with 11 additions and 30 deletions

View File

@@ -120,34 +120,15 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
public void processHttpMessage(int toolFlag, boolean messageIsRequest, IHttpRequestResponse messageInfo) { public void processHttpMessage(int toolFlag, boolean messageIsRequest, IHttpRequestResponse messageInfo) {
// 判断是否是响应且该代码作用域为REPEATER、INTRUDER、PROXY分别对应toolFlag 64、32、4 // 判断是否是响应且该代码作用域为REPEATER、INTRUDER、PROXY分别对应toolFlag 64、32、4
if (toolFlag == 64 || toolFlag == 32 || toolFlag == 4) { if (toolFlag == 64 || toolFlag == 32 || toolFlag == 4) {
byte[] content; if (!messageIsRequest) {
IHttpService iHttpService = messageInfo.getHttpService();
if (messageIsRequest) { String host = iHttpService.getHost();
content = messageInfo.getRequest();
} else {
content = messageInfo.getResponse();
}
IHttpService iHttpService = null;
String host = "";
try {
iHttpService = messageInfo.getHttpService();
host = iHttpService.getHost();
} catch (Exception ignored) {
}
if (Objects.equals(host, "")) {
host = helpers.analyzeRequest(content).getUrl().getHost();
}
List<Map<String, String>> result = null; List<Map<String, String>> result = null;
String originalColor = messageInfo.getHighlight(); String originalColor = messageInfo.getHighlight();
String originalComment = messageInfo.getComment(); String originalComment = messageInfo.getComment();
if (!messageIsRequest) {
try { try {
result = messageProcessor.processMessage(helpers, messageInfo, host, true); result = messageProcessor.processMessage(helpers, messageInfo, host, true);
@@ -167,7 +148,7 @@ public class BurpExtender implements IBurpExtender, IHttpListener, IMessageEdito
String resComment = mergeComment(allComment); String resComment = mergeComment(allComment);
messageInfo.setComment(resComment); messageInfo.setComment(resComment);
messagePanel.add(messageInfo, resComment, String.valueOf(content.length), resColor); messagePanel.add(messageInfo, resComment, resColor);
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@@ -308,13 +308,13 @@ public class MessagePanel extends AbstractTableModel implements IMessageEditorCo
return currentlyDisplayedItem.getHttpService(); return currentlyDisplayedItem.getHttpService();
} }
public void add(IHttpRequestResponse messageInfo, String comment, String length, String color) { public void add(IHttpRequestResponse messageInfo, String comment, String color) {
synchronized(log) { synchronized(log) {
IRequestInfo iRequestInfo = helpers.analyzeRequest(messageInfo); IRequestInfo iRequestInfo = helpers.analyzeRequest(messageInfo);
URL url = iRequestInfo.getUrl(); URL url = iRequestInfo.getUrl();
String method = iRequestInfo.getMethod(); String method = iRequestInfo.getMethod();
String status = String.valueOf(helpers.analyzeResponse(messageInfo.getResponse()).getStatusCode()); String status = String.valueOf(helpers.analyzeResponse(messageInfo.getResponse()).getStatusCode());
String length = String.valueOf(messageInfo.getResponse().length);
LogEntry logEntry = new LogEntry(callbacks.saveBuffersToTempFiles(messageInfo), method, url, comment, length, color, status); LogEntry logEntry = new LogEntry(callbacks.saveBuffersToTempFiles(messageInfo), method, url, comment, length, color, status);
try { try {