Skip to content

Instantly share code, notes, and snippets.

@JonCooperWorks
Last active September 27, 2020 14:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save JonCooperWorks/46e610fe4c815406a4cd8e6542030193 to your computer and use it in GitHub Desktop.
package main
import (
"bytes"
"io/ioutil"
"log"
"github.com/joncooperworks/httpfuzz"
)
type fileUploaded struct {
logger *log.Logger
}
func (f *fileUploaded) Listen(results <-chan *httpfuzz.Result) {
for result := range results {
// This is a buffer, ReadAll shouldn't fail
body, _ := ioutil.ReadAll(result.Response.Body)
if bytes.Contains(body, []byte("successfully uploaded!")) {
b.logger.Printf("%s successfully uploaded", result.Payload)
}
}
}
// New returns a fileUploaded plugin that detects if a file payload has been uploaded successfully to DVWA.
func New(logger *log.Logger) (httpfuzz.Listener, error) {
return &fileUploaded{logger: logger}, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment