Skip to content

Conversation

@man715
Copy link

@man715 man715 commented Apr 4, 2025

Replace Only Placeholder

Key Changes:

  • Replace only the placeholder instead of the entire argument.

The biggest change is to only replace the place holder instead of the entire line of an argument. For example if the placeholder is ${target} the current code will replace the entire line that the pattern is found. My proposition is that only the placeholder be replaced.

This change allows for using that in other parts of an argument such as a tool's output. Since in the output you need to specify the location /data/example-output.txt. If you use the ${target} inside of that output, it will wipe out everything you put on that line and just have the result of ${target}

Let's say ${target} == google.com and you want to have the output of a tool be saved as tool-google.com.txt. You would put in the cmdline arguments section of the yml file. -o /data/tool-${target}.txt. This will currently output google.com. You lose the -o /data/tool- with the current way robopages-cli replaces the text.

@man715 man715 requested a review from a team as a code owner April 4, 2025 20:45
@GangGreenTemperTatum
Copy link
Collaborator

hi @man715 , can you provide clarity about what changes you are looking to introduce and the problem statement here please?

@man715
Copy link
Author

man715 commented Apr 4, 2025

hi @man715 , can you provide clarity about what changes you are looking to introduce and the problem statement here please?

I updated the PR with more information. Please let me know if anything else is missing or there needs to be more clarification. @GangGreenTemperTatum

@GangGreenTemperTatum
Copy link
Collaborator

thanks @man715 , following now.

can you please provide an example of a robopage function you are running to replicate the example and the output? does it only happen with one function?

@man715
Copy link
Author

man715 commented Apr 9, 2025

@GangGreenTemperTatum,

It happens with all of the functions. It looks like it may have been a known issue because the templates I've looked at that you all provide have the ${target} on its own line. Here is an example of one that I tried using before.

functions:
  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:
      - -domain
      - -domain ${target}
      - -recursive
      - -all

The - -domain ${target} line is where the issue arises. The -domain and ${target} need to be on separate lines or -domain will get replaced with just the target.

@GangGreenTemperTatum
Copy link
Collaborator

ah thanks @man715 , i see now. checking the robopages repo for subfinder, it looks like this is your own custom robopage

this is not an error with the CLI (this repo), its a bug in your robopage itself, example here for subdomain enum

additionally, i took your example and merged this into the robopages repo -> dreadnode/robopages#34

try running with:

robopages run --function subjack_enum_host_subdomains
>> enter value for argument 'target': www.example.com

i tested on my end and LGTM (note, also named the function subjack_enum_host_subdomains to avoid conflict

@man715
Copy link
Author

man715 commented Apr 9, 2025

I respectfully disagree. It is an issue with how the ${target} is being replaced not with the robopage config.

image

The current main branch does this
image
While the patch runs this
image

@GangGreenTemperTatum
Copy link
Collaborator

GangGreenTemperTatum commented May 2, 2025

I respectfully disagree. It is an issue with how the ${target} is being replaced not with the robopage config.

@man715 i believe your hypothesis here is correct on the last statement. however, the information in this PR has been continually vague and your initial robopage which i'd asked for, is different from your latest robopage function example and the issue seems to be moving into different territories due to this lack of information

i appreciate you reaching out and providing feedback. but in order to proceed further, please provide the full robopage example as well as the CLI command you are running

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.

2 participants