Combination of evilginx2 and GoPhish.
Before I begin, I would like to say that I am in no way bashing Kuba Gretzky and his work. I thank him personally for releasing evilginx2 to the public. In fact, without his work this work would not exist. I must also thank Jordan Wright for developing/maintaining the incredible GoPhish toolkit.
You should have a fundamental understanding of how to use GoPhish
, evilginx2
, and Apache2
.
I shall not be responsible or liable for any misuse or illegitimate use of this software. This software is only to be used in authorized penetration testing or red team engagements where the operator(s) has(ve) been given explicit written permission to carry out social engineering.
As a penetration tester or red teamer, you may have heard of evilginx2
as a proxy man-in-the-middle framework capable of bypassing two-factor/multi-factor authentication
. This is enticing to us to say the least, but when trying to use it for social engineering engagements, there are some issues off the bat. I will highlight the two main problems that have been addressed with this project, although some other bugs have been fixed in this version which I will highlight later.
- Lack of tracking -
evilginx2
does not provide unique tracking statistics per victim (e.g. opened email, clicked link, etc.), this is problematic for clients who want/need/pay for these statistics when signing up for a social engineering engagement. - Session overwriting with NAT and proxying -
evilginx2
bases a lot of logic off of remote IP address and will whitelist an IP for 10 minutes after the victim triggers a lure path.evilginx2
will then skip creating a new session for the IP address if it triggers the lure path again (if still in the 10 minute window). This presents issues for us if our victims are behind a firewall all sharing the same public IP address, as the same session withinevilginx2
will continue to overwrite with multiple victim's data, leading to missed and lost data. This also presents an issue for our proxy setup, sincelocalhost
is the only IP address requestingevilginx2
.
In this setup, GoPhish
is used to send emails and provide a dashboard for evilginx2
campaign statistics, but it is not used for any landing pages. Your phishing links sent from GoPhish
will point to an evilginx2
lure path and evilginx2
will be used for landing pages. This provides the ability to still bypass 2FA/MFA
with evilginx2
, without losing those precious stats. Apache2
is simply used as a proxy to the local evilginx2
server and an additional hardening layer for your phishing infrastructure. Realtime campaign event notifications have been provided with a local websocket/http server I have developed and full usable JSON
strings containing tokens/cookies from evilginx2
are displayed directly in the GoPhish
GUI (and feed):
evilginx2
will listen locally on port8443
GoPhish
will listen locally on port8080
and3333
Apache2
will listen on port443
externally and proxy to localevilginx2
server- Requests will be filtered at
Apache2
layer based on redirect rules and IP blacklist configuration- Redirect functionality for unauthorized requests is still baked into
evilginx2
if a request hits theevilginx2
server
- Redirect functionality for unauthorized requests is still baked into
- Requests will be filtered at
setup.sh
has been provided to automate the needed configurations for you. Once this script is run and you've fed it the right values, you should be ready to get started. Below is the setup help (note that certificate setup is based on letsencrypt
filenames):
Usage:
./setup <root domain> <evilginx2 subdomain(s)> <evilginx2 root domain bool> <redirect url> <feed bool> <rid replacement>
- root domain - the root domain to be used for the campaign
- evilginx2 subdomains - a space separated list of evilginx2 subdomains, can be one if only one
- evilginx2 root domain bool - true or false to proxy root domain to evilginx2
- redirect url - URL to redirect unauthorized Apache requests
- feed bool - true or false if you plan to use the live feed
- rid replacement - replace the gophish default "rid" in phishing URLs with this value
Example:
./setup.sh example.com "accounts myaccount" false https://redirect.com/ true user_id
Redirect rules have been included to keep unwanted visitors from visiting the phishing server as well as an IP blacklist. The blacklist contains IP addresses/blocks owned by ProofPoint, Microsoft, TrendMicro, etc. Redirect rules will redirect known "bad" remote hostnames as well as User-Agent strings.
In case you ran setup.sh
once and already replaced the default RId
value throughout the project, replace_rid.sh
was created to replace the RId
value again.
Usage:
./replace_rid <previous rid> <new rid>
- previous rid - the previous rid value that was replaced
- new rid - the new rid value to replace the previous
Example:
./replace_rid.sh user_id client_id
Once setup.sh
is run, the next steps are:
- Start
GoPhish
and configure email template, email sending profile, and groups - Start
evilginx2
and configure phishlet and lure (must specify full path toGoPhish
sqlite3
database with-g
flag) - Ensure
Apache2
server is started - Launch campaign from
GoPhish
and make the landing URL your lure path forevilginx2
phishlet - PROFIT
An entire reworking of GoPhish
was performed in order to provide SMS
campaign support with Twilio
. Your new evilgophish
dashboard will look like below:
Once you have run setup.sh
, the next steps are:
- Configure
SMS
message template. You will useText
only when creating aSMS
message template, and you should not include a tracking link as it will appear in theSMS
message. LeaveEnvelope Sender
andSubject
blank like below:
- Configure
SMS Sending Profile
. Enter your phone number fromTwilio
,Account SID
,Auth Token
, and delay in between messages into theSMS Sending Profiles
page:
- Import groups. The
CSV
template values have been kept the same for compatibility, so keep theCSV
column names the same and place your target phone numbers into theEmail
column. Note thatTwilio
accepts the following phone number formats, so they must be in one of these three:
- Start
evilginx2
and configure phishlet and lure (must specify full path toGoPhish
sqlite3
database with-g
flag) - Ensure
Apache2
server is started - Launch campaign from
GoPhish
and make the landing URL your lure path forevilginx2
phishlet - PROFIT
Realtime campaign event notifications are handled by a local websocket/http server and live feed app. To get setup:
-
Select
true
forfeed bool
when runningsetup.sh
-
cd
into theevilfeed
directory and start the app with./evilfeed
-
When starting
evilginx2
, supply the-feed
flag to enable the feed. For example:
./evilginx2 -feed -g /opt/evilgophish/gophish/gophish.db
- You can begin viewing the live feed at:
http://localhost:1337/
. The feed dashboard will look like below:
IMPORTANT NOTES
- The live feed page hooks a websocket for events with
JavaScript
and you DO NOT need to refresh the page. If you refresh the page, you will LOSE all events up to that point.
Included in the evilginx2/phishlets
folder are three custom phishlets not included in evilginx2.
o3652
- modified/updated version of the originalo365
(stolen from Optiv blog)google
- updated from previous examples online (has issues, don't use in live campaigns)knowbe4
- custom (don't have access to an account for testing auth URL, works for single-factor campaigns, have not fully tested MFA)
I feel like the world has been lacking some good phishlet examples lately. It would be great if this repository could be a central repository for the latest phishlets. Send me your phishlets at fin3ss3g0d@pm.me
for a chance to end up in evilginx2/phishlets
. If you provide quality work, I will create a Phishlets Hall of Fame
and you will be added to it.
- All IP whitelisting functionality removed, new proxy session is established for every new visitor that triggers a lure path regardless of remote IP
- Fixed issue with phishlets not extracting credentials from
JSON
requests - Further "bad" headers have been removed from responses
- Added logic to check if
mime
type was failed to be retrieved from responses - All
X
headers relating toevilginx2
have been removed throughout the code (to remove IOCs)
- All
X
headers relating toGoPhish
have been removed throughout the code (to remove IOCs) - Custom 404 page functionality, place a
.html
file named404.html
intemplates
folder (example has been provided) - Default
rid
string in phishing URLs is chosen by the operator insetup.sh
- Transparency endpoint and messages completely removed
- Added
SMS
Campaign Support
See the CHANGELOG.md
file for changes made since the initial release.
I am taking the same stance as Kuba Gretzky and will not help creating phishlets. There are plenty of examples of working phishlets and for you to create your own, if you open an issue for a phishlet it will be closed. I will also not consider issues with your Apache2
, DNS
, or certificate setup as legitimate issues and they will be closed. However, if you encounter a legitimate failure/error with the program, I will take the issue seriously.
- Additions to IP blacklist and redirect rules
- Add more phishlets
I would like to see this project improve and grow over time. If you have improvement ideas, new redirect rules, new IP addresses/blocks to blacklist, phishlets, or suggestions, please email me at: fin3ss3g0d@pm.me
or open a pull request.