mirror of
https://github.com/OJ/gobuster.git
synced 2024-12-18 09:54:10 +01:00
0a0cab949f
* retry on timeout * Google Cloud Bucket enumeration * colors in output * goreleaser * fix nil reference errors
36 lines
582 B
Go
36 lines
582 B
Go
package gobustergcs
|
|
|
|
import (
|
|
"bytes"
|
|
|
|
"github.com/fatih/color"
|
|
)
|
|
|
|
var (
|
|
green = color.New(color.FgGreen).FprintfFunc()
|
|
)
|
|
|
|
// Result represents a single result
|
|
type Result struct {
|
|
Found bool
|
|
BucketName string
|
|
Status string
|
|
}
|
|
|
|
// ResultToString converts the Result to it's textual representation
|
|
func (r Result) ResultToString() (string, error) {
|
|
buf := &bytes.Buffer{}
|
|
|
|
c := green
|
|
|
|
c(buf, "https://storage.googleapis.com/storage/v1/b/%s/o", r.BucketName)
|
|
|
|
if r.Status != "" {
|
|
c(buf, " [%s]", r.Status)
|
|
}
|
|
c(buf, "\n")
|
|
|
|
str := buf.String()
|
|
return str, nil
|
|
}
|