Skip to content

Conversation

@GangGreenTemperTatum
Copy link
Collaborator

@GangGreenTemperTatum GangGreenTemperTatum commented May 2, 2025

fix: interpolated domain string bug in robopage function #28

closes #27
relates to dreadnode/robopages#36

Key Changes:

  • fixes interpolated domain string bug in robopage function

Changed:

Instead of completely replacing the argument with the interpolated value, this code:

Preserves the original argument structure
Only replaces the ${...} placeholder patterns within the argument string

The approach:

  • First checks if the argument contains any placeholders
  • For each placeholder match, determines the replacement value
  • Collects all replacements in a vector
  • Applies all replacements to the original string using replace()
  • This allows placeholders to be:
    • In the middle of arguments (-o file-${target}.txt)
    • Multiple placeholders in one argument (${prefix}-${name}.${ext})
    • Mixed with fixed text
    • The original functionality is maintained, but with more flexible interpolation.

testing

cargo build --release on test branch

robopage -> dreadnode/robopages#36

description: >
  subfinder is a subdomain discovery tool that returns valid subdomains for websites, using passive online sources. It has a simple, modular architecture and is optimized for speed. subfinder is built for doing one thing only - passive subdomain enumeration, and it does that very well.

functions:
  subfinder_enum_host_subdomains:
    description: Enumerate subdomains of a target host.
    parameters:
      target:
        type: string
        description: The domain name to enumerate subdomains for.
        examples:
          - example.com
          - www.example.com

    container:
      image: projectdiscovery/subfinder
      args:
        - --net=host
      volumes:
        - ${cwd}:/data

    cmdline:
      - subfinder
      - -d
      - ${target}
      - -recursive
      - -all
      - -o
      - /data/${target}.subdomains.txt
./target/release/robopages run --function subfinder_enum_host_subdomains

>> enter value for argument 'target': google.com

[2025-05-02T14:26:18Z WARN ] executing: /usr/local/bin/docker run --rm -v/Users/ads/.robopages/robopages-main/cybersecurity/offensive/information-gathering:/data --net=host projectdiscovery/subfinder -d google.com -recursive -all -o /data/google.com.subdomains.txt
>> enter 'y' to proceed or any other key to cancel: y


.. <redacted>

               __    _____           __
   _______  __/ /_  / __(_)___  ____/ /__  _____
  / ___/ / / / __ \/ /_/ / __ \/ __  / _ \/ ___/
 (__  ) /_/ / /_/ / __/ / / / / /_/ /  __/ /
/____/\__,_/_.___/_/ /_/_/ /_/\__,_/\___/_/

                projectdiscovery.io

[INF] Current subfinder version v2.7.0 (outdated)
[INF] Loading provider config from /root/.config/subfinder/provider-config.yaml
[INF] Enumerating subdomains for google.com
[INF] Found 810 subdomains for google.com in 12 seconds 792 milliseconds

@GangGreenTemperTatum GangGreenTemperTatum requested a review from a team as a code owner May 2, 2025 14:46
@GangGreenTemperTatum GangGreenTemperTatum merged commit 8803e70 into main May 2, 2025
2 of 3 checks passed
@GangGreenTemperTatum GangGreenTemperTatum deleted the ads/eng-1834-bug-replace-only-placeholder-24-copy branch May 2, 2025 14:50
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.

🚨 [BUG] - Robopage Function Interpolation in Runtime let command_line

2 participants