Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aead/sf
S3 fuzzing library
https://github.com/aead/sf
aws-s3 fuzzing go minio s3
Last synced: 5 days ago
JSON representation
S3 fuzzing library
- Host: GitHub
- URL: https://github.com/aead/sf
- Owner: aead
- License: mit
- Created: 2018-03-12T13:58:10.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-13T15:03:27.000Z (almost 7 years ago)
- Last Synced: 2024-11-21T02:27:20.436Z (2 months ago)
- Topics: aws-s3, fuzzing, go, minio, s3
- Language: Go
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Godoc Reference](https://godoc.org/github.com/aead/sf?status.svg)](https://godoc.org/github.com/aead/sf)
[![Travis CI](https://travis-ci.org/aead/sf.svg?branch=master)](https://travis-ci.org/aead/sf)
[![Go Report Card](https://goreportcard.com/badge/aead/sf)](https://goreportcard.com/report/aead/sf)# S3 Fuzzing
A prototype for an S3 fuzzing library.
## Get Started
```
package mainimport (
"bytes"
"crypto/tls"
"fmt"
"net/http"
"strings"
"time""github.com/aead/sf"
"github.com/aead/sf/headers"
minio "github.com/minio/minio-go"
)func main() {
host, accessKey, secretkey := "localhost:9000", "ACCESS_KEY", "SECRET_KEY"s3Client, err := minio.NewV2(host, accessKey, secretkey, true)
if err != nil {
fmt.Println("Failed to create S3 client:", err)
return
}
customTrans := http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}rand := sf.NewRandom(time.Now().Unix())
fuzzers := sf.MultiFuzzer{
sf.Insert(func() (string, string) {
length, _ := headers.TypeOf("Content-Length")
return "Content-Length", length.Random(rand)
}),
sf.Filter(func(k string) bool { return strings.HasPrefix(k, "User-Agent") }),
sf.Logger(nil),
}s3Client.SetCustomTransport(sf.RegisterFuzzer(&customTrans, fuzzers...))
data := make([]byte, 1024)
_, err = s3Client.PutObject("bucket", "object", bytes.NewReader(data), int64(len(data)), minio.PutObjectOptions{})
if err != nil {
fmt.Println(err)
return
}
}
```