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

allow words to be in the template #169

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,7 @@ func (m *Mutator) clusterBomb(template string, results chan string) {
// instead of sending all payloads only send payloads that are used
// in template/statement
for _, v := range varsUsed {
payloadSet[v] = []string{}
for _, word := range m.Options.Payloads[v] {
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)
}
}
payloadSet[v] = append([]string{}, m.Options.Payloads[v]...)
Copy link
Member

Choose a reason for hiding this comment

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

Instead of removing the !strings.Contains condition that's already in place, it would be better to enhance it by performing a comparison check where if the word is eq to sub, then just continue.

Also don't forget to add/update the test case.

}
payloads := NewIndexMap(payloadSet)
// in clusterBomb attack no of payloads generated are
Expand Down
Loading