Skip to content

Commit

Permalink
Migrated to Montoya API 2023.3. Extended session variables to HTTP ru…
Browse files Browse the repository at this point in the history
…les. Extended annotation handling to WebSockets. Added WebSocket context menu option.
  • Loading branch information
ddwightx committed Apr 7, 2023
1 parent 6d7f868 commit da08b4c
Show file tree
Hide file tree
Showing 40 changed files with 496 additions and 366 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ plugins {
}

group 'com.synfron.reshaper.burp'
version '2.0.0'
version '2.1.0'

targetCompatibility = '15'
sourceCompatibility = '15'
targetCompatibility = '17'
sourceCompatibility = '17'

repositories {
mavenCentral()
Expand All @@ -29,7 +29,7 @@ dependencies {
implementation 'org.jsoup:jsoup:1.15.3'
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
implementation 'net.portswigger.burp.extensions:montoya-api:0.10.1'
implementation 'net.portswigger.burp.extensions:montoya-api:2023.3'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.0'
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.14.0'
testImplementation 'org.mockito:mockito-core:4.8.0'
Expand Down
4 changes: 2 additions & 2 deletions docs/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Break - Stop Rules or then action processing

Build HTTP Message - Build an HTTP request or response message and store the full text in a variable

Comment - Add a comment to the request/response line in the HTTP history
Comment - Add a comment to the line item in the HTTP/WebSocket history

Delay - Delay further processing/sending of the HTTP/WebSocket event

Expand All @@ -52,7 +52,7 @@ Drop - Have Burp drop the connection

Evaluate - Perform operations on values

Highlight - Highlight the request/response line in the HTTP history
Highlight - Highlight the line item in the HTTP/WebSocket history

Intercept - Intercept the message in the Proxy interceptor

Expand Down
10 changes: 5 additions & 5 deletions docs/Rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ Destination Variable Name - The name of the variable to hold the built HTTP mess

### Comment

Add a comment to the request/response line in the HTTP history
Add a comment to the line item in the HTTP/WebSocket history

Availability: HTTP
Availability: HTTP, WebSocket

#### Fields

Expand Down Expand Up @@ -231,13 +231,13 @@ Y - Second value. Only available for certain operations. Supports variable tags.

### Highlight

Highlight the request/response line in the HTTP history
Highlight the line item in the HTTP/WebSocket history

Availability: HTTP
Availability: HTTP, WebSocket

#### Fields

Color - The color used to highlight the request/response line.
Color - The color used to highlight the line item.

### Intercept

Expand Down
8 changes: 4 additions & 4 deletions docs/Variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

## Custom Variables

Custom variables allow the sharing of values between Rules and are scoped at the Global, Session (WebSockets only), or Event level. Global, Session, and Event variables can be set by Thens or in the UI (Global variables only). Custom variables are only accessible within Reshaper and are readable by Whens and Thens.
Custom variables allow the sharing of values between Rules and are scoped at the Global, Session, or Event level. Global, Session, and Event variables can be set by Thens or in the UI (Global variables only). Custom variables are only accessible within Reshaper and are readable by Whens and Thens.

Event variables are shared among Rules processing a single HTTP event (either request or response).

Global variables are shared among Rules across all events for as long as the extension is loaded or until the variables are deleted. Global variables can be set to be Persistent in the Global Variables tab of Reshaper. Persistent variables will be saved and reloaded between Reshaper sessions.

Session variables are shared among Rules processing all WebSocket events within the same WebSocket connection.
Session variables are shared among Rules processing the same HTTP request and response, or all WebSocket events within the same WebSocket connection.

## Accessor Variables

Accessor variables provide access to utility functionality and data that is not strictly created by Reshaper.

Message variables provide access to event message values (e.g. Request URI).

Annotation variables process access to HTTP message annotation values (i.e. comments and highlight colors). HTTP Rules only.
Annotation variables process access to HTTP or WebSocket message annotation values (i.e. comments and highlight colors).

File variables provide access to the contents of a text file.

Expand All @@ -37,7 +37,7 @@ For example, if Global variable named `firstName` has the value `John` and varia

**Message Variable Tag (message, m):** `{{message:messageValueKey}}` or `{{message:messageValueKey:identifier}}` (e.g. `{{message:httprequesturi}}`, `{{message:httprequestheader:Host}}`). See [Message Values](MessageValues.html#)

**Annotation Variable Tag (annotation, a):** `{{annotation:comment}}` to get the current comment or `{{annotation:highlightcolor}}` to get the current highlight color of the line item in HTTP history for this event.
**Annotation Variable Tag (annotation, a):** `{{annotation:comment}}` to get the current comment or `{{annotation:highlightcolor}}` to get the current highlight color of the line item in HTTP or WebSocket history for this event.

**File Variable Tag (file, f):** `{{file:encoding:filePath}}`. Example: `{{file:utf-8:~/Documents/file.txt}}`

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/burp/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void initialize(MontoyaApi api) {
api.http().registerHttpHandler(httpConnector);
api.http().registerSessionHandlingAction(httpConnector);
api.extension().registerUnloadingHandler(this);
api.websockets().registerWebSocketCreationHandler(webSocketConnector);
api.websockets().registerWebSocketCreatedHandler(webSocketConnector);
api.userInterface().registerContextMenuItemsProvider(contextMenuHandler);
Log.get().withMessage("Reshaper started").log();

Expand Down
Loading

0 comments on commit da08b4c

Please sign in to comment.