Documentation ¶
Index ¶
- Constants
- Variables
- type PhishingServer
- func (ps *PhishingServer) PhishHandler(w http.ResponseWriter, r *http.Request)
- func (ps *PhishingServer) ReportHandler(w http.ResponseWriter, r *http.Request)
- func (ps *PhishingServer) RobotsHandler(w http.ResponseWriter, r *http.Request)
- func (ps *PhishingServer) Shutdown() error
- func (ps *PhishingServer) Start()
- func (ps *PhishingServer) TrackHandler(w http.ResponseWriter, r *http.Request)
- func (ps *PhishingServer) TransparencyHandler(w http.ResponseWriter, r *http.Request)
- type PhishingServerOption
- type TransparencyResponse
Constants ¶
const TransparencySuffix = "+"
TransparencySuffix (when appended to a valid result ID), will cause Gophish to return a transparency response.
Variables ¶
var ErrCampaignComplete = errors.New("Event received on completed campaign")
ErrCampaignComplete is thrown when an event is received for a campaign that has already been marked as complete.
var ErrInvalidRequest = errors.New("Invalid request")
ErrInvalidRequest is thrown when a request with an invalid structure is received
Functions ¶
This section is empty.
Types ¶
type PhishingServer ¶
type PhishingServer struct {
// contains filtered or unexported fields
}
PhishingServer is an HTTP server that implements the campaign event handlers, such as email open tracking, click tracking, and more.
func NewPhishingServer ¶
func NewPhishingServer(config config.PhishServer, options ...PhishingServerOption) *PhishingServer
NewPhishingServer returns a new instance of the phishing server with provided options applied.
func (*PhishingServer) PhishHandler ¶
func (ps *PhishingServer) PhishHandler(w http.ResponseWriter, r *http.Request)
PhishHandler handles incoming client connections and registers the associated actions performed (such as clicked link, etc.)
func (*PhishingServer) ReportHandler ¶
func (ps *PhishingServer) ReportHandler(w http.ResponseWriter, r *http.Request)
ReportHandler tracks emails as they are reported, updating the status for the given Result
func (*PhishingServer) RobotsHandler ¶
func (ps *PhishingServer) RobotsHandler(w http.ResponseWriter, r *http.Request)
RobotsHandler prevents search engines, etc. from indexing phishing materials
func (*PhishingServer) Shutdown ¶
func (ps *PhishingServer) Shutdown() error
Shutdown attempts to gracefully shutdown the server.
func (*PhishingServer) Start ¶
func (ps *PhishingServer) Start()
Start launches the phishing server, listening on the configured address.
func (*PhishingServer) TrackHandler ¶
func (ps *PhishingServer) TrackHandler(w http.ResponseWriter, r *http.Request)
TrackHandler tracks emails as they are opened, updating the status for the given Result
func (*PhishingServer) TransparencyHandler ¶
func (ps *PhishingServer) TransparencyHandler(w http.ResponseWriter, r *http.Request)
TransparencyHandler returns a TransparencyResponse for the provided result and campaign.
type PhishingServerOption ¶
type PhishingServerOption func(*PhishingServer)
PhishingServerOption is a functional option that is used to configure the the phishing server
func WithContactAddress ¶
func WithContactAddress(addr string) PhishingServerOption
WithContactAddress sets the contact address used by the transparency handlers