MCPcopy
hub / github.com/OJ/gobuster / GetConfigString

Method GetConfigString

gobusterfuzz/gobusterfuzz.go:228–326  ·  view source on GitHub ↗

GetConfigString returns the string representation of the current config

()

Source from the content-addressed store, hash-verified

226
227// GetConfigString returns the string representation of the current config
228func (d *GobusterFuzz) GetConfigString() (string, error) {
229 var buffer bytes.Buffer
230 bw := bufio.NewWriter(&buffer)
231 tw := tabwriter.NewWriter(bw, 0, 5, 3, ' ', 0)
232 o := d.options
233 if _, err := fmt.Fprintf(tw, "[+] Url:\t%s\n", o.URL); err != nil {
234 return "", err
235 }
236
237 if _, err := fmt.Fprintf(tw, "[+] Method:\t%s\n", o.Method); err != nil {
238 return "", err
239 }
240
241 if _, err := fmt.Fprintf(tw, "[+] Threads:\t%d\n", d.globalopts.Threads); err != nil {
242 return "", err
243 }
244
245 if d.globalopts.Delay > 0 {
246 if _, err := fmt.Fprintf(tw, "[+] Delay:\t%s\n", d.globalopts.Delay); err != nil {
247 return "", err
248 }
249 }
250
251 wordlist := "stdin (pipe)"
252 if d.globalopts.Wordlist != "-" {
253 wordlist = d.globalopts.Wordlist
254 }
255 if _, err := fmt.Fprintf(tw, "[+] Wordlist:\t%s\n", wordlist); err != nil {
256 return "", err
257 }
258
259 if d.globalopts.PatternFile != "" {
260 if _, err := fmt.Fprintf(tw, "[+] Patterns:\t%s (%d entries)\n", d.globalopts.PatternFile, len(d.globalopts.Patterns)); err != nil {
261 return "", err
262 }
263 }
264
265 if o.ExcludedStatusCodesParsed.Length() > 0 {
266 if _, err := fmt.Fprintf(tw, "[+] Excluded Status codes:\t%s\n", o.ExcludedStatusCodesParsed.Stringify()); err != nil {
267 return "", err
268 }
269 }
270
271 if len(o.ExcludeLength) > 0 {
272 if _, err := fmt.Fprintf(tw, "[+] Exclude Length:\t%s\n", d.options.ExcludeLengthParsed.Stringify()); err != nil {
273 return "", err
274 }
275 }
276
277 if o.Proxy != "" {
278 if _, err := fmt.Fprintf(tw, "[+] Proxy:\t%s\n", o.Proxy); err != nil {
279 return "", err
280 }
281 }
282
283 if o.Cookies != "" {
284 if _, err := fmt.Fprintf(tw, "[+] Cookies:\t%s\n", o.Cookies); err != nil {
285 return "", err

Callers

nothing calls this directly

Calls 3

LengthMethod · 0.80
StringifyMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected