1
1
Fork 0
mirror of https://github.com/OJ/gobuster.git synced 2024-05-19 02:36:02 +02:00

Correctly render output in dir mode

When wordlists contain stuff that looks like format strings (such as as
`%7ebob`) the output of the results to screen would contain the string
`%!e(MISSING)`. This was because the entity was passing the word
directly to an Fprintf call as the format string. This PR fixes this so
that the output of the word is rendered correctly.
This commit is contained in:
OJ 2018-09-17 13:27:09 +10:00
parent b6ebc5b38a
commit 5c519393ff
No known key found for this signature in database
GPG Key ID: D5DC61FB93260597

View File

@ -99,7 +99,7 @@ func (d GobusterDir) ResultToString(g *libgobuster.Gobuster, r *libgobuster.Resu
if g.Opts.StatusCodesParsed.Contains(r.Status) || g.Opts.Verbose {
if g.Opts.Expanded {
if _, err := fmt.Fprintf(buf, g.Opts.URL); err != nil {
if _, err := fmt.Fprintf(buf, "%s", g.Opts.URL); err != nil {
return nil, err
}
} else {
@ -107,7 +107,7 @@ func (d GobusterDir) ResultToString(g *libgobuster.Gobuster, r *libgobuster.Resu
return nil, err
}
}
if _, err := fmt.Fprintf(buf, r.Entity); err != nil {
if _, err := fmt.Fprintf(buf, "%s", r.Entity); err != nil {
return nil, err
}