Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create DetectServerNames.bambda #66

Merged
merged 4 commits into from
Apr 15, 2024

Conversation

BugBountyzip
Copy link
Contributor

@BugBountyzip BugBountyzip commented Apr 8, 2024

Bambda Contributions

  • Bambda has a valid header, featuring an @author annotation and suitable description
  • Bambda compiles and executes as expected
  • Only .bambda files have been added or modified (README.md files are automatically updated / generated after PR merge)

Copy link
Collaborator

@PortSwiggerWiener PortSwiggerWiener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you considered looking for the Server header first and then looking within a set for the corresponding entry?

Analysis:
Performance: V2 ( new update ) is inherently faster due to its use of a HashSet for O(1) lookup time and its singular operation of checking the 'Server' header. It doesn't require iterating through the entire response body or performing multiple regex matches, which can be expensive operations.

Use Case Optimization: V1( old ) is optimized for scenarios requiring text analysis and pattern matching within the body of a response, making it suitable for its intended use case but less efficient. V2 is optimized for header analysis, which is a much simpler and faster operation due to the structured nature of HTTP headers and the efficiency of hash-based lookups.
@BugBountyzip
Copy link
Contributor Author

Almost done

Analysis:
Performance: V2 ( new update ) is inherently faster due to its use of a HashSet for O(1) lookup time and its singular operation of checking the 'Server' header. It doesn't require iterating through the entire response body or performing multiple regex matches, which can be expensive operations.

Use Case Optimization: V1( old ) is optimized for scenarios requiring text analysis and pattern matching within the body of a response, making it suitable for its intended use case but less efficient. V2 is optimized for header analysis, which is a much simpler and faster operation due to the structured nature of HTTP headers and the efficiency of hash-based lookups.

Copy link
Collaborator

@PortSwiggerWiener PortSwiggerWiener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update. I've added a couple of comments.

Filter/Proxy/HTTP/DetectServerNames.bambda Outdated Show resolved Hide resolved
Filter/Proxy/HTTP/DetectServerNames.bambda Outdated Show resolved Hide resolved
Filter/Proxy/HTTP/DetectServerNames.bambda Outdated Show resolved Hide resolved
Filter/Proxy/HTTP/DetectServerNames.bambda Outdated Show resolved Hide resolved
Copy link
Collaborator

@PortSwiggerWiener PortSwiggerWiener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates. It's getting there :)

Filter/Proxy/HTTP/DetectServerNames.bambda Outdated Show resolved Hide resolved
@BugBountyzip
Copy link
Contributor Author

Thank you @PortSwiggerWiener , @Hannah-PortSwigger

Copy link
Collaborator

@PortSwiggerWiener PortSwiggerWiener left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@PortSwiggerWiener PortSwiggerWiener merged commit 17a74e8 into PortSwigger:main Apr 15, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants