Skip to content

Commit

Permalink
fixed bug of message not shown in result tab
Browse files Browse the repository at this point in the history
  • Loading branch information
mattebit committed Aug 22, 2023
1 parent 046ffcf commit ee1111f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion doc/language.md
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ The Checks tag is a list of Check elements, which can be defined with:
- `is present` specifying true or false, to check whether is present or not
- `is in` the value is between a list of values
- `is not in` the value is not between a list of values
- `is subset of` used to check that a matched JSON array is a subset of the given array
- `is subset of` used to check that a matched JSON array is a subset of the given array. Is subset means that all the values in the matched array are present in the given array.

Note that you can use `check regex` OR `check` OR `check param`.

Expand Down Expand Up @@ -552,6 +552,12 @@ Note: matched array contents will always be converted to string for simplicity.
]
```

#### Note on JSON values types
When checking the value of json keys, you have to consider the type of the value.
- mig-t will convert each int or float type as string, this means that when using the check operators, you should always use a string, not an int or a double.
- checking a value that is a JSON Array is only allowed when using the `contains` or `not contains` or `is subset of` operators
- When matching a JSON Array, the values of the array are all converted to string

### Note for the active tests

If you need to do a check on an active test, you have to do a `validate` operation, which is basically an operation where you can do checks
Expand Down
3 changes: 1 addition & 2 deletions tool/src/main/java/migt/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,7 @@ private void processMatchedMsg(MessageType msg_type,
messageInfo.setHighlight("red");

mainPane.act_active_op.helpers = helpers;
mainPane.act_active_op.api.message = message;
mainPane.act_active_op.api.is_request = msg_type.msg_to_process_is_request;
mainPane.act_active_op.setAPI(new Operation_API(message, msg_type.msg_to_process_is_request));
mainPane.act_active_op.execute();

// if message has been edited inside operation update the value
Expand Down
6 changes: 5 additions & 1 deletion tool/src/main/java/migt/Operation.java
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,11 @@ public void setAPI(Operation_API api) {
this.api = api;

// add the intercepted message to the matched messages to be displayed
matchedMessages.add(api.message);
if (!matchedMessages.contains(api.message)) {
// it could be added multiple times because this method is called by other Modules that returns this api
// edited
matchedMessages.add(api.message);
}

// updates the processed message from the api
this.processed_message = api.message.build_message(api.is_request);
Expand Down

0 comments on commit ee1111f

Please sign in to comment.