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

Expected output is missing #168

Open
meme-lord opened this issue Aug 1, 2024 · 1 comment · May be fixed by #169
Open

Expected output is missing #168

meme-lord opened this issue Aug 1, 2024 · 1 comment · May be fixed by #169

Comments

@meme-lord
Copy link

meme-lord commented Aug 1, 2024

test_subs.txt:

abc.site.com
xyz.site.com
def.ghi.site.com

test.yml:

patterns:
  - "{{word}}-{{sub}}.{{suffix}}"

payloads:
  word:
    - "1"
    - "a"
    - "ab"

Command:

alterx -l test_subs.txt -ac test.yml | sort

Output:

1-abc.site.com
1-def.ghi.site.com
1-xyz.site.com
ab-def.ghi.site.com
ab-xyz.site.com
a-def.ghi.site.com
a-xyz.site.com

Missing:

a-abc.site.com
ab-abc.site.com
@meme-lord
Copy link
Author

Found the problem in mutator.go:

if !strings.Contains(template, word) {
  // skip all words that are already present in template/sub , it is highly unlikely
  // we will ever find api-api.example.com
  payloadSet[v] = append(payloadSet[v], word)
}

This should probably have a length limit before it applies and maybe a command line option to disable

@meme-lord meme-lord linked a pull request Aug 1, 2024 that will close this issue
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 a pull request may close this issue.

1 participant