Documentation ¶
Overview ¶
Package controllers is responsible for setting up the routing and controllers (http.Handlers) for gophish.
Index ¶
- Variables
- func API(w http.ResponseWriter, r *http.Request)
- func API_Campaigns(w http.ResponseWriter, r *http.Request)
- func API_Campaigns_Id(w http.ResponseWriter, r *http.Request)
- func API_Groups(w http.ResponseWriter, r *http.Request)
- func API_Groups_Id(w http.ResponseWriter, r *http.Request)
- func API_Import_Email(w http.ResponseWriter, r *http.Request)
- func API_Import_Group(w http.ResponseWriter, r *http.Request)
- func API_Import_Site(w http.ResponseWriter, r *http.Request)
- func API_Pages(w http.ResponseWriter, r *http.Request)
- func API_Pages_Id(w http.ResponseWriter, r *http.Request)
- func API_Reset(w http.ResponseWriter, r *http.Request)
- func API_Send_Test_Email(w http.ResponseWriter, r *http.Request)
- func API_Templates(w http.ResponseWriter, r *http.Request)
- func API_Templates_Id(w http.ResponseWriter, r *http.Request)
- func Base(w http.ResponseWriter, r *http.Request)
- func CampaignID(w http.ResponseWriter, r *http.Request)
- func Campaigns(w http.ResponseWriter, r *http.Request)
- func Clone(w http.ResponseWriter, r *http.Request)
- func CreateAdminRouter() http.Handler
- func CreatePhishingRouter() http.Handler
- func Flash(w http.ResponseWriter, r *http.Request, t string, m string)
- func JSONResponse(w http.ResponseWriter, d interface{}, c int)
- func LandingPages(w http.ResponseWriter, r *http.Request)
- func Login(w http.ResponseWriter, r *http.Request)
- func Logout(w http.ResponseWriter, r *http.Request)
- func PhishHandler(w http.ResponseWriter, r *http.Request)
- func PhishTracker(w http.ResponseWriter, r *http.Request)
- func Preview(w http.ResponseWriter, r *http.Request)
- func Register(w http.ResponseWriter, r *http.Request)
- func Settings(w http.ResponseWriter, r *http.Request)
- func Templates(w http.ResponseWriter, r *http.Request)
- func Use(handler http.HandlerFunc, mid ...func(http.Handler) http.HandlerFunc) http.HandlerFunc
- func Users(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
Logger is used to send logging messages to stdout.
var Worker *worker.Worker
Worker is the worker that processes phishing events and updates campaigns.
Functions ¶
func API ¶
func API(w http.ResponseWriter, r *http.Request)
API (/api) provides access to api documentation
func API_Campaigns ¶
func API_Campaigns(w http.ResponseWriter, r *http.Request)
API_Campaigns returns a list of campaigns if requested via GET. If requested via POST, API_Campaigns creates a new campaign and returns a reference to it.
func API_Campaigns_Id ¶
func API_Campaigns_Id(w http.ResponseWriter, r *http.Request)
API_Campaigns_Id returns details about the requested campaign. If the campaign is not valid, API_Campaigns_Id returns null.
func API_Groups ¶
func API_Groups(w http.ResponseWriter, r *http.Request)
API_Groups returns details about the requested group. If the campaign is not valid, API_Groups returns null.
func API_Groups_Id ¶
func API_Groups_Id(w http.ResponseWriter, r *http.Request)
API_Groups_Id returns details about the requested campaign. If the campaign is not valid, API_Campaigns_Id returns null.
func API_Import_Email ¶
func API_Import_Email(w http.ResponseWriter, r *http.Request)
API_Import_Email allows for the importing of email. Returns a Message object
func API_Import_Group ¶
func API_Import_Group(w http.ResponseWriter, r *http.Request)
API_Import_Group imports a CSV of group members
func API_Import_Site ¶
func API_Import_Site(w http.ResponseWriter, r *http.Request)
API_Import_Site allows for the importing of HTML from a website Without "include_resources" set, it will merely place a "base" tag so that all resources can be loaded relative to the given URL.
func API_Pages ¶
func API_Pages(w http.ResponseWriter, r *http.Request)
API_Pages handles requests for the /api/pages/ endpoint
func API_Pages_Id ¶
func API_Pages_Id(w http.ResponseWriter, r *http.Request)
API_Pages_Id contains functions to handle the GET'ing, DELETE'ing, and PUT'ing of a Page object
func API_Reset ¶
func API_Reset(w http.ResponseWriter, r *http.Request)
API (/api/reset) resets a user's API key
func API_Send_Test_Email ¶
func API_Send_Test_Email(w http.ResponseWriter, r *http.Request)
API_Send_Test_Email sends a test email using the template name and Target given.
func API_Templates ¶
func API_Templates(w http.ResponseWriter, r *http.Request)
API_Templates handles the functionality for the /api/templates endpoint
func API_Templates_Id ¶
func API_Templates_Id(w http.ResponseWriter, r *http.Request)
API_Templates_Id handles the functions for the /api/templates/:id endpoint
func Base ¶
func Base(w http.ResponseWriter, r *http.Request)
Base handles the default path and template execution
func CampaignID ¶
func CampaignID(w http.ResponseWriter, r *http.Request)
CampaignID handles the default path and template execution
func Campaigns ¶
func Campaigns(w http.ResponseWriter, r *http.Request)
Campaigns handles the default path and template execution
func Clone ¶
func Clone(w http.ResponseWriter, r *http.Request)
Clone takes a URL as a POST parameter and returns the site HTML
func CreateAdminRouter ¶
CreateAdminRouter creates the routes for handling requests to the web interface. This function returns an http.Handler to be used in http.ListenAndServe().
func CreatePhishingRouter ¶
CreatePhishingRouter creates the router that handles phishing connections.
func JSONResponse ¶
func JSONResponse(w http.ResponseWriter, d interface{}, c int)
JSONResponse attempts to set the status code, c, and marshal the given interface, d, into a response that is written to the given ResponseWriter.
func LandingPages ¶
func LandingPages(w http.ResponseWriter, r *http.Request)
LandingPages handles the default path and template execution
func Login ¶
func Login(w http.ResponseWriter, r *http.Request)
Login handles the authentication flow for a user. If credentials are valid, a session is created
func Logout ¶
func Logout(w http.ResponseWriter, r *http.Request)
Logout destroys the current user session
func PhishHandler ¶
func PhishHandler(w http.ResponseWriter, r *http.Request)
PhishHandler handles incoming client connections and registers the associated actions performed (such as clicked link, etc.)
func PhishTracker ¶
func PhishTracker(w http.ResponseWriter, r *http.Request)
PhishTracker tracks emails as they are opened, updating the status for the given Result
func Preview ¶
func Preview(w http.ResponseWriter, r *http.Request)
Preview allows for the viewing of page html in a separate browser window
func Settings ¶
func Settings(w http.ResponseWriter, r *http.Request)
Settings handles the changing of settings
func Templates ¶
func Templates(w http.ResponseWriter, r *http.Request)
Templates handles the default path and template execution
func Use ¶
func Use(handler http.HandlerFunc, mid ...func(http.Handler) http.HandlerFunc) http.HandlerFunc
Use allows us to stack middleware to process the request Example taken from https://github.com/gorilla/mux/pull/36#issuecomment-25849172
Types ¶
This section is empty.