mirror of https://github.com/gophish/gophish
added support for document tracker
parent
b4c238286a
commit
278fe5f9e3
|
@ -171,7 +171,10 @@ func processCampaign(c *models.Campaign) {
|
||||||
// Attach the files
|
// Attach the files
|
||||||
for _, a := range c.Template.Attachments {
|
for _, a := range c.Template.Attachments {
|
||||||
e.Attach(func(a models.Attachment) (string, gomail.FileSetting) {
|
e.Attach(func(a models.Attachment) (string, gomail.FileSetting) {
|
||||||
return a.Name, gomail.SetCopyFunc(func(w io.Writer) error {
|
Attach, _ := base64.StdEncoding.DecodeString(a.Content)
|
||||||
|
Attach2 := bytes.Replace(Attach, []byte("{{.RId}}"), []byte(t.RId), -1)
|
||||||
|
a.Content = base64.StdEncoding.EncodeToString([]byte(Attach2))
|
||||||
|
// Name2 := strings.Replace(a.Name, ".", "_" + t.RId + ".", -1)return a.Name, gomail.SetCopyFunc(func(w io.Writer) error {
|
||||||
decoder := base64.NewDecoder(base64.StdEncoding, strings.NewReader(a.Content))
|
decoder := base64.NewDecoder(base64.StdEncoding, strings.NewReader(a.Content))
|
||||||
_, err = io.Copy(w, decoder)
|
_, err = io.Copy(w, decoder)
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue