Landing pages contain the HTML that is rendered when a target clicks on a Gophish phishing link.
The pages endpoint allows you to create, view, and manage Gophish landing pages.
This example shows how to retrieve the name of every page in Gophish.
from gophish import Gophish
api_key = 'API_KEY'
api = Gophish(api_key)
for page in api.pages.get():
print page.name
A page contains one or more models.User
objects. The page name must be unique.
Attributes
id
(int) The page IDhtml
(str) The page HTMLname
(str) The page namemodified_date
(optional: datetime.datetime) The scheduled time for page launchcapture_credentials
(bool default:False) Whether or not the landing page should capture credentialscapture_passwords
(bool default:False) Whether or not the landing page should capture passwordsredirect_url
(str) The URL to redirect targets to after they submit data
Methods
__init__(self, **kwargs)
- Returns a new Landing Page
Example:
from gophish.models import *
page = Page(name='Test Page',
html="<html><body>Click <a href="{{.URL}}">here</a></body></html>)
Gets the details for one or more landing pages. To get a particular page, set the ID to the page ID.
If the page_id
is not set, all landing pages owned by the current user will be returned.
Returns
- If the
page
is set:models.Page
- If
page_id
isNone
:list(models.Page)
Creates a new landing page. This endpoint requires you to submit a gophish.models.Page
object.
Returns
The gophish.models.Page
object that was created.
Edits an existing landing page. This endpoint requires you to submit an existing gophish.models.Page
object with its id
attribute set correctly.
Returns
The gophish.models.Page
object that was edited.
Deletes the page specified by page_id
.
Returns
A gophish.models.Status
message.
Here are some examples to show how to use the API.
All of these examples assume the following setup:
from gophish import Gophish
from gophish.models import *
api_key = 'API_KEY'
api = Gophish(api_key)
pages = api.pages.get()
page = api.pages.get(page_id=1)
page = Page(name='Test Page',
html="<html><body>Click <a href="{{.URL}}">here</a></body></html>)
page = api.pages.post(page)
print page.id