GoPhish User Guide - 2019
GoPhish User Guide - 2019
GoPhish User Guide - 2019
of Contents
Introduction 1.1
License 1.2
What is Gophish? 1.3
Installation 1.4
Getting Started 1.5
Documentation 1.6
Changing User Settings 1.6.1
Groups 1.6.2
Templates 1.6.3
Landing Pages 1.6.4
Sending Profiles 1.6.5
Campaigns 1.6.6
Using the API 1.6.7
Reporting 1.6.8
Building Your First Campaign 1.7
Introducing the Morning Catch Corporation 1.7.1
Creating the Sending Profile 1.7.2
Importing Groups 1.7.3
Creating the Template 1.7.4
Creating the Landing Page 1.7.5
Launching the Campaign 1.7.6
Template Reference 1.8
Additional References 1.9
2
Introduction
Welcome to Gophish!
Current Version: 0.3-dev
This user guide introduces Gophish and shows how to use the software, building a complete
campaign from start to finish.
3
License
License
Gophish - Open-Source Phishing Framework
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
4
What is Gophish?
What is Gophish?
What is Gophish?
Gophish is a phishing framework that makes the simulation of real-world phishing attacks
dead-simple. The idea behind gophish is simple – make industry-grade phishing training
available to everyone. “Available” in this case means two things –
5
Installation
Installation
6
Installation
It’s a good idea to have the admin server available over HTTPS. While automatic SSL
cert/key generation will be included in a later release, for now let’s take a look at how we can
leverage openssl to generate our cert and key for use with gophish (this assumes you
already have openssl installed!)
We can start the certificate and key generation process with the following command:
openssl req -newkey rsa:2048 -nodes -keyout gophish.key -x509 -days 365 -out gophish.c
rt
Then, all we have to do is answer the CSR process that asks for details such as country,
state, etc. Since this is a local self-signed cert, these won’t matter too much to us.
This creates two files, gophish.key and gophish.crt. After moving these files into the gophish
root directory (in the same folder as config.json), we can have the following in our config.json
file:
"admin_server" : {
"listen_url" : "127.0.0.1:3333",
"use_tls" : true,
"cert_path" : "gophish.crt",
"key_path" : "gophish.key"
}
Now when we launch gophish, you’ll connect to the admin server over HTTPS and accept
the self-signed certificate warning.
Using MySQL
The default database in Gophish is SQLite. This is perfectly functional, but some
environments may benefit from leveraging a more robust database such as MySQL.
Support for Mysql has been added as of 0.3-dev. To setup Gophish for Mysql, a couple extra
steps are needed.
Update config.json
First, change the entries in config.json to match your deployment:
Example:
7
Installation
"db_name" : "mysql",
"db_path" : "root:@(:3306)/gophish?charset=utf8&parseTime=True&loc=Local",
Running Gophish
Now that you have gophish installed, you’re ready to run the software. To launch gophish,
simply open a command shell and navigate to the directory the gophish binary is located.
Then, execute the gophish binary. You will see some informational output showing both the
admin and phishing web servers starting up, as well as the database being created. This
output will tell you the port numbers you can use to connect to the web interfaces.
gophish@gophish.dev:~/src/github.com/gophish/gophish$ ./gophish
2016/01/10 23:13:42 worker.go:34: Background Worker Started Successfully - Waiting fo
r Campaigns
2016/01/10 23:13:42 models.go:64: Database not found... creating db at gophish.db
2016/01/10 23:13:42 gophish.go:49: Admin server started at http://127.0.0.1:3333
2016/01/10 23:13:42 gophish.go:51: Phishing server started at http://0.0.0.0:80
8
Getting Started
Getting Started
Running Gophish
Now that you have gophish installed, you’re ready to run the software. To launch gophish,
simply open a command shell and navigate to the directory the gophish binary is located.
Then, execute the gophish binary. You will see some informational output showing both the
admin and phishing web servers starting up, as well as the database being created. This
output will tell you the port numbers you can use to connect to the web interfaces.
gophish@gophish.dev:~/src/github.com/gophish/gophish$ ./gophish
2016/01/10 23:13:42 worker.go:34: Background Worker Started Successfully - Waiting fo
r Campaigns
2016/01/10 23:13:42 models.go:64: Database not found... creating db at gophish.db
2016/01/10 23:13:42 gophish.go:49: Admin server started at http://127.0.0.1:3333
2016/01/10 23:13:42 gophish.go:51: Phishing server started at http://0.0.0.0:80
Logging In
After Gophish starts up, you can open a browser and navigate to 127.0.0.1:3333 to reach
the login page.
Username: admin
Password: gophish
9
Getting Started
10
Documentation
11
Changing User Settings
Logging in
When you first launch gophish, you will be taken to the login page. The default credentials
are admin:gophish . Once logged in, it's encouraged to change your password.
12
Changing User Settings
By clicking the "Settings" tab, you will navigate to the settings page. This page allows you to
change your password, as well as update your API key.
To change your password, simply submit your current password, as well as the new
password you would like to use, and click "Save". Any errors will be indicated on the page.
This page also provides the ability to reset your API key, which is strongly recommended
when logging in for the first time. To reset your API key, simply click the "Reset" button next
to the existing API key.
You might need to refresh the page before continuing to use gophish. This should be fixed
soon.
13
Groups
Groups
Gophish lets you manage groups of users targeted in campaigns.
Creating Groups
To create a group, first navigate to the "Users & Groups" page in the navigation menu and
To add a group, you need to specify a unique group name, as well as at least one recipient.
14
Groups
The CSV format gophish expects has the following header values:
First Name
Last Name
Email
Position
To upload a CSV with user information, click the "Bulk Import Users" button and select the
CSV you want to upload. Users are then uploaded and displayed in the dialog.
15
Templates
Templates
A "Template" is the content of the emails that are sent to targets. They can be imported from
an existing email, or created from scratch. They also support sending attachments.
Additionally, templates can contain tracking images so that gophish knows when the user
opens the email.
Creating Templates
To create a template, first navigate to the “Email Templates” page and click the “New
Template” button.
16
Templates
A powerful feature of Gophish is the HTML editor. To switch between the HTML source code
and the visual view, click the "Source" button.
This is helpful to ensure that the email received by the user is pixel-perfect.
Importing a Site
Gophish supports the ability to import an email from the raw content. To do this, click the
"Import Email" button and paste in the original email content. This content is usually found
through the "View Original" feature of many mail clients:
17
Templates
18
Landing Pages
Landing Pages
Landing pages are the actual HTML pages that are returned to the users when they click the
phishing links they receive.
Landing pages support templating, capturing credentials, and redirecting users to another
website after they submit their credentials.
To create a landing page, click on the "Landing Pages" entry in the sidebar and click the
"New Page" button.
The landing page modal supports the same HTML WYSIWYG editor shown in the Templates
section.
19
Landing Pages
After entering the URL and clicking "Import", you should see the HTML of the URL populated
into the editor.
Capturing Credentials
Gophish makes it easy to capture credentials from the landing page. To capture credentials,
simply select the checkbox that says "Capture Submitted Data".
Note: Credentials are stored in plaintext. If you don't want to capture passwords, don't
select the "Capture Passwords" checkbox. Gophish will still capture other text fields,
such as usernames.
Redirecting Users
Red team assessments are all about preventing suspicion. To prevent users from becoming
suspicious after entering credentials, you may want to redirect them to the original URL.
Gophish makes it easy to redirect users after they submit credentials. To redirect users,
enter a URL in the "Redirect To:" text field that appears after the "Capture Submitted Data"
checkbox is selected.
Static Assets
20
Landing Pages
There may be times that you want to store assets such as HTML pages, CSS/JS resources
or other static files. To use these in Gophish, just move them under the static/endpoint
directory. You can then reference them using the URL
http[s]://phishing_server/static/filename . For more background, see this issue.
21
Sending Profiles
Sending Profiles
To send emails, Gophish requires you to configure SMTP relay details called "Sending
Profiles".
To setup a sending profile, click the "Sending Profiles" navigation entry in the sidebar and
click the "New Profile" button.
Note: If you're looking for a good testing SMTP server, I've had good luck with Mailhog.
It's important to make sure that your "From" address is a valid email address format.
Additionally, make sure you setup your "Host" in the full host:port format.
To test your SMTP configuration, you can click the "Send Test Email" button:
22
Sending Profiles
After entering the recipient details and clicking "Send", you should see a message indicating
if the email was sent successfully.
23
Campaigns
Campaigns
Gophish is centered around launching campaigns. This involves sending emails to one or
more groups and monitoring for opened emails, clicked links, or submitted credentials.
Launching a Campaign
To configure and launch a campaign, click the "Campaigns" entry in the navigation sidebar.
Most of the fields should be self-explanatory. Gophish has autocompletion setup for many of
the fields that are selecting from existing objects (such as landing pages, templates, etc.).
The URL field is what populates the {{.URL}} template value. This should be a URL or IP
address that points to the Gophish phishing server and is reachable by the recipient.
24
Campaigns
Since version 0.2, Gophish supports scheduling campaigns, making it easy to plan
campaigns in advance.
After you have the campaign configuration ready to go, click the "Launch Campaign" button,
click through the confirmation message, and you're good to go!
On the results page, you will see overview information on the campaign status as well as
detailed results for each target.
25
Campaigns
Raw Events - Contains a stream of events as they occurred during the campaign.
Completing a Campaign
To complete a campaign, click the "Complete" button and confirm that you want to mark the
campaign as completed.
Deleting a Campaign
To delete a campaign, click the "Delete" button and confirm that you want to delete the
campaign.
To view the timeline for each recipient, expand the row with the recipient's name.
26
Campaigns
27
Using the API
28
Reporting
Reporting
Reporting is an important part of any Gophish campaign. To help facilitate generating
reports, there are a few options you could consider:
In addition to providing the results in the dashboard, you have the option to export the raw
logs from Gophish using the "Export CSV" button at the top of the page. You could then
parse these CSV files using other software such as Excel or Google Sheets.
Using GoReport
Gophish has an incredible community that has built tools around the API to help make
reporting easy. A great example of this is called GoReport.
29
Reporting
GoReport, created by Github user @chrismaddalena, provides a really simple, clean way to
generate reports for a given Gophish campaign. You can use this script to generate reports
for the campaign in either CSV or DOCX format.
We have a Python API client that can help facilitate getting the data you need from the API.
You can find the documentation for the Python API client here.
30
Introducing the Morning Catch Corporation
For this documentation, we will step through the process of setting up users, templates, and
a full campaign from scratch for a fake company called Morning Catch. In this case, we are
assuming the role of a security administrator of Morning Catch and have been given the
authorization to perform this training.
As a note, this fake company is based on a great VM used specifically for testing phishing
frameworks that you can download here if you're interested.
The fake company will consist of 3 users: Richard Bourne, Boyd Jenius, and Haiti Moreo.
31
Creating the Sending Profile
For my campaign, I'll be sending emails from Boyd Jenius, the system administrator. I'll use
his name and email address in the "From" field.
I have my Morning Catch VM listening for inbound email on 192.168.56.101:25 so I will use
that for my "Host".
Remember: Always specify the port number when configuring a sending profile! Use
the host:port format when specifying the Host.
32
Creating the Sending Profile
If you want, you can send a test email to another recipient on the morningcatch.ph domain
to ensure emails are relayed correctly.
33
Importing Groups
Importing Groups
The first thing we need to do before we can launch a campaign is to figure out who to target.
There are a ton of ways to gather/generate email addresses for potential targets. You can
either harvest email addresses from public information using OSINT if you are aiming to
simulate a realistic scenario.
Now that we have our list of users, let’s import them into gophish.
To add a group, navigate to the “Users & Groups” page and click “New Group”:
Since we are performing phishing simulation for Morning Catch, we can call our group
“Morning Catch Employees”.
Now we have to add the members. There are two ways to do this:
Add each member’s details one at a time using the form inputs
Bulk import the group from a CSV file
34
Importing Groups
First Name
Last Name
Email
Position
So, the CSV for Morning Catch would look like the following:
After uploading this CSV using the “Bulk Import Users” button, we see that our members
were added automatically:
After clicking “Save changes”, we see a confirmation message that our group was created.
Tip: If you don’t see the group show up right away, refresh the page and it should
appear in the table.
35
Importing Groups
36
Creating the Template
We notice that Morning Catch comes with a webmail portal. Let’s craft a simple template that
suggests the user needs to go reset their password. Obviously, this is a simple scenario, and
by using the "Import Email" feature, you can import existing emails directly into gophish for a
greater effect.
37
Creating the Template
You'll notice we used the {{.Email}} template value. This will populate with the target's
email address when the emails are sent. This is Gophish's way to tailor emails to individuals
to increase the chance of success.
By clicking the "HTML" tab, we will see the editor we can use to create our HTML content:
Since our content is pretty simple, we can just click the "Source" button and be taken to the
more visual editor, which will be enough for our purposes:
Our template will be simple for the sake of demonstration. I'll start by adding the message:
{{.FirstName}},
The password for {{.Email}} has expired. Please reset your password here.
Thanks,
Morning Catch IT Team
38
Creating the Template
Speaking of links, now we need to add our phishing link. Highlight the word "here" and click
the chain icon in the menu, exposing the "Link" dialog. In this dialog, we'll set the link to
{{.URL}} , another template value, so that our link is automatically created and inserted into
the email.
Finally, make sure the "Add Tracking Image" checkbox is checked, and click "Save
Template".
39
Creating the Landing Page
Start by navigating to the "Landing Pages" page and clicking the "New Page" button.
To import a site by URL, click the "Import Site" button. The webmail portal is located at
/mail/ , so I will use http://192.168.56.101/mail/ as my import URL.
After the import, you'll see the HTML populated into the editor. Clicking the "Source" button
shows a preview of the page.
40
Creating the Landing Page
Finally, we'll capture submitted data and passwords by checking both options, and we'll
redirect users to the webmail portal after they submit credentials.
41
Launching the Campaign
To create a new campaign, navigate to the Campaigns page and click the "New Campaign"
button.
Most of the settings should be self-explanatory. The only thing to look out for is the URL
field. Since the IP address of our Gophish server is 192.168.1.1 , that's what we'll use:
Once all the settings filled, click "Launch Campaign" to start sending the emails!
42
Launching the Campaign
After launching the campaign, you will be automatically redirected to the campaign results
page. This will give you a realtime view as emails are sent, opened, and links are clicked.
43
Template Reference
Template Reference
The following variables are available in templates and landing pages:
Variable Description
{{.FirstName}} The target's first name
44
Additional References
The reference, "Simulated Phishing Educational Guide", takes a deep-dive into setting up a
production Gophish instance from scratch leveraging Amazon EC2.
45
THE End!!!