mirror of https://github.com/gophish/gophish
Added ability to use {{.URL}} and {{.From}} in landing pages
parent
bfb7fd11e8
commit
7740bb3e95
|
@ -8,6 +8,7 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/mail"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -222,7 +223,24 @@ func PhishHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
Logger.Println(err)
|
Logger.Println(err)
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
}
|
}
|
||||||
err = tmpl.Execute(&htmlBuff, rs)
|
f, err := mail.ParseAddress(c.SMTP.FromAddress)
|
||||||
|
if err != nil {
|
||||||
|
Logger.Println(err)
|
||||||
|
}
|
||||||
|
fn := f.Name
|
||||||
|
if fn == "" {
|
||||||
|
fn = f.Address
|
||||||
|
}
|
||||||
|
rsf := struct {
|
||||||
|
models.Result
|
||||||
|
URL string
|
||||||
|
From string
|
||||||
|
}{
|
||||||
|
rs,
|
||||||
|
c.URL + "?rid=" + rs.RId,
|
||||||
|
fn,
|
||||||
|
}
|
||||||
|
err = tmpl.Execute(&htmlBuff, rsf)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Logger.Println(err)
|
Logger.Println(err)
|
||||||
http.NotFound(w, r)
|
http.NotFound(w, r)
|
||||||
|
|
Loading…
Reference in New Issue