Skip to content

Commit

Permalink
Allow sending email to ghostwriter
Browse files Browse the repository at this point in the history
  • Loading branch information
domwhewell-sage committed May 8, 2024
1 parent b943171 commit fe81187
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ email:
# Ghostwriter Profile
ghostwriter:
# Ghostwriter graphql endpoint
graphql_endpoint: http://localhost:4000/graphql
graphql_endpoint: 'https://ghostwriter/v1/graphql'
# Ghostwriter API key
api_key: deadbeef
api_key: 'deadbeef'
# Oplog ID
oplog_id: 1
# (Optional) Disable email, username, and credentials from being sent to ghostwriter
Expand Down
14 changes: 4 additions & 10 deletions messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ func (w SubmittedDetails) SendGraphql() error {
var output string
if !viper.GetBool("ghostwriter.disable_credentials") {
output = "Email: " + w.Email + "\nUsername: " + w.Username + "\nPassword: " + w.Password
} else {
output = "Email: " + w.Email
}
oplog_entry := ghostwriter_oplog_entry{SourceIp: w.Address, UserContext: w.UserAgent, Description: "User ID: " + string(w.ID) + "\nCampaign ID: " + string(w.CampaignID), Output: output, Comments: SubmittedData}
return sendGraphql(oplog_entry)
Expand Down Expand Up @@ -186,11 +188,7 @@ func (w ClickDetails) SendEmail() error {
}

func (w ClickDetails) SendGraphql() error {
var output string
if !viper.GetBool("ghostwriter.disable_credentials") {
output = "Email: " + w.Email
}
oplog_entry := ghostwriter_oplog_entry{SourceIp: w.Address, UserContext: w.UserAgent, Description: "User ID: " + string(w.ID) + "\nCampaign ID: " + string(w.CampaignID), Output: output, Comments: ClickedLink}
oplog_entry := ghostwriter_oplog_entry{SourceIp: w.Address, UserContext: w.UserAgent, Description: "User ID: " + string(w.ID) + "\nCampaign ID: " + string(w.CampaignID), Output: "Email: " + w.Email, Comments: ClickedLink}
return sendGraphql(oplog_entry)
}

Expand Down Expand Up @@ -252,10 +250,6 @@ func (w OpenedDetails) SendEmail() error {
}

func (w OpenedDetails) SendGraphql() error {
var output string
if !viper.GetBool("ghostwriter.disable_credentials") {
output = "Email: " + w.Email
}
oplog_entry := ghostwriter_oplog_entry{SourceIp: w.Address, UserContext: w.UserAgent, Description: "User ID: " + string(w.ID) + "\nCampaign ID: " + string(w.CampaignID), Output: output, Comments: EmailOpened}
oplog_entry := ghostwriter_oplog_entry{SourceIp: w.Address, UserContext: w.UserAgent, Description: "User ID: " + string(w.ID) + "\nCampaign ID: " + string(w.CampaignID), Output: "Email: " + w.Email, Comments: EmailOpened}
return sendGraphql(oplog_entry)
}

0 comments on commit fe81187

Please sign in to comment.