Skip to content

Commit

Permalink
Changed string() to strconv.FormatUint()
Browse files Browse the repository at this point in the history
  • Loading branch information
domwhewell-sage committed May 8, 2024
1 parent fe81187 commit d11f6f3
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"html/template"
"net/url"
"strings"
"strconv"

"github.com/ashwanthkumar/slack-go-webhook"
log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -134,11 +135,15 @@ func (w SubmittedDetails) SendEmail() error {
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
output = "\nUsername: " + w.Username + "\nPassword: " + w.Password
}
oplog_entry := ghostwriter_oplog_entry{
SourceIp: w.Address,
UserContext: w.Email,
Description: "User ID: " + w.ID + "\nCampaign ID: " + strconv.FormatUint(uint64(w.CampaignID), 10),
Output: output,
Comments: SubmittedData
}
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 @@ -188,7 +193,13 @@ func (w ClickDetails) SendEmail() error {
}

func (w ClickDetails) SendGraphql() error {
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}
oplog_entry := ghostwriter_oplog_entry{
SourceIp: w.Address,
UserContext: w.Email,
Description: "User ID: " + w.ID + "\nCampaign ID: " + strconv.FormatUint(uint64(w.CampaignID), 10),
Output: "UserAgent: " + w.UserAgent,
Comments: ClickedLink
}
return sendGraphql(oplog_entry)
}

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

func (w OpenedDetails) SendGraphql() error {
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}
oplog_entry := ghostwriter_oplog_entry{
SourceIp: w.Address,
UserContext: w.Email,
Description: "User ID: " + w.ID + "\nCampaign ID: " + strconv.FormatUint(uint64(w.CampaignID), 10),
Output: "UserAgent: " + w.UserAgent,
Comments: EmailOpened
}
return sendGraphql(oplog_entry)
}

0 comments on commit d11f6f3

Please sign in to comment.