How to install MySQL<\/a><\/p>\n\n\n\nWe are using MariaDB in this guide. Steps should be same, either way!<\/p>\n\n\n\n
Create Gophish Database and Database User<\/h4>\n\n\n\n Login to the MariaDB\/MySQL server using the command line or a database management tool such as phpMyAdmin. Once logged in, execute the following commands to create a new database and a user for Gophish:<\/p>\n\n\n\n
CREATE DATABASE gophish; CREATE USER 'gophishuser'@'localhost' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON gophish.* TO 'gophishuser'@'localhost';<\/code><\/pre>\n\n\n\nReplace Database name, ‘gophish<\/code><\/strong>‘, the user, ‘gophishuser<\/code><\/strong>‘ and the password, ‘password<\/code><\/strong>‘ with a strong password for the Gophish user.<\/p>\n\n\n\nTo configure Gophish to use MariaDB\/MySQL, open the configuration file located at \/opt\/gophish\/config.json<\/code><\/strong> using a text editor.<\/p>\n\n\n\nsudo vim \/opt\/gophish\/config.json<\/code><\/pre>\n\n\n\nFind the “db_name” and “db_path”;<\/p>\n\n\n\n
\"db_name\": \"sqlite3\",\n \"db_path\": \"gophish.db\",<\/code><\/pre>\n\n\n\nAnd update with the appropriate values. The format for the db_path<\/code> entry is username:password@(host:port)\/database?charset=utf8&parseTime=True&loc=UTC<\/code>.<\/p>\n\n\n\n \"db_name\": \"mysql<\/strong>\",\n \"db_path\": \"gophishuser:password@(localhost:3306)\/gophish?charset=utf8&parseTime=True&loc=UTC<\/strong>\",<\/code><\/pre>\n\n\n\nSave the changes and exit the text editor.<\/p>\n\n\n\n
Restart Gophish<\/h4>\n\n\n\n Finally, restart the Gophish service for the changes to take effect:<\/p>\n\n\n\n
sudo systemctl restart gophish<\/code><\/pre>\n\n\n\nGophish will now be configured to use the MariaDB\/MySQL database.<\/p>\n\n\n\n
\u25cf gophish.service - Gophish, an open-source phishing toolkit\n Loaded: loaded (\/etc\/systemd\/system\/gophish.service; enabled; vendor preset: enabled)\n Active: active (running) since Mon 2023-09-11 15:54:56 UTC; 14s ago\n Docs: https:\/\/getgophish.com\/documentation\/\n Main PID: 1548 (sh)\n Tasks: 5 (limit: 2219)\n Memory: 2.3M\n CPU: 10ms\n CGroup: \/system.slice\/gophish.service\n \u251c\u25001548 \/bin\/sh -c \"\/opt\/gophish\/gophish >>\/var\/log\/gophish\/gophish.log 2>>\/var\/log\/gophish\/gophish.log\"\n \u2514\u25001549 \/opt\/gophish\/gophish\n\nSep 11 15:54:56 jammy systemd[1]: Started Gophish, an open-source phishing toolkit.\n<\/code><\/pre>\n\n\n\nThat’s it! You have successfully configured Gophish to use MariaDB\/MySQL as the database backend.<\/p>\n\n\n\n
It is prudent to enable HTTPS connection for Gophish.<\/p>\n\n\n\n
To proceed, ensure that you have SSL\/TLS your certificates. We are using our Let’s Encrypt certificates in this guide.<\/p>\n\n\n\n
sudo vim \/opt\/gophish\/config.json<\/code><\/pre>\n\n\n\nI will update this configuration;<\/p>\n\n\n\n
\"admin_server\": {\n \"listen_url\": \"127.0.0.1:3333\",\n \"use_tls\": true,\n \"cert_path\": \"gophish_admin.crt\",\n \"key_path\": \"gophish_admin.key\",\n \"trusted_origins\": []\n },\n \"phish_server\": {\n \"listen_url\": \"0.0.0.0:80\",\n \"use_tls\": false,\n \"cert_path\": \"example.crt\",\n \"key_path\": \"example.key\"\n },\n<\/code><\/pre>\n\n\n\nto;<\/p>\n\n\n\n
\"admin_server\": {\n \"listen_url\": \"0.0.0.0:3333\",\n \"use_tls\": true,\n \"cert_path\": \"\/opt\/gophish\/ssl\/fullchain.pem\",\n \"key_path\": \"\/opt\/gophish\/ssl\/privkey.pem\",\n \"trusted_origins\": []\n },\n \"phish_server\": {\n \"listen_url\": \"0.0.0.0:443\",\n \"use_tls\": true,\n \"cert_path\": \"\/opt\/gophish\/ssl\/fullchain.pem\",\n \"key_path\": \"\/opt\/gophish\/ssl\/privkey.pem\"\n },\n<\/code><\/pre>\n\n\n\nWe copied Let’s Encrypt ssl certs to \/opt\/gophish\/ss<\/strong>l directory and set owner to gophish<\/strong> user;<\/p>\n\n\n\nls -alh \/opt\/gophish\/ssl\/<\/code><\/pre>\n\n\n\ntotal 20K\ndrwxr-xr-x 2 gophish gophish 4.0K Sep 11 16:36 .\ndrwxr-xr-x 6 gophish gophish 4.0K Sep 11 16:40 ..\n-rw-r--r-- 1 gophish gophish 5.2K Sep 11 16:34 fullchain.pem\n-rw------- 1 gophish gophish 241 Sep 11 16:36 privkey.pem\n<\/code><\/pre>\n\n\n\nFinally, restart the Gophish service for the changes to take effect:<\/p>\n\n\n\n
sudo systemctl restart gophish<\/code><\/pre>\n\n\n\nVerify Gophish Admin server HTTPS connection.<\/p>\n\n\n\n <\/figure>\n\n\n\nSimilarly, the Phish server https connection;<\/p>\n\n\n\n <\/figure>\n\n\n\nThat marks the end of our tutorial on how to install Gophish on Debian 12.<\/p>\n\n\n\n
Further Reading: Gophish Documentations<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"In this guide, you will learn how to install Gophish on Debian 12. Gophish is a powerful open-source phishing framework that enables organizations to quickly and easily<\/p>\n","protected":false},"author":10,"featured_media":18758,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[34,121,889],"tags":[7239,7238],"class_list":["post-18752","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","category-howtos","category-phishing","tag-debian-12-install-gophish","tag-install-gophish-on-debian-12","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/18752"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=18752"}],"version-history":[{"count":16,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/18752\/revisions"}],"predecessor-version":[{"id":20848,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/18752\/revisions\/20848"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/18758"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=18752"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=18752"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=18752"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}