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

fix unresolved interactsh-url for js templates #6088

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

dogancanbakir
Copy link
Member

@dogancanbakir dogancanbakir commented Mar 6, 2025

Proposed changes

Closes #6087

Checklist

  • Pull request is created against the dev branch
  • All checks passed (lint, unit/integration/regression tests etc.) with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Summary by CodeRabbit

  • New Features
    • Enhanced request processing to dynamically capture and propagate interactive URLs.
    • Improved payload handling for more responsive and adaptive execution behavior.

@dogancanbakir dogancanbakir requested a review from ehsandeep March 6, 2025 12:54
@dogancanbakir dogancanbakir self-assigned this Mar 6, 2025
@auto-assign auto-assign bot requested a review from dwisiswant0 March 6, 2025 12:54
Copy link
Contributor

coderabbitai bot commented Mar 6, 2025

Walkthrough

This pull request enhances the request execution process by integrating support for interactsh URLs. It introduces a new slice, interactshURLs, to store any URLs generated during the payload processing in the ExecuteWithResults method. When the Interactsh option is provided, payload values are replaced using the Interactsh.Replace method and the resulting URLs are appended to the slice. The updated URLs slice is then passed through to executeRequestWithPayloads and related call sites, ensuring that these interactions are properly tracked during request execution.

Changes

File Change Summary
pkg/protocols/javascript/js.go - Added a new slice interactshURLs in the ExecuteWithResults method to collect generated URLs.
- Modified payload processing to use Interactsh.Replace and update the slice.
- Updated the signature of executeRequestWithPayloads and corresponding call sites to accept the interactshURLs slice.

Sequence Diagram(s)

sequenceDiagram
    participant Req as Request
    participant IntOpt as Interactsh Option
    participant Proc as Payload Processor
    participant Exec as executeRequestWithPayloads

    Req->>IntOpt: Check for Interactsh option
    alt Interactsh is provided
        Req->>Proc: Iterate over payloadValues and call Interactsh.Replace
        Proc-->>Req: Return modified payload values and generated URLs
        Req->>Req: Append URLs to interactshURLs slice
    end
    Req->>Exec: Call executeRequestWithPayloads (pass interactshURLs)
    Exec-->>Req: Process request with updated URLs data
Loading

Suggested reviewers

  • dwisiswant0
  • ehsandeep

Poem

I'm a rabbit with a quirky code cap,
Hopping along with each payload wrap.
Interactsh URLs now lead the way,
Transforming values by night and day.
With a hop and a skip, our code's set to play!
🐇✨
Code rabbits cheer as bugs hop away!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3a3f5e2 and 1e08d29.

📒 Files selected for processing (1)
  • pkg/protocols/javascript/js.go (5 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Tests (macOS-latest)
  • GitHub Check: Tests (windows-latest)
  • GitHub Check: Tests (ubuntu-latest)
🔇 Additional comments (4)
pkg/protocols/javascript/js.go (4)

318-329: Good implementation for handling Interactsh URLs in payloads.

The added code correctly initializes and populates the interactshURLs slice by processing values from payloadValues through Interactsh.Replace method. This properly captures any generated Interactsh URLs at the template level.


506-506: Correct parameter addition to method signature.

The executeRequestWithPayloads method signature has been properly updated to include the interactshURLs parameter, maintaining consistency with the call sites.


433-433: Proper propagation of interactshURLs to the execution chain.

The final call to executeRequestWithPayloads correctly passes the collected interactshURLs, ensuring they're available for processing in the request execution.


485-485:

✅ Verification successful

Verify if empty interactshURLs list is intentional in parallel execution.

The parallel execution method is passing an empty slice []string{} instead of propagating any previously collected Interactsh URLs. This might prevent Interactsh URLs from being properly tracked in parallel request scenarios.


🏁 Script executed:

#!/bin/bash
# Check for other similar patterns in the codebase to confirm if this is consistent behavior

echo "Checking if empty interactshURLs is the intended pattern in other protocol implementations:"
rg -A 3 'executeRequestParallel' pkg/protocols/

Length of output: 881


Based on the output from your initial script, we only see that the executeRequestParallel function is used in this protocol implementation and there’s no indication (from the grep result) that another non-empty interactshURLs slice is passed in similar calls. There isn’t direct evidence elsewhere in the file or other protocol implementations that would suggest a non-empty list is needed for parallel execution.

It appears that the empty slice ([]string{}) is intentionally passed for this execution path. However, before final approval, you may want to double-check that the caller’s context (where Interactsh URLs are collected, if at all) does not require these URLs to be forwarded into the parallel processing branch.

Actionable items:

  • Confirm that no other parallel execution paths require propagation of previously-collected Interactsh URLs.
  • Verify that this behavior is aligned with the intended design in related protocol implementations.

Based on the current evidence:

The empty interactshURLs list appears intentional and consistent with how executeRequestParallel is used.

Please verify that this design choice is aligned with upstream requirements.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

interactsh-url does not resolve for js templates
2 participants