Skip to content

Instantly share code, notes, and snippets.

@chosenonehacks
Last active March 8, 2023 12:49
Show Gist options
  • Save chosenonehacks/62cf0ab7dd0f8eaed7af0c923f60f6f5 to your computer and use it in GitHub Desktop.
Save chosenonehacks/62cf0ab7dd0f8eaed7af0c923f60f6f5 to your computer and use it in GitHub Desktop.
Get sneaky GoPhish
#!/bin/bash
#before you proceed get latest GO and install it
#https://gist.github.com/chosenonehacks/6d7a2ccecf3ec21113ecbfdd58ceb4ac
#clone gophish
git clone https://github.com/gophish/gophish
#Get a Custom 404 Page
wget "https://raw.githubusercontent.com/chosenonehacks/sneaky_gophish/main/files/404.html" -O "404.html"
#Get a Custom Phish.go
wget "https://raw.githubusercontent.com/chosenonehacks/sneaky_gophish/main/files/phish.go" -O "phish.go"
#copy modified custom Phish.go
rm gophish/controllers/phish.go
mv phish.go gophish/controllers/phish.go
#Copy new 404.html
mv 404.html gophish/templates/404.html
cd gophish
sed -i 's/X-Gophish-Contact/X-Contact/g' models/email_request_test.go
sed -i 's/X-Gophish-Contact/X-Contact/g' models/maillog.go
sed -i 's/X-Gophish-Contact/X-Contact/g' models/maillog_test.go
sed -i 's/X-Gophish-Contact/X-Contact/g' models/email_request.go
# Stripping X-Gophish-Signature
sed -i 's/X-Gophish-Signature/X-Signature/g' webhook/webhook.go
# Changing servername
sed -i 's/const ServerName = "gophish"/const ServerName = "IGNORE"/' config/config.go
# Changing rid value
# Set your own campaign paramter different from default RID (or uncoment read)
# read -p 'Custom RID Parameter: ' uservar
sed -i 's/const RecipientParameter = "rid"/const RecipientParameter = "login"/g' models/campaign.go
go build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment