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

Match both %ext% and %EXT% in DirSearch compatibility mode #81

Merged
merged 4 commits into from Oct 24, 2019

Conversation

oh6hay
Copy link
Contributor

@oh6hay oh6hay commented Oct 20, 2019

No description provided.

@oh6hay oh6hay mentioned this pull request Oct 20, 2019
@@ -98,6 +98,11 @@ func (w *WordlistInput) readFile(path string) error {
contnt := strings.Replace(reader.Text(), "%EXT%", ext, -1)
data = append(data, []byte(contnt))
}
} else if strings.Index(reader.Text(), "%ext%") != -1 {
for _, ext := range w.config.Extensions {
contnt := strings.Replace(reader.Text(), "%ext%", ext, -1)
Copy link
Member

Choose a reason for hiding this comment

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

I would rather see the original replace action changed to case insensitive regex replace. This way it would match possible typos %Ext% etc. as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

better now? I haven't really written any go before

Copy link
Member

@joohoi joohoi left a comment

Choose a reason for hiding this comment

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

One small nit, otherwise LGTM

@@ -91,11 +91,13 @@ func (w *WordlistInput) readFile(path string) error {

var data [][]byte
reader := bufio.NewScanner(file)
re := regexp.MustCompile(`(?i)%ext%`)
Copy link
Member

Choose a reason for hiding this comment

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

For readability, this should get moved to the if w.config.DirSearchCompat... block

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think outside the loop is better so the regex doesn't get created for every line in the input

Copy link
Member

Choose a reason for hiding this comment

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

Absolutely, thanks for clarification.

Copy link
Member

@joohoi joohoi left a comment

Choose a reason for hiding this comment

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

LGTM

@joohoi joohoi merged commit 8d057ea into ffuf:master Oct 24, 2019
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.

None yet

2 participants