mirror of https://github.com/gophish/gophish
Moved structs to models.go file
Changed config to have "host" string Working on simple mailing library Some basic template bug fixes (eventually I might move the side nav to a template)pull/24/head
parent
25a06a14a0
commit
a64b0c10c9
|
@ -1,8 +1,7 @@
|
||||||
{
|
{
|
||||||
"url" : "localhost:3333",
|
"url" : "localhost:3333",
|
||||||
"smtp" : {
|
"smtp" : {
|
||||||
"host" : "smtp.example.com",
|
"host" : "smtp.example.com:25",
|
||||||
"port" : 25,
|
|
||||||
"user" : "username",
|
"user" : "username",
|
||||||
"pass" : "password"
|
"pass" : "password"
|
||||||
}
|
}
|
||||||
|
|
12
gophish.go
12
gophish.go
|
@ -33,18 +33,6 @@ import (
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SMTPServer struct {
|
|
||||||
Server string `json:"host"`
|
|
||||||
Port int `json:"port"`
|
|
||||||
User string `json:"user"`
|
|
||||||
Password string `json:"password"`
|
|
||||||
}
|
|
||||||
|
|
||||||
type Config struct {
|
|
||||||
URL string `json:"url"`
|
|
||||||
SMTP SMTPServer `json:"smtp"`
|
|
||||||
}
|
|
||||||
|
|
||||||
var config Config
|
var config Config
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/smtp"
|
||||||
|
)
|
||||||
|
|
||||||
|
func Send(email Email, server Server) {
|
||||||
|
auth = smtp.PlainAuth("", server.User, server.Password, server.Server)
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
type SMTPServer struct {
|
||||||
|
Host string `json:"host"`
|
||||||
|
User string `json:"user"`
|
||||||
|
Password string `json:"password"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Email struct {
|
||||||
|
Subject string
|
||||||
|
Body string
|
||||||
|
To []string
|
||||||
|
Bcc []string
|
||||||
|
Cc []string
|
||||||
|
From string
|
||||||
|
}
|
||||||
|
|
||||||
|
type Config struct {
|
||||||
|
URL string `json:"url"`
|
||||||
|
SMTP SMTPServer `json:"smtp"`
|
||||||
|
}
|
2
route.go
2
route.go
|
@ -70,7 +70,7 @@ func Base(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func Base_Campaigns(w http.ResponseWriter, r *http.Request) {
|
func Base_Campaigns(w http.ResponseWriter, r *http.Request) {
|
||||||
session, _ := store.Get(r, "gophish")
|
//session, _ := store.Get(r, "gophish")
|
||||||
renderTemplate(w, "dashboard")
|
renderTemplate(w, "dashboard")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
.navbar-logo {
|
.navbar-logo {
|
||||||
margin: 4px 0px;
|
margin: 4px 0px;
|
||||||
float: left;
|
float: left;
|
||||||
|
|
|
@ -9,13 +9,13 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="col-md-3 sidebar">
|
<div class="col-md-3 sidebar">
|
||||||
<ul class="nav nav-pills nav-stacked">
|
<ul class="nav nav-pills nav-stacked">
|
||||||
<li class="active"><a href="#">Dashboard</a>
|
<li><a href="/">Dashboard</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="/users">Users & Groups</a>
|
<li><a href="/users">Users & Groups</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="/settings">Settings</a>
|
<li><a href="/settings">Settings</a>
|
||||||
</li>
|
</li>
|
||||||
<li><a href="/api/doc">API Documentation</a>
|
<li class="active"><a href="/api/doc">API Documentation</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
{{define "content"}} {{template "nav"}}
|
||||||
|
<div class="jumbotron">
|
||||||
|
<div class="container" style="text-align:center;">
|
||||||
|
<h1 class="sans header">
|
||||||
|
Settings
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
<div class="col-md-3 sidebar">
|
||||||
|
<ul class="nav nav-pills nav-stacked">
|
||||||
|
<li><a href="/">Dashboard</a>
|
||||||
|
</li>
|
||||||
|
<li><a href="/users">Users & Groups</a>
|
||||||
|
</li>
|
||||||
|
<li class="active"><a href="/settings">Settings</a>
|
||||||
|
</li>
|
||||||
|
<li><a href="/api/doc">API Documentation</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9 sans">
|
||||||
|
<h1 style="margin-top:0px"><i class="fa fa-gear"></i> Gophish API</h1>
|
||||||
|
<p>Gophish runs on top of a RESTful API which allows developers to automate phishing campaigns easily. The following documentation and examples demonstrate the API functionality</p>
|
||||||
|
<h2 class="api_heading">/api/campaigns</h2>
|
||||||
|
<p>Test.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
{{define "content"}} {{template "nav"}}
|
||||||
|
<div class="jumbotron">
|
||||||
|
<div class="container" style="text-align:center;">
|
||||||
|
<h1 class="sans header">
|
||||||
|
Users & Groups
|
||||||
|
</h1>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="container">
|
||||||
|
<div class="col-md-3 sidebar">
|
||||||
|
<ul class="nav nav-pills nav-stacked">
|
||||||
|
<li><a href="/">Dashboard</a>
|
||||||
|
</li>
|
||||||
|
<li class="active"><a href="/users">Users & Groups</a>
|
||||||
|
</li>
|
||||||
|
<li><a href="/settings">Settings</a>
|
||||||
|
</li>
|
||||||
|
<li><a href="/api/doc">API Documentation</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9 sans">
|
||||||
|
<h1 style="margin-top:0px"><i class="fa fa-gear"></i> Gophish API</h1>
|
||||||
|
<p>Gophish runs on top of a RESTful API which allows developers to automate phishing campaigns easily. The following documentation and examples demonstrate the API functionality</p>
|
||||||
|
<h2 class="api_heading">/api/campaigns</h2>
|
||||||
|
<p>Test.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
Loading…
Reference in New Issue