Skip to content

Commit

Permalink
Merge pull request #44 from PortSwigger/logger-view-filter-bambdas
Browse files Browse the repository at this point in the history
Update Bambda Checker to support logger view filter Bambdas & add examples
  • Loading branch information
PortSwiggerWiener authored Dec 15, 2023
2 parents 024595b + 48dfe58 commit d58bce9
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bambda-checker-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:

- name: Validate Bambdas & update READMEs
run: |
[ $(sha256sum BambdaChecker-1.1.jar | awk '{ print $1 }') = '21805c494ccea16158081855326810e3715034900a1cd18d9e2b9ab7f108de57' ]
java -jar BambdaChecker-1.1.jar
[ $(sha256sum BambdaChecker-1.2.jar | awk '{ print $1 }') = '30959be3dce023d3b53c4e2507b9db7fed8bfe41501b14bb8c0d4d3a0a50fd71' ]
java -jar BambdaChecker-1.2.jar
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bambda-checker-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ jobs:

- name: Validate Bambdas & update READMEs
run: |
[ $(sha256sum BambdaChecker-1.1.jar | awk '{ print $1 }') = '21805c494ccea16158081855326810e3715034900a1cd18d9e2b9ab7f108de57' ]
java -jar BambdaChecker-1.1.jar
[ $(sha256sum BambdaChecker-1.2.jar | awk '{ print $1 }') = '30959be3dce023d3b53c4e2507b9db7fed8bfe41501b14bb8c0d4d3a0a50fd71' ]
java -jar BambdaChecker-1.2.jar
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/bambda-checker-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ jobs:

- name: Validate Bambdas
run: |
[ $(sha256sum BambdaChecker-1.1.jar | awk '{ print $1 }') = '21805c494ccea16158081855326810e3715034900a1cd18d9e2b9ab7f108de57' ]
java -jar BambdaChecker-1.1.jar validateonly
[ $(sha256sum BambdaChecker-1.2.jar | awk '{ print $1 }') = '30959be3dce023d3b53c4e2507b9db7fed8bfe41501b14bb8c0d4d3a0a50fd71' ]
java -jar BambdaChecker-1.2.jar validateonly
Binary file renamed BambdaChecker-1.1.jar → BambdaChecker-1.2.jar
Binary file not shown.
19 changes: 19 additions & 0 deletions Logger/View/HighlightToolType.bambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/**
* Highlights messages according to their tool type.
* @author ps-porpoise
**/
var highlights = Map.of(
ToolType.TARGET, HighlightColor.RED,
ToolType.PROXY, HighlightColor.BLUE,
ToolType.INTRUDER, HighlightColor.CYAN,
ToolType.REPEATER, HighlightColor.MAGENTA,
ToolType.EXTENSIONS, HighlightColor.ORANGE,
ToolType.SCANNER, HighlightColor.GREEN,
ToolType.SEQUENCER, HighlightColor.PINK
);

requestResponse.annotations().setHighlightColor(
highlights.getOrDefault(requestResponse.toolSource().toolType(), HighlightColor.NONE)
);

return true;
8 changes: 8 additions & 0 deletions Logger/View/SlowResponses.bambda
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* Finds slow responses.
* @author ps-porpoise
**/
var delta = requestResponse.timingData().timeBetweenRequestSentAndStartOfResponse();
var threshold = Duration.ofSeconds(3);

return delta != null && delta.toMillis() >= threshold.toMillis();

0 comments on commit d58bce9

Please sign in to comment.