2014-01-09 06:42:05 +00:00
|
|
|
package models
|
2013-12-12 06:27:43 +00:00
|
|
|
|
2014-02-04 21:23:09 +00:00
|
|
|
import
|
2014-01-13 03:36:26 +00:00
|
|
|
|
2014-02-04 21:23:09 +00:00
|
|
|
// SMTPServer is used to provide a default SMTP server preference.
|
|
|
|
"time"
|
2014-01-13 03:36:26 +00:00
|
|
|
|
2013-12-12 06:27:43 +00:00
|
|
|
type SMTPServer struct {
|
|
|
|
Host string `json:"host"`
|
|
|
|
User string `json:"user"`
|
|
|
|
Password string `json:"password"`
|
|
|
|
}
|
|
|
|
|
2014-01-10 03:21:54 +00:00
|
|
|
// Config represents the configuration information.
|
2013-12-12 06:27:43 +00:00
|
|
|
type Config struct {
|
2014-01-06 06:09:41 +00:00
|
|
|
URL string `json:"url"`
|
|
|
|
SMTP SMTPServer `json:"smtp"`
|
|
|
|
DBPath string `json:"dbpath"`
|
2013-12-12 06:27:43 +00:00
|
|
|
}
|
2013-12-12 07:00:22 +00:00
|
|
|
|
2014-01-10 03:21:54 +00:00
|
|
|
// User represents the user model for gophish.
|
2013-12-12 07:00:22 +00:00
|
|
|
type User struct {
|
2014-01-31 22:25:02 +00:00
|
|
|
Id int64 `json:"id"`
|
2014-01-13 02:00:20 +00:00
|
|
|
Username string `json:"username"`
|
|
|
|
Hash string `json:"-"`
|
2014-01-31 22:25:02 +00:00
|
|
|
APIKey string `json:"api_key" db:"api_key"`
|
2013-12-12 07:00:22 +00:00
|
|
|
}
|
2014-01-10 03:21:54 +00:00
|
|
|
|
|
|
|
// Flash is used to hold flash information for use in templates.
|
|
|
|
type Flash struct {
|
|
|
|
Type string
|
|
|
|
Message string
|
|
|
|
}
|
2014-01-13 03:36:26 +00:00
|
|
|
|
|
|
|
//Campaign is a struct representing a created campaign
|
|
|
|
type Campaign struct {
|
2014-01-31 22:25:02 +00:00
|
|
|
Id int64 `json:"id"`
|
2014-01-30 21:08:14 +00:00
|
|
|
Name string `json:"name"`
|
|
|
|
CreatedDate time.Time `json:"created_date" db:"created_date"`
|
|
|
|
CompletedDate time.Time `json:"completed_date" db:"completed_date"`
|
|
|
|
Template string `json:"template"` //This may change
|
|
|
|
Status string `json:"status"`
|
2014-02-01 22:35:16 +00:00
|
|
|
Results []Result `json:"results" db:"-"`
|
2014-01-31 22:25:02 +00:00
|
|
|
Uid int64 `json:"-"`
|
2014-01-30 21:08:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Result struct {
|
2014-01-31 22:25:02 +00:00
|
|
|
Id int64
|
|
|
|
TargetId int64
|
2014-01-30 21:08:14 +00:00
|
|
|
Status string `json:"status"`
|
|
|
|
}
|
|
|
|
|
2014-02-01 22:35:16 +00:00
|
|
|
type Group struct {
|
2014-02-04 21:23:09 +00:00
|
|
|
Id int64 `json:"id"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
ModifiedDate time.Time `json:"modified_date" db:"modified_date"`
|
|
|
|
Targets []Target `json:"targets" db:"-"`
|
2014-01-30 21:08:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Target struct {
|
2014-02-04 21:23:09 +00:00
|
|
|
Id int64 `json:"-"`
|
|
|
|
Email string `json:"email"`
|
2014-01-13 03:36:26 +00:00
|
|
|
}
|