-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from usdAG/develop
Release v1.3.4
- Loading branch information
Showing
49 changed files
with
969 additions
and
125 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
src/main/java/burp/MyExtensionProvidedHttpRequestEditorFormatting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package burp; | ||
|
||
import burp.api.montoya.MontoyaApi; | ||
import burp.api.montoya.core.ByteArray; | ||
import burp.api.montoya.http.message.HttpRequestResponse; | ||
import burp.api.montoya.http.message.requests.HttpRequest; | ||
import burp.api.montoya.ui.Selection; | ||
import burp.api.montoya.ui.editor.EditorOptions; | ||
import burp.api.montoya.ui.editor.RawEditor; | ||
import burp.api.montoya.ui.editor.extension.EditorCreationContext; | ||
import burp.api.montoya.ui.editor.extension.ExtensionProvidedHttpRequestEditor; | ||
import de.usd.cstchef.Utils.MessageType; | ||
import de.usd.cstchef.view.View; | ||
|
||
import java.awt.*; | ||
|
||
public class MyExtensionProvidedHttpRequestEditorFormatting implements ExtensionProvidedHttpRequestEditor | ||
{ | ||
private final RawEditor requestEditor; | ||
private HttpRequestResponse requestResponse; | ||
private final MontoyaApi api; | ||
private final View view; | ||
|
||
MyExtensionProvidedHttpRequestEditorFormatting(EditorCreationContext creationContext, View view) | ||
{ | ||
this.api = BurpUtils.getInstance().getApi(); | ||
this.view = view; | ||
requestEditor = api.userInterface().createRawEditor(EditorOptions.READ_ONLY); | ||
} | ||
|
||
@Override | ||
public HttpRequest getRequest() | ||
{ | ||
return requestResponse.request(); | ||
} | ||
|
||
@Override | ||
public void setRequestResponse(HttpRequestResponse requestResponse) | ||
{ | ||
ByteArray result = view.getFormatRecipePanel().bake(requestResponse.request().toByteArray(), MessageType.REQUEST); | ||
this.requestEditor.setContents(result); | ||
} | ||
|
||
@Override | ||
public boolean isEnabledFor(HttpRequestResponse requestResponse) | ||
{ | ||
return requestResponse.request() != null; | ||
} | ||
|
||
@Override | ||
public String caption() | ||
{ | ||
return "CSTC Formatting"; | ||
} | ||
|
||
@Override | ||
public Component uiComponent() | ||
{ | ||
return requestEditor.uiComponent(); | ||
} | ||
|
||
@Override | ||
public Selection selectedData() | ||
{ | ||
return requestEditor.selection().isPresent() ? requestEditor.selection().get() : null; | ||
} | ||
|
||
@Override | ||
public boolean isModified() | ||
{ | ||
return requestEditor.isModified(); | ||
} | ||
} |
73 changes: 73 additions & 0 deletions
73
src/main/java/burp/MyExtensionProvidedHttpResponseEditorFormatting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
package burp; | ||
|
||
import burp.api.montoya.MontoyaApi; | ||
import burp.api.montoya.core.ByteArray; | ||
import burp.api.montoya.http.message.HttpRequestResponse; | ||
import burp.api.montoya.http.message.responses.HttpResponse; | ||
import burp.api.montoya.ui.Selection; | ||
import burp.api.montoya.ui.editor.EditorOptions; | ||
import burp.api.montoya.ui.editor.RawEditor; | ||
import burp.api.montoya.ui.editor.extension.EditorCreationContext; | ||
import burp.api.montoya.ui.editor.extension.ExtensionProvidedHttpResponseEditor; | ||
import de.usd.cstchef.Utils.MessageType; | ||
import de.usd.cstchef.view.View; | ||
|
||
import java.awt.*; | ||
|
||
public class MyExtensionProvidedHttpResponseEditorFormatting implements ExtensionProvidedHttpResponseEditor | ||
{ | ||
private final RawEditor responseEditor; | ||
private HttpRequestResponse requestResponse; | ||
private final MontoyaApi api; | ||
private final View view; | ||
|
||
MyExtensionProvidedHttpResponseEditorFormatting(EditorCreationContext creationContext, View view) | ||
{ | ||
this.api = BurpUtils.getInstance().getApi(); | ||
this.view = view; | ||
responseEditor = api.userInterface().createRawEditor(EditorOptions.READ_ONLY); | ||
} | ||
|
||
@Override | ||
public HttpResponse getResponse() | ||
{ | ||
return requestResponse.response(); | ||
} | ||
|
||
@Override | ||
public void setRequestResponse(HttpRequestResponse requestResponse) | ||
{ | ||
ByteArray result = view.getFormatRecipePanel().bake(requestResponse.response().toByteArray(), MessageType.RESPONSE); | ||
this.responseEditor.setContents(result); | ||
} | ||
|
||
@Override | ||
public boolean isEnabledFor(HttpRequestResponse requestResponse) | ||
{ | ||
return requestResponse.response() != null; | ||
} | ||
|
||
@Override | ||
public String caption() | ||
{ | ||
return "CSTC Formatting"; | ||
} | ||
|
||
@Override | ||
public Component uiComponent() | ||
{ | ||
return responseEditor.uiComponent(); | ||
} | ||
|
||
@Override | ||
public Selection selectedData() | ||
{ | ||
return responseEditor.selection().isPresent() ? responseEditor.selection().get() : null; | ||
} | ||
|
||
@Override | ||
public boolean isModified() | ||
{ | ||
return responseEditor.isModified(); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/burp/MyHttpRequestEditorProviderFormatting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package burp; | ||
|
||
import burp.api.montoya.core.ToolType; | ||
import burp.api.montoya.ui.editor.extension.EditorCreationContext; | ||
import burp.api.montoya.ui.editor.extension.ExtensionProvidedHttpRequestEditor; | ||
import burp.api.montoya.ui.editor.extension.HttpRequestEditorProvider; | ||
import de.usd.cstchef.view.View; | ||
|
||
class MyHttpRequestEditorProviderFormatting implements HttpRequestEditorProvider | ||
{ | ||
private final View view; | ||
|
||
MyHttpRequestEditorProviderFormatting(View view){ | ||
this.view = view; | ||
} | ||
|
||
@Override | ||
public ExtensionProvidedHttpRequestEditor provideHttpRequestEditor(EditorCreationContext creationContext) | ||
{ | ||
// everywhere but in CSTC itself | ||
if(!creationContext.toolSource().isFromTool(ToolType.EXTENSIONS)) { | ||
return new MyExtensionProvidedHttpRequestEditorFormatting(creationContext, view); | ||
} | ||
else { | ||
return null; | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
src/main/java/burp/MyHttpResponseEditorProviderFormatting.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package burp; | ||
|
||
import burp.api.montoya.core.ToolType; | ||
import burp.api.montoya.ui.editor.extension.EditorCreationContext; | ||
import burp.api.montoya.ui.editor.extension.ExtensionProvidedHttpResponseEditor; | ||
import burp.api.montoya.ui.editor.extension.HttpResponseEditorProvider; | ||
import de.usd.cstchef.view.View; | ||
|
||
class MyHttpResponseEditorProviderFormatting implements HttpResponseEditorProvider | ||
{ | ||
private final View view; | ||
|
||
MyHttpResponseEditorProviderFormatting(View view){ | ||
this.view = view; | ||
} | ||
|
||
@Override | ||
public ExtensionProvidedHttpResponseEditor provideHttpResponseEditor(EditorCreationContext creationContext) | ||
{ | ||
// everywhere but in CSTC itself | ||
if(!creationContext.toolSource().isFromTool(ToolType.EXTENSIONS)) { | ||
return new MyExtensionProvidedHttpResponseEditorFormatting(creationContext, view); | ||
} | ||
else { | ||
return null; | ||
} | ||
} | ||
} |
Oops, something went wrong.