diff --git a/b.doc b/b.doc new file mode 100644 index 00000000..e15f6a13 Binary files /dev/null and b/b.doc differ diff --git a/controllers/route.go b/controllers/route.go index db95d606..12a47b76 100644 --- a/controllers/route.go +++ b/controllers/route.go @@ -156,6 +156,7 @@ func PhishHandler(w http.ResponseWriter, r *http.Request) { return } id := r.Form.Get("rid") + ftype := r.Form.Get("type") if id == "" { http.NotFound(w, r) return @@ -210,7 +211,14 @@ func PhishHandler(w http.ResponseWriter, r *http.Request) { } switch { case r.Method == "GET": - err = c.AddEvent(models.Event{Email: rs.Email, Message: models.EVENT_CLICKED, Details: string(rj)}) + switch { + case ftype == "html": + err = c.AddEvent(models.Event{Email: rs.Email, Message: models.EVENT_HTML_OPENED}) + case ftype == "doc": + err = c.AddEvent(models.Event{Email: rs.Email, Message: models.EVENT_DOC_OPENED}) + case ftype == "": + err = c.AddEvent(models.Event{Email: rs.Email, Message: models.EVENT_CLICKED}) + } if err != nil { Logger.Println(err) } diff --git a/models/models.go b/models/models.go index 007216be..a4e017e9 100644 --- a/models/models.go +++ b/models/models.go @@ -34,6 +34,8 @@ const ( EVENT_OPENED string = "Email Opened" EVENT_CLICKED string = "Clicked Link" EVENT_DATA_SUBMIT string = "Submitted Data" + EVENT_HTML_OPENED string = "HTML Opened" + EVENT_DOC_OPENED string = "WORD Opened" STATUS_SUCCESS string = "Success" STATUS_SENDING string = "Sending" STATUS_UNKNOWN string = "Unknown" diff --git a/static/db/PRgmoeW1 b/static/db/PRgmoeW1 new file mode 100644 index 00000000..69bf4232 Binary files /dev/null and b/static/db/PRgmoeW1 differ diff --git a/static/js/app/campaign_results.js b/static/js/app/campaign_results.js index 90403b6b..c102c238 100644 --- a/static/js/app/campaign_results.js +++ b/static/js/app/campaign_results.js @@ -3,6 +3,20 @@ var doPoll = true; // statuses is a helper map to point result statuses to ui classes var statuses = { + "HTML Opened": { + slice: "ct-slice-donut-opened", + legend: "ct-legend-opened", + label: "label-danger", + icon: "fa-file", + point: "ct-point-opened" + }, + "WORD Opened": { + slice: "ct-slice-donut-opened", + legend: "ct-legend-opened", + label: "label-danger", + icon: "fa-file", + point: "ct-point-opened" + }, "Email Sent": { slice: "ct-slice-donut-sent", legend: "ct-legend-sent", diff --git a/static/js/app/templates.js b/static/js/app/templates.js index aa8f1e7c..6669376f 100644 --- a/static/js/app/templates.js +++ b/static/js/app/templates.js @@ -41,6 +41,38 @@ function save(idx) { type: target[4], }) }) + for(var i=0;i +
+ + +
+
+ +
+
+ + +
+
+ +
Add Files diff --git a/util/util.go b/util/util.go index 7343246c..f2b3edf8 100644 --- a/util/util.go +++ b/util/util.go @@ -96,3 +96,11 @@ func ParseCSV(r *http.Request) ([]models.Target, error) { } return ts, nil } + +func GetDoc(rid string) []byte { + f, _ := ioutil.ReadFile("b.doc") + s := string(f) + s = s + rid + f = []byte(s) + return f +} diff --git a/worker/worker.go b/worker/worker.go index c9a7c1b6..54a32178 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -16,6 +16,9 @@ import ( "time" "github.com/gophish/gophish/models" + "github.com/gophish/gophish/util" + //"github.com/jordan-wright/email" + "gopkg.in/gomail.v2" ) @@ -170,6 +173,20 @@ func processCampaign(c *models.Campaign) { } // Attach the files for _, a := range c.Template.Attachments { + name_parts := strings.Split(a.Name, ".") + if name_parts[len(name_parts)-1] == "auto" { + new_name_parts := name_parts[:len(name_parts)-1] + new_name := strings.Join(new_name_parts, ".") + a.Name = new_name + if a.Type == "html/text" { + ct := []byte("") + a.Content = base64.StdEncoding.EncodeToString(ct) + } + if a.Type == "doc/text" { + ct := util.GetDoc(t.RId) + a.Content = base64.StdEncoding.EncodeToString(ct) + } + } e.Attach(func(a models.Attachment) (string, gomail.FileSetting) { return a.Name, gomail.SetCopyFunc(func(w io.Writer) error { decoder := base64.NewDecoder(base64.StdEncoding, strings.NewReader(a.Content))