MCPcopy Create free account
hub / github.com/Moopinger/smugglefuzz / BulkImportPayloads

Function BulkImportPayloads

lib/payload.go:60–82  ·  view source on GitHub ↗
(payloadsFromFile []string, hostname string)

Source from the content-addressed store, hash-verified

58}
59
60func BulkImportPayloads(payloadsFromFile []string, hostname string) ([]Payload, error) {
61
62 payloads := []Payload{}
63
64 for _, line := range payloadsFromFile {
65 if line == "" {
66 continue
67 }
68
69 //replace [HOSTNAME] with the actual hostname
70 line = strings.ReplaceAll(line, "[HOSTNAME]", hostname)
71
72 parts := strings.Split(line, "; ")
73
74 if len(parts) != 2 {
75 continue
76 }
77
78 payloads = append(payloads, NewPayload(parts[0], parts[1], line))
79 }
80
81 return payloads, nil
82}
83
84func NewPayload(headerName string, headerValue string, name string) Payload {
85

Callers 1

scan.goFile · 0.92

Calls 1

NewPayloadFunction · 0.85

Tested by

no test coverage detected