Skip to content

Commit

Permalink
SendTo のソース判定方法修正
Browse files Browse the repository at this point in the history
  • Loading branch information
isayan committed Sep 3, 2024
1 parent 79835c3 commit 0780c7a
Show file tree
Hide file tree
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
Expand Up @@ -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: {
Expand All @@ -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)
Expand All @@ -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:
Expand Down
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;
Expand All @@ -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
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/yagura/model/SendToServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Up @@ -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();
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 0780c7a

Please sign in to comment.