Skip to content

Commit

Permalink
SendTo のソース判定方法修正
Browse files Browse the repository at this point in the history
isayan committed Sep 3, 2024

Verified

This commit was signed with the committer’s verified signature.
adidahiya Adi Dahiya
1 parent 79835c3 commit 0780c7a
Showing 6 changed files with 43 additions and 25 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
netbeans.org-netbeans-modules-javascript2-requirejs.enabled=true
release_version_major=3.1
release_version_minor=1.2
release_version_minor=2.0
netbeans.license=mit
Binary file modified release/YaguraExtension-v3.1.jar
Binary file not shown.
37 changes: 24 additions & 13 deletions src/main/java/yagura/model/SendToExtend.java
Original file line number Diff line number Diff line change
@@ -212,7 +212,8 @@ public boolean isEnabled() {
enabled = (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_RESPONSE)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_RESPONSE);
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_RESPONSE)
|| (this.contextMenu.invocationType() == null); // Orgnaizerではnull
break;
}
case REQUEST_AND_RESPONSE_TO_FILE: {
@@ -221,14 +222,16 @@ public boolean isEnabled() {
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_RESPONSE)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_RESPONSE);
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_RESPONSE)
|| (this.contextMenu.invocationType() == null); // Orgnaizerではnull
break;
}
case REQUEST_BODY_TO_FILE:
enabled = (this.contextMenu.invocationType() == InvocationType.PROXY_HISTORY)
|| (this.contextMenu.invocationType() == InvocationType.SEARCH_RESULTS)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_REQUEST);
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_REQUEST)
|| (this.contextMenu.invocationType() == null); // Orgnaizerではnull
break;
case RESPONSE_BODY_TO_FILE: {
enabled = (this.contextMenu.invocationType() == InvocationType.PROXY_HISTORY)
@@ -246,23 +249,31 @@ public boolean isEnabled() {
case PASTE_FROM_CLIPBOARD: {
enabled = (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_RESPONSE)
|| (this.contextMenu.invocationType() == InvocationType.INTRUDER_PAYLOAD_POSITIONS);
|| (this.contextMenu.invocationType() == InvocationType.INTRUDER_PAYLOAD_POSITIONS)
|| (this.contextMenu.invocationType() == null); // Orgnaizerではnull
break;
}
case MESSAGE_INFO_COPY:
enabled = !(this.contextMenu.invocationType() == InvocationType.INTRUDER_ATTACK_RESULTS
|| this.contextMenu.invocationType() == InvocationType.PROXY_INTERCEPT
|| this.contextMenu.invocationType() == InvocationType.INTRUDER_PAYLOAD_POSITIONS
|| this.contextMenu.invocationType() == InvocationType.SCANNER_RESULTS
|| this.contextMenu.invocationType() == InvocationType.SITE_MAP_TABLE);
enabled = (this.contextMenu.invocationType() == InvocationType.PROXY_HISTORY)
|| (this.contextMenu.invocationType() == InvocationType.SEARCH_RESULTS)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_RESPONSE)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_RESPONSE)
|| (this.contextMenu.invocationType() == null); // Orgnaizerではnull
break;
case ADD_HOST_TO_INCLUDE_SCOPE:
case ADD_HOST_TO_EXCLUDE_SCOPE:
case ADD_TO_EXCLUDE_SCOPE: {
enabled = !(this.contextMenu.invocationType() == InvocationType.INTRUDER_ATTACK_RESULTS
|| this.contextMenu.invocationType() == InvocationType.INTRUDER_PAYLOAD_POSITIONS
|| this.contextMenu.invocationType() == InvocationType.SCANNER_RESULTS
|| this.contextMenu.invocationType() == InvocationType.SITE_MAP_TABLE);
enabled = (this.contextMenu.invocationType() == InvocationType.PROXY_HISTORY)
|| (this.contextMenu.invocationType() == InvocationType.SEARCH_RESULTS)
|| (this.contextMenu.invocationType() == InvocationType.SITE_MAP_TREE)
|| (this.contextMenu.invocationType() == InvocationType.SITE_MAP_TABLE)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_RESPONSE)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_RESPONSE)
|| (this.contextMenu.invocationType() == null); // Orgnaizerではnull
break;
}
default:
13 changes: 8 additions & 5 deletions src/main/java/yagura/model/SendToMultiEditor.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package yagura.model;

