Commit Graph

9 Commits (4d7910fec8c47110b30caf9694b22d73d1074cc4)

Author SHA1 Message Date
Glenn Wilkinson 095a9ba20c Updated README.md with working source installation instructions (see https://github.com/golang/go/issues/48332) 2022-09-29 13:21:31 +01:00
Jordan Wright 120e232cfe Removing accidental dependencies to revert to 3c490dbadb 2020-10-11 17:49:37 -05:00
Jordan Wright 23154126de Made error handling in the case of a client IP without a port more graceful, so that the ratelimiter doesn't return an error if X-Forwarded-For or X-Real-IP is set. 2020-10-11 17:18:33 -05:00
Jordan Wright b01bd6cbc0 Updated github.com/jordan-wright/email dependency 2020-08-24 13:15:16 -05:00
Jordan Wright e3352f481e
Implement SSRF Mitigations (#1940)
Initial commit of SSRF mitigations.

This fixes #1908 by creating a *net.Dialer which restricts outbound connections to only allowed IP ranges. This implementation is based on the blog post at https://www.agwa.name/blog/post/preventing_server_side_request_forgery_in_golang

To keep things backwards compatible, by default we'll only block connections to 169.254.169.254, the link-local IP address commonly used in cloud environments to retrieve metadata about the running instance. For other internal addresses (e.g. localhost or RFC 1918 addresses), it's assumed that those are available to Gophish.

To support more secure environments, we introduce the `allowed_internal_hosts` configuration option where an admin can set one or more IP ranges in CIDR format. If addresses are specified here, then all internal connections will be blocked except to these hosts.

There are various bits about this approach I don't really like. For example, since various packages all need this functionality, I had to make the RestrictedDialer a global singleton rather than a dependency off of, say, the admin server. Additionally, since webhooks are implemented via a singleton, I had to introduce a new function, `SetTransport`.

Finally, I had to make an update in the gomail package to support a custom net.Dialer.
2020-08-20 09:36:18 -05:00
Jordan Wright bb7de8df3e
Initial Implementation of a Password Policy (#1867)
This PR adds the initial work to implement a password policy as defined in #1538.

Specifically, this implements the following

* Rate limiting for the login handler
* Implementing the ability for system admins to require a user to reset their password
* Implementing a password policy that requires passwords to be a minimum of 8 characters
* Removes the default password (gophish) for admin users to instead have the password randomly generated when Gophish first starts up
* Adds a password strength meter when choosing a new password

Fixes #1538
2020-06-19 22:03:51 -05:00
Jordan Wright 61bbb22f7c Updating the modules used for IMAP and email support
$ go get -u github.com/jordan-wright/email
$ go build
$ go mod tidy
2020-06-16 20:10:12 -05:00
Jordan Wright 8162a80cb1
Improve the Performance of Sending Emails (#1753)
Adding the ability to cache campaigns on maillogs to greatly improve generation time (and, by extension, sending speed and memory usage).
2020-02-29 20:19:54 -06:00
Jordan Wright 1733da1fa8 Creating go.mod and go.sum files to establish Gophish as a Go module. 2020-02-02 21:44:25 -06:00