Skip to content

Commit

Permalink
Edit operations supported on Operation
Browse files Browse the repository at this point in the history
- Added Edit Operations to edit messages in Operation
- Removed IExtensionHelpers dependencies where possible
- Fixed some bugs in HTTPReqRes methods
- Added missing HTTPReqRes meethods to edit message
- Added encode value in Edit Operation
- Added tests for Edit Operation and new HTTPReqRes methods
- new dependency for parsing urls
  • Loading branch information
mattebit committed Nov 9, 2023
1 parent d8c50f8 commit aa9f766
Show file tree
Hide file tree
Showing 30 changed files with 868 additions and 469 deletions.
267 changes: 147 additions & 120 deletions doc/language.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions tool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@
<artifactId>httpclient</artifactId>
<version>4.5.13</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.14</version>
</dependency>
</dependencies>

<properties>
Expand Down
2 changes: 0 additions & 2 deletions tool/src/main/java/migt/BurpExtender.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@

/**
* Main class executed by Burp
*
* @author Matteo Bitussi
*/
public class BurpExtender implements IBurpExtender, ITab, IProxyListener {

Expand Down
2 changes: 0 additions & 2 deletions tool/src/main/java/migt/Check.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@

/**
* Check Object class. This object is used in Operations to check that a parameter or some text is in as specified.
*
* @author Matteo Bitussi
*/
public class Check extends Module {
String what; // what to search
Expand Down
9 changes: 5 additions & 4 deletions tool/src/main/java/migt/DecodeOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public static String decode(List<Encoding> encodings, String encoded, IExtension
* @param decoded the string to be encoded
* @return the encoded string
*/
public static String encode(List<Encoding> encodings, String decoded, IExtensionHelpers helpers) {
public static String encode(List<Encoding> encodings, String decoded) {
String actual = decoded;
byte[] actual_b = null;
boolean isActualString = true;
Expand All @@ -251,9 +251,9 @@ public static String encode(List<Encoding> encodings, String decoded, IExtension
case BASE64:

if (isActualString) {
actual = helpers.base64Encode(actual);
actual = Base64.getEncoder().encodeToString(actual.getBytes());
} else {
actual = helpers.base64Encode(actual_b);
Base64.getEncoder().encodeToString(actual_b);
isActualString = true;
}
break;
Expand Down Expand Up @@ -422,7 +422,7 @@ public void loader(DecodeOperation_API api, IExtensionHelpers helpers) {
@Override
public API exporter() throws ParsingException {
Collections.reverse(encodings); // Set the right order for encoding
String encoded = encode(encodings, decoded_content, helpers);
String encoded = encode(encodings, decoded_content);

if (imported_api instanceof Operation_API) {
Tools.editMessageParam(
Expand Down Expand Up @@ -476,6 +476,7 @@ public void execute(List<Var> vars) throws ParsingException {
}
decoded_content = decode(encodings, found, helpers);
break;

default:
throw new UnsupportedOperationException(
"the from you selected in the recursive decode operation is not yet supported");
Expand Down
Loading

0 comments on commit aa9f766

Please sign in to comment.