import burp.BurpExtension;
import extension.burp.IssueAlertEvent;
import burp.api.montoya.http.message.HttpRequestResponse;
import burp.api.montoya.ui.contextmenu.ContextMenuEvent;
@@ -27,10 +26,14 @@ public SendToMultiEditor(SendToItem item, ContextMenuEvent contextMenu) {

@Override
public boolean isEnabled() {
BurpExtension.helpers().outPrintln("invocationType:" + this.contextMenu.invocationType());
return !(this.contextMenu.invocationType() == InvocationType.SITE_MAP_TABLE
|| this.contextMenu.invocationType() == InvocationType.SITE_MAP_TABLE
|| this.contextMenu.invocationType() == InvocationType.INTRUDER_PAYLOAD_POSITIONS);
return (this.contextMenu.invocationType() == InvocationType.PROXY_HISTORY)
|| (this.contextMenu.invocationType() == InvocationType.SEARCH_RESULTS)
|| (this.contextMenu.invocationType() == InvocationType.INTRUDER_ATTACK_RESULTS)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_RESPONSE)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_RESPONSE)
|| (this.contextMenu.invocationType() == null); // Orgnaizerではnull
}

@Override
10 changes: 7 additions & 3 deletions src/main/java/yagura/model/SendToServer.java
Original file line number Diff line number Diff line change
@@ -711,9 +711,13 @@ public void menuItemClicked(String menuItemCaption, SendToMessage sendToMessage)

@Override
public boolean isEnabled() {
return !(this.contextMenu.invocationType() == InvocationType.SITE_MAP_TABLE
|| this.contextMenu.invocationType() == InvocationType.SITE_MAP_TABLE
|| this.contextMenu.invocationType() == InvocationType.INTRUDER_PAYLOAD_POSITIONS);
return (this.contextMenu.invocationType() == InvocationType.PROXY_HISTORY)
|| (this.contextMenu.invocationType() == InvocationType.SEARCH_RESULTS)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_VIEWER_RESPONSE)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_REQUEST)
|| (this.contextMenu.invocationType() == InvocationType.MESSAGE_EDITOR_RESPONSE)
|| (this.contextMenu.invocationType() == null); // Orgnaizerではnull
}

}
6 changes: 3 additions & 3 deletions src/main/java/yagura/view/GeneratePoCTab.java
Original file line number Diff line number Diff line change
@@ -716,9 +716,9 @@ private String generatePoC(GenerateCsrfParameter csrfParam) {
boolean csrfUrlencode = csrfParam.isCsrfUrlencode();
boolean csrfMultiPart = csrfParam.isCsrfMultiPart();
boolean csrfTextPlain = csrfParam.isCsrfTextPlain();
int timeOutValue = (int) csrfParam.getTimeOutValue();
int timeOutValue = csrfParam.getTimeOutValue();
String csrfEncoding = csrfParam.getCsrfEncoding();
final MontoyaApi api = BurpExtension.api();

final HttpRequestWapper wrapRequest = new HttpRequestWapper(this.httpRequestResponse.request());
// 自動判定
String contentType = wrapRequest.getEnctype();
@@ -899,7 +899,7 @@ private String generateXHRPoC(GenerateCsrfParameter csrfParam) {
boolean csrfMultiPart = csrfParam.isCsrfMultiPart();
boolean csrfTextPlain = csrfParam.isCsrfTextPlain();
String csrfEncoding = csrfParam.getCsrfEncoding();
int timeOutValue = (int) csrfParam.getTimeOutValue();
int timeOutValue = csrfParam.getTimeOutValue();
boolean csrfXHRWithXHeader = csrfParam.isCsrfXHRWithXHeader();

final HttpRequestWapper wrapRequest = new HttpRequestWapper(this.httpRequestResponse.request());

0 comments on commit 0780c7a

Please sign in to comment.