Hi guys,
I tried to find the Gophish 404 page but without success.
I want to modify the HTML to customize the page or redirect to the legit page.
If a user decides to check the index page of the domain I am using to impersonate a company, he would see a dodgy 404.
Any idea here?
thanks
mantis
Search this Github for Page not found, find 'page not found', change this.
https://github.com/gophish/gophish/search?utf8=%E2%9C%93&q=404+page+not+found&type=
Unfortunately, it looks like it'll be a bit tricky due to the way this all works. We fallback to the 404 page in Golang's standard library, which is the generic text you see: https://golang.org/src/net/http/server.go?s=58991:59034#L1954
I've been looking through the stdlib as well as mux - the router we use, and there doesn't seem to be a super clear way to go about specifying a custom handler. It's possible if someone requests something that actually doesn't exist like /bogus, but it's harder since there are places within the code where we manually call http.NotFound.
It's possible that for your case you could create a custom HTTP handler and replace the calls to http.NotFound to call your handler instead. I think this is the place in the code you'd be looking for.
Going ahead and closing this out since there isn't any plans to support a custom 404 page at this time and the original question appears to have been answered.
@mantis-le-sin don't hesitate to let us know if you encounter any other issues! Thanks again for getting in touch.
@jordan-wright , It appears to be this line: "https://github.com/gophish/gophish/blob/ebb6cd61b202d3893eee58ad2d65235042260ce8/models/campaign.go#L118". Is it possible to just get the content of a html file in /static/endpoint or something similar? It would be a lot more convincing if you put a website clone in /static/endpoint/ and point the 404 page to that.
Most helpful comment
@jordan-wright , It appears to be this line: "https://github.com/gophish/gophish/blob/ebb6cd61b202d3893eee58ad2d65235042260ce8/models/campaign.go#L118". Is it possible to just get the content of a html file in /static/endpoint or something similar? It would be a lot more convincing if you put a website clone in /static/endpoint/ and point the 404 page to that.