Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion internal/pwnboard/send_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"fmt"
"net/http"
"os"
"strconv"
"strings"
)

// This should be the URL/IP of the pwnboard instance that SendUpdate
Expand All @@ -18,9 +20,17 @@ type Data struct {
Type string `json:"type"` // Describes what implant pwnboard is being updated from
}

// Handles error if obtaining environment variable fails
func CheckEnvVariable(pwnboard string, err bool) {
if (len(strings.TrimSpace(pwnboard)) == 0) || (err != false) {
os.Stderr.WriteString("ERROR: Failed to find environment variable")
os.Stderr.WriteString(strconv.FormatBool(err) + "\n")
return
}
}

// Sends a post request with information about a target to pwnboard.
func SendUpdate(ip string, info string) {

//use the Data struct to organize the data that will be sent to pwnboard
data := Data{
IPs: ip,
Expand Down