rcmaehl Posted February 2, 2023 Share Posted February 2, 2023 (edited) Hey all, Recently I've been working on minimizing false positives in my latest project. The biggest change so far that helped was removing INetGet which helps the compiled script consistently stay around 3 false positives instead of occasionally jumping up to 6-7. Are there any recommend alternatives for INetGet or is just downloading an executable update from the internet that sketchy for AVs? Here was the code excerpt in question that I've since commented out: Case "/u", "/update" Select Case UBound($CmdLine) = 2 InetGet("https://fcofix.org/MSEdgeRedirect/releases/latest/download/MSEdgeRedirect.exe", @ScriptDir & "\MSEdgeRedirect_Latest.exe") _ArrayDelete($CmdLine, 1) Case UBound($CmdLine) > 2 And $CmdLine[2] = "dev" InetGet("https://nightly.link/rcmaehl/MSEdgeRedirect/workflows/mser/main/mser.zip", @ScriptDir & "\MSEdgeRedirect_dev.zip") _ArrayDelete($CmdLine, "1-2") Case UBound($CmdLine) > 2 And $CmdLine[2] = "release" InetGet("https://fcofix.org/MSEdgeRedirect/releases/latest/download/MSEdgeRedirect.exe", @ScriptDir & "\MSEdgeRedirect_Latest.exe") _ArrayDelete($CmdLine, "1-2") Case StringLeft($CmdLine[2], 1) = "/" InetGet("https://fcofix.org/MSEdgeRedirect/releases/latest/download/MSEdgeRedirect.exe", @ScriptDir & "\MSEdgeRedirect_Latest.exe") _ArrayDelete($CmdLine, 1) Case Else MsgBox(0, _ "Invalid", _ 'Invalid release type - "' & $CmdLine[2] & "." & @CRLF) Exit 87 ; ERROR_INVALID_PARAMETER EndSelect Thanks in advance! Edited February 2, 2023 by rcmaehl My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.My Projects WhyNotWin11Cisco Finesse, Github, IRC UDF, WindowEx UDF Link to comment Share on other sites More sharing options...
mistersquirrle Posted February 2, 2023 Share Posted February 2, 2023 You should check out The WinHTTP functions: https://github.com/dragana-r/autoit-winhttp/releases Alternatively, you can also try out using the WinHTTP.WinHTTPRequest.5.1 object: https://learn.microsoft.com/en-us/windows/win32/winhttp/winhttprequest The WinHTTP UDF linked above is basically using this, though through DLLs directly instead of through the object Something like this though for the object: ; https://learn.microsoft.com/en-us/windows/win32/winhttp/winhttprequest Local $sURL = "http://ipv4.download.thinkbroadband.com/5MB.zip" Local $oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1") $oHTTP.Open("GET", $sURL, False) If (@error) Then ConsoleWrite('$oHTTP.Open error: ' & @error & @CRLF) EndIf $oHTTP.Send() If (@error) Then ConsoleWrite('$oHTTP.Send error: ' & @error & @CRLF) EndIf If ($oHTTP.Status <> 200) Then ConsoleWrite('$oHTTP.Status <> 200: ' & $oHTTP.Status & @CRLF) EndIf ConsoleWrite('$oHTTP.ResponseBody ('&stringlen($oHTTP.ResponseBody)&'): ' & StringLeft($oHTTP.ResponseBody, 1000) & @CRLF) ConsoleWrite('$oHTTP.ResponseText ('&stringlen($oHTTP.ResponseText)&'): ' & StringLeft($oHTTP.ResponseText, 1000) & @CRLF) FileWrite('test.zip', $oHTTP.ResponseBody) This should save a 5MB .zip file in your script directory. The .zip file is not meant to be opened: "These files are made of random data, and although listed as zip files, will appear to be corrupt if you try and open them" rcmaehl 1 We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